diff --git a/archives/index.html b/archives/index.html index 4aec441..0897e82 100644 --- a/archives/index.html +++ b/archives/index.html @@ -3,5 +3,5 @@ -

Archives

✒️ Total posts: 6

Archives

✒️ Total posts: 7

\ No newline at end of file diff --git a/categories/ideas/index.html b/categories/ideas/index.html index bc6ead8..38ebc1c 100644 --- a/categories/ideas/index.html +++ b/categories/ideas/index.html @@ -3,5 +3,5 @@ -

Ideas

Ideas

\ No newline at end of file diff --git a/categories/ideas/index.xml b/categories/ideas/index.xml index 31d6b68..8107386 100644 --- a/categories/ideas/index.xml +++ b/categories/ideas/index.xml @@ -1,4 +1,180 @@ -Ideas on Futuristic ideashttps://cheese-cracker.github.io/categories/ideas/Recent content in Ideas on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Ideas on Futuristic ideashttps://cheese-cracker.github.io/categories/ideas/Recent content in Ideas on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/categories/index.html b/categories/index.html index 9edc2f3..5a5acb1 100644 --- a/categories/index.html +++ b/categories/index.html @@ -3,5 +3,5 @@ -

Categories

Categories

\ No newline at end of file diff --git a/categories/index.xml b/categories/index.xml index 10bb8a2..6c6880f 100644 --- a/categories/index.xml +++ b/categories/index.xml @@ -1,4 +1,180 @@ -Categories on Futuristic ideashttps://cheese-cracker.github.io/categories/Recent content in Categories on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Categories on Futuristic ideashttps://cheese-cracker.github.io/categories/Recent content in Categories on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/categories/notes/index.xml b/categories/notes/index.xml index ed1568e..0ac8700 100644 --- a/categories/notes/index.xml +++ b/categories/notes/index.xml @@ -1,4 +1,180 @@ -Notes on Futuristic ideashttps://cheese-cracker.github.io/categories/notes/Recent content in Notes on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Notes on Futuristic ideashttps://cheese-cracker.github.io/categories/notes/Recent content in Notes on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/index.html b/index.html index 4bcd3e1..b65df34 100644 --- a/index.html +++ b/index.html @@ -3,5 +3,6 @@ -
  • Discrete Vs Continuous

    2022-01-26

    Introduction In this post, we delve into the mental model (or abstract feeling) of things being continuous Vs discrete. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.

  • Computational Geometry

    2020-10-01

    Key Resources Textbook: Computational Geometry - Algorithms and Applications Coursera Course: For the Problemset and Implementations (Till Part 5) Philipp Kindermann’s Lectures Series (Part 6 and Onwards) Various Random Resources found on the internet!

  • Numerical Analysis

    2020-01-20

    Resources Jacob Bishop’s Tutorials Part 5-7 covers most topics Gauss Quadrature Vs Newton Cotes’ Visualization Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.) Basic Analysis Catastrophic Cancellation Significant Digits Vs Decimal points Sum for minimal error, rounding/chopping Taylor Series’ Approximation and Error Iterative Methods Bisection Regula Falsi (Method of Chords) Secant Swap to whichever is close Fixed Point Iteration Order of convergences Uniqueness Error Analysis Newton Raphson Order of convergences Matrix Techniques Pivoting (Partial Pivoting = Every Step) Scaling First before Pivoting Matrix Norms Norm_1(A) = max(col sum) Norm_inf(A) = max(row sum) Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm Conditional No.

  • Math Modelling

    2019-05-20

    Important Topics Routh Hurwitz Test Matrix of Variation/Jacobian of dx/dt (and dy/dt) Stability of solution Local Stability (Matrix of Variation) Eigenvalues Positive Definate : Unstable Negative Definate : Local AS Imaginary Eigenvalues: Spiral Global Stability (Appropriate Lyaponov Function) Test stability by Lyapunov Funcn or any other (V) has derivative negative definate $$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$

  • Principles of Economics

    2019-05-20

    Introduction These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). Feel free to collaborate to the Online Version of POE Notes.

  • Money macro

    2024-04-11

    What is Money ? An oversimplified view of the economic system goes like the following: +When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people.

  • Discrete Vs Continuous

    2022-01-26

    Introduction In this post, we delve into the mental model (or abstract feeling) of things being continuous Vs discrete. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.

  • Computational Geometry

    2020-10-01

    Key Resources Textbook: Computational Geometry - Algorithms and Applications Coursera Course: For the Problemset and Implementations (Till Part 5) Philipp Kindermann’s Lectures Series (Part 6 and Onwards) Various Random Resources found on the internet!

  • Numerical Analysis

    2020-01-20

    Resources Jacob Bishop’s Tutorials Part 5-7 covers most topics Gauss Quadrature Vs Newton Cotes’ Visualization Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.) Basic Analysis Catastrophic Cancellation Significant Digits Vs Decimal points Sum for minimal error, rounding/chopping Taylor Series’ Approximation and Error Iterative Methods Bisection Regula Falsi (Method of Chords) Secant Swap to whichever is close Fixed Point Iteration Order of convergences Uniqueness Error Analysis Newton Raphson Order of convergences Matrix Techniques Pivoting (Partial Pivoting = Every Step) Scaling First before Pivoting Matrix Norms Norm_1(A) = max(col sum) Norm_inf(A) = max(row sum) Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm Conditional No.

  • Math Modelling

    2019-05-20

    Important Topics Routh Hurwitz Test Matrix of Variation/Jacobian of dx/dt (and dy/dt) Stability of solution Local Stability (Matrix of Variation) Eigenvalues Positive Definate : Unstable Negative Definate : Local AS Imaginary Eigenvalues: Spiral Global Stability (Appropriate Lyaponov Function) Test stability by Lyapunov Funcn or any other (V) has derivative negative definate $$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$

\ No newline at end of file diff --git a/index.xml b/index.xml index 467f2c7..0e5467d 100644 --- a/index.xml +++ b/index.xml @@ -1,4 +1,180 @@ -Futuristic ideashttps://cheese-cracker.github.io/Recent content on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Futuristic ideashttps://cheese-cracker.github.io/Recent content on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/page/2/index.html b/page/2/index.html index 5ed4957..a1145f5 100644 --- a/page/2/index.html +++ b/page/2/index.html @@ -3,7 +3,7 @@ -
  • Principles of Economics

    2019-05-20

    Introduction These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). Feel free to collaborate to the Online Version of POE Notes.

  • Graphs and Networks

    2019-03-10

    List of Algorithms Minimum Spanning Trees Krusikal’s (Any point but min with no cycle) Prim’s (From starting point) Graph Traversal Techniques BFS DFS Djkstra’s Shortest Path Apply DFS for checking cut vertex Eulerian/Hamiltonian Graphs

\ No newline at end of file diff --git a/posts/discrete-vs-continuous/index.html b/posts/discrete-vs-continuous/index.html index aac3f49..5a18552 100644 --- a/posts/discrete-vs-continuous/index.html +++ b/posts/discrete-vs-continuous/index.html @@ -48,5 +48,5 @@ $$ y = C_1 e^{r_1 t} + C_2 t e^{r_2 t}$$

For the general solution of a 2nd order recurrence relation with distinct roots, $$ y = C_1 r_1^n + C_2 r_2^n = C_1 e^{ln(r_1) n} + C_2 e^{ln(r_2) n}$$ and for repeated root, -$$ y = C_1 r_1^n + C_2 n r_2^n = C_1 e^{ln(r_1) n} + C_2 n e^{ln(r_2) n}$$

Other Interesting References

Previous: Computational Geometry

\ No newline at end of file diff --git a/posts/index.html b/posts/index.html index 4a99c5c..71a9ec2 100644 --- a/posts/index.html +++ b/posts/index.html @@ -3,5 +3,6 @@ -

Posts

  • Discrete Vs Continuous

    2022-01-26

    Introduction In this post, we delve into the mental model (or abstract feeling) of things being continuous Vs discrete. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.

  • Computational Geometry

    2020-10-01

    Key Resources Textbook: Computational Geometry - Algorithms and Applications Coursera Course: For the Problemset and Implementations (Till Part 5) Philipp Kindermann’s Lectures Series (Part 6 and Onwards) Various Random Resources found on the internet!

  • Numerical Analysis

    2020-01-20

    Resources Jacob Bishop’s Tutorials Part 5-7 covers most topics Gauss Quadrature Vs Newton Cotes’ Visualization Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.) Basic Analysis Catastrophic Cancellation Significant Digits Vs Decimal points Sum for minimal error, rounding/chopping Taylor Series’ Approximation and Error Iterative Methods Bisection Regula Falsi (Method of Chords) Secant Swap to whichever is close Fixed Point Iteration Order of convergences Uniqueness Error Analysis Newton Raphson Order of convergences Matrix Techniques Pivoting (Partial Pivoting = Every Step) Scaling First before Pivoting Matrix Norms Norm_1(A) = max(col sum) Norm_inf(A) = max(row sum) Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm Conditional No.

  • Math Modelling

    2019-05-20

    Important Topics Routh Hurwitz Test Matrix of Variation/Jacobian of dx/dt (and dy/dt) Stability of solution Local Stability (Matrix of Variation) Eigenvalues Positive Definate : Unstable Negative Definate : Local AS Imaginary Eigenvalues: Spiral Global Stability (Appropriate Lyaponov Function) Test stability by Lyapunov Funcn or any other (V) has derivative negative definate $$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$

  • Principles of Economics

    2019-05-20

    Introduction These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). Feel free to collaborate to the Online Version of POE Notes.

Posts

  • Money macro

    2024-04-11

    What is Money ? An oversimplified view of the economic system goes like the following: +When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people.

  • Discrete Vs Continuous

    2022-01-26

    Introduction In this post, we delve into the mental model (or abstract feeling) of things being continuous Vs discrete. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.

  • Computational Geometry

    2020-10-01

    Key Resources Textbook: Computational Geometry - Algorithms and Applications Coursera Course: For the Problemset and Implementations (Till Part 5) Philipp Kindermann’s Lectures Series (Part 6 and Onwards) Various Random Resources found on the internet!

  • Numerical Analysis

    2020-01-20

    Resources Jacob Bishop’s Tutorials Part 5-7 covers most topics Gauss Quadrature Vs Newton Cotes’ Visualization Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.) Basic Analysis Catastrophic Cancellation Significant Digits Vs Decimal points Sum for minimal error, rounding/chopping Taylor Series’ Approximation and Error Iterative Methods Bisection Regula Falsi (Method of Chords) Secant Swap to whichever is close Fixed Point Iteration Order of convergences Uniqueness Error Analysis Newton Raphson Order of convergences Matrix Techniques Pivoting (Partial Pivoting = Every Step) Scaling First before Pivoting Matrix Norms Norm_1(A) = max(col sum) Norm_inf(A) = max(row sum) Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm Conditional No.

  • Math Modelling

    2019-05-20

    Important Topics Routh Hurwitz Test Matrix of Variation/Jacobian of dx/dt (and dy/dt) Stability of solution Local Stability (Matrix of Variation) Eigenvalues Positive Definate : Unstable Negative Definate : Local AS Imaginary Eigenvalues: Spiral Global Stability (Appropriate Lyaponov Function) Test stability by Lyapunov Funcn or any other (V) has derivative negative definate $$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$

\ No newline at end of file diff --git a/posts/index.xml b/posts/index.xml index 7c581fe..5eb2e7a 100644 --- a/posts/index.xml +++ b/posts/index.xml @@ -1,4 +1,180 @@ -Posts on Futuristic ideashttps://cheese-cracker.github.io/posts/Recent content in Posts on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Posts on Futuristic ideashttps://cheese-cracker.github.io/posts/Recent content in Posts on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/posts/money-macro/index.html b/posts/money-macro/index.html new file mode 100644 index 0000000..72b8cba --- /dev/null +++ b/posts/money-macro/index.html @@ -0,0 +1,18 @@ +Money macro – Futuristic ideas +

Money macro

What is Money ?

An oversimplified view of the economic system goes like the following:

  • When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.
  • When Fed reduces the money supply through Quantitative Tightening, banks find it harder to lend money and thus provide loans at a much higher rate.
Money Printer going brrrr during 2020

Meme: Money printer going brrrr during 2020

With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.

For a better idea of this, I would request you to watch:


tradingeconomics.com: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks.

Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.

How was USD made the reserve currency?

  1. 1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.
  2. Dollar was to be backed by gold. This lasted till the 1970s
  3. 1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.
  4. Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, “Petrodollar” * +which helps prevent the financial bubble from collapsing.

Medium: An oversimplified example of petrodollar recycling

*For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading news sources and from the reasons for the US interventions in Libya, Iraq etc.

Why is analyzing money/financial instruments important?

Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.

For example, Innovation of the stock market in Holland lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).

Analyzing the major economic bubbles from the past we have:

Numerous, sector-wise stock market bubbles keep forming from time to time.

Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.

Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:

  • Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)
  • Fund-transfer among Banks: Real-Time Gross Settlement, Automated Clearing House
  • Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B
  • Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay
  • CBDCs: Digital Yuan, E-rupee

Although controversial, the book Sapiens provides useful examples of the financial bubbles in the past.

Incentive Schemes - Why is it needed?

Money is a unique and extremely useful incentive scheme since it provides,

  1. Store of Value - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.
  2. Medium of Exchange - Rewards can be transferred.

The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.

An insightful fictional case study is that of 20th Century Motor Company from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the tragedy of the commons at the start, before the entire system slowly crumbles.

Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.

companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing

companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing

A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts.
So then, how do we well-distribute wealth and supercharge innovation?

A foray into UBI

Is giving people free money or a universal basic income, a good idea?

Some flaws of this model would be:

  • May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.
  • Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.
  • People who perform better or provide more value won’t be adequately rewarded. (So, people may move to other countries/regions)
  • Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.

A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :

  • Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages
  • Once pumped up, the rich person sells the crypto positions

Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.

Goods and Services under CPI

Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.


tradingeconomics.com: US CPI Inflation Rate 2014-2024

Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place.

Other approaches to UBI, like providing food rations and free education may work better in developing society.

Analyzing Money in a Better Way

Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.

Some ways to analyze money include,

  • Utility Vs Time - Shows how an asset’s price would age with time. A car would most likely be a depreciating asset with a sloping curve.
Utiltiy Time
+Curves

Utility vs Time Curve for a flight ticket.

  • Rivalrousness Vs Excludability - This article from vitalik’s blog goes into much depth about it.
    • Rivalrousness: to what extent does one person enjoying the good reduce another person’s ability to enjoy it?
    • Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?
Rivalrousness Vs
+Excludablity Chart

Vitalik’s Blog: Rivalrousness Vs Excludability Chart

  • Different concepts of money in the future
    • Future money with expiry dates
      • Inflation already does this to some extent even today
      • Gift Cards and Vouchers already do this to some extent
    • DAOs - Corporations based on group contributions.

Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,

  • Reducing deadweight loss or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)
  • Encouraging use of sustainable products/methods. (Possibly, the original intent of Blackrock’s ESG scores before being corrupted by politics?)
  • Helping innovative/research companies receive adequate monetary funding till value can be +provided.

Further Reading

In the context of nations, governments tend to focus on other aspects of money like,

  • Velocity of money: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.
  • How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)
  • Numerous other indicators are available on trading economics indicators

Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:

  1. Political power. (President Vs Factory Worker)
  2. Work type (Work in AI/ML Vs Work in Agriculture)
  3. Self-satisfaction (Sports Player Vs Factory Worker)
  4. Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.

References

Previous: Discrete Vs Continuous

\ No newline at end of file diff --git a/posts/page/2/index.html b/posts/page/2/index.html index 3b38a42..6786bdf 100644 --- a/posts/page/2/index.html +++ b/posts/page/2/index.html @@ -3,7 +3,7 @@ -

Posts

Posts

  • Principles of Economics

    2019-05-20

    Introduction These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). Feel free to collaborate to the Online Version of POE Notes.

  • Graphs and Networks

    2019-03-10

    List of Algorithms Minimum Spanning Trees Krusikal’s (Any point but min with no cycle) Prim’s (From starting point) Graph Traversal Techniques BFS DFS Djkstra’s Shortest Path Apply DFS for checking cut vertex Eulerian/Hamiltonian Graphs

\ No newline at end of file diff --git a/search/index.xml b/search/index.xml index 52cec93..31cf51b 100644 --- a/search/index.xml +++ b/search/index.xml @@ -1,4 +1,180 @@ -Search on Futuristic ideashttps://cheese-cracker.github.io/search/Recent content in Search on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerDiscrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Search on Futuristic ideashttps://cheese-cracker.github.io/search/Recent content in Search on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerMoney macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/sitemap.xml b/sitemap.xml index ee024e9..5db759e 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://cheese-cracker.github.io/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/index/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/posts/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/categories/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/posts/discrete-vs-continuous/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/categories/ideas/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/math/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/mentalmodels/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/numericalmethods/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/signalprocessing/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/c++/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/posts/compgeom/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/tags/cs/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/tags/graphs/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/categories/notes/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/posts/numan/2020-01-20T00:00:00+00:00https://cheese-cracker.github.io/tags/economics/2019-05-20T00:00:00+00:00https://cheese-cracker.github.io/posts/mmodelling/2019-05-20T00:00:00+00:00https://cheese-cracker.github.io/posts/poe/2019-05-20T00:00:00+00:00https://cheese-cracker.github.io/posts/graphsnetworks/2019-03-10T00:00:00+00:00https://cheese-cracker.github.io/about/https://cheese-cracker.github.io/archives/https://cheese-cracker.github.io/search/ \ No newline at end of file +https://cheese-cracker.github.io/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/categories/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/economics/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/finance/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/categories/ideas/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/index/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/markets/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/mentalmodels/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/posts/money-macro/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/posts/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/tags/2024-04-11T00:00:00+00:00https://cheese-cracker.github.io/posts/discrete-vs-continuous/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/math/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/numericalmethods/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/signalprocessing/2022-01-26T00:00:00+00:00https://cheese-cracker.github.io/tags/c++/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/posts/compgeom/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/tags/cs/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/tags/graphs/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/categories/notes/2020-10-01T00:00:00+00:00https://cheese-cracker.github.io/posts/numan/2020-01-20T00:00:00+00:00https://cheese-cracker.github.io/posts/mmodelling/2019-05-20T00:00:00+00:00https://cheese-cracker.github.io/posts/poe/2019-05-20T00:00:00+00:00https://cheese-cracker.github.io/posts/graphsnetworks/2019-03-10T00:00:00+00:00https://cheese-cracker.github.io/about/https://cheese-cracker.github.io/archives/https://cheese-cracker.github.io/search/ \ No newline at end of file diff --git a/tags/c++/index.xml b/tags/c++/index.xml index b745ed0..2fc5e37 100644 --- a/tags/c++/index.xml +++ b/tags/c++/index.xml @@ -1,4 +1,180 @@ -C++ on Futuristic ideashttps://cheese-cracker.github.io/tags/c++/Recent content in C++ on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +C++ on Futuristic ideashttps://cheese-cracker.github.io/tags/c++/Recent content in C++ on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/cs/index.xml b/tags/cs/index.xml index 30f2c18..d96928c 100644 --- a/tags/cs/index.xml +++ b/tags/cs/index.xml @@ -1,4 +1,180 @@ -Cs on Futuristic ideashttps://cheese-cracker.github.io/tags/cs/Recent content in Cs on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Cs on Futuristic ideashttps://cheese-cracker.github.io/tags/cs/Recent content in Cs on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/economics/index.html b/tags/economics/index.html index 9a864ae..c4440e6 100644 --- a/tags/economics/index.html +++ b/tags/economics/index.html @@ -3,5 +3,5 @@ -

Economics

Economics

\ No newline at end of file diff --git a/tags/economics/index.xml b/tags/economics/index.xml index c91008c..d1ec65a 100644 --- a/tags/economics/index.xml +++ b/tags/economics/index.xml @@ -1,4 +1,180 @@ -Economics on Futuristic ideashttps://cheese-cracker.github.io/tags/economics/Recent content in Economics on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerMon, 20 May 2019 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Economics on Futuristic ideashttps://cheese-cracker.github.io/tags/economics/Recent content in Economics on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/finance/index.html b/tags/finance/index.html new file mode 100644 index 0000000..cdf01c3 --- /dev/null +++ b/tags/finance/index.html @@ -0,0 +1,7 @@ +Finance – Futuristic ideas +

Finance

\ No newline at end of file diff --git a/tags/finance/index.xml b/tags/finance/index.xml new file mode 100644 index 0000000..1031326 --- /dev/null +++ b/tags/finance/index.xml @@ -0,0 +1,2547 @@ +Finance on Futuristic ideashttps://cheese-cracker.github.io/tags/finance/Recent content in Finance on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +<p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. +In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/DvsC.jpg"> </img> +<p><small> Poster originally by mathbytori.blogspot.com </small></p> +</div> +<blockquote> +<p>Throughout this post, the terms &lsquo;discrete&rsquo; and &lsquo;continuous&rsquo; are somewhat loosely defined.</p> +</blockquote> +<p>A simple intuition on continuous and discrete would give us,</p> +<table> +<thead> +<tr> +<th style="text-align:center">Discrete</th> +<th style="text-align:center">Continuous</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:center">Distinct, seperate and countable</td> +<td style="text-align:center">Fluid, mostly singular</td> +</tr> +<tr> +<td style="text-align:center">Dotted Line</td> +<td style="text-align:center">Normal straight Line</td> +</tr> +<tr> +<td style="text-align:center">Scattered</td> +<td style="text-align:center">Unionized</td> +</tr> +<tr> +<td style="text-align:center">Set of Integers $Z$: Distinct points on the number line</td> +<td style="text-align:center">Set of Real Numbers $\Re$: Continuous line on the number line</td> +</tr> +<tr> +<td style="text-align:center">Sets not dense <small>(in any metric space)</small></td> +<td style="text-align:center">Set is dense <small>(in any metric space)</small></td> +</tr> +<tr> +<td style="text-align:center">Non-seperable Metric Space<small>(like discrete metric space)</small></td> +<td style="text-align:center">Seperable Metric Space</td> +</tr> +<tr> +<td style="text-align:center">Discrete Probability Distribution</td> +<td style="text-align:center">Continuous Probability Distributions</td> +</tr> +<tr> +<td style="text-align:center">Histograms</td> +<td style="text-align:center">Kernel Density Estimates</td> +</tr> +<tr> +<td style="text-align:center">Digital Image Processing</td> +<td style="text-align:center">Analog Image Processing</td> +</tr> +<tr> +<td style="text-align:center">Discrete Delaunay Triangulations</td> +<td style="text-align:center">Continuous Voronoi Diagrams</td> +</tr> +<tr> +<td style="text-align:center">Discrete Time Signals</td> +<td style="text-align:center">Continuous Time Signals</td> +</tr> +<tr> +<td style="text-align:center">Sum of many discrete rectangles</td> +<td style="text-align:center">Area under a continuous curve</td> +</tr> +<tr> +<td style="text-align:center">Discrete Factorials</td> +<td style="text-align:center">Continuous Gamma Function</td> +</tr> +<tr> +<td style="text-align:center">Discrete Transforms</td> +<td style="text-align:center">Continuous Transforms</td> +</tr> +<tr> +<td style="text-align:center">Discrete Recurrence Relations</td> +<td style="text-align:center">Continuous Differential Equations</td> +</tr> +</tbody> +</table> +<blockquote> +<p>A common trend to notice is that <strong>discrete</strong> things tend to take a <strong>finite or countable</strong> set of values.</p> +</blockquote> +<hr> +<h2 id="discrete-signals-vs-continuous-signals">Discrete Signals Vs Continuous Signals</h2> +<p>Moving to more concrete definitions, +Let us take the example of Continuous vs Discrete in the context of Signals. +This divides us into four parts shown below,</p> +<div align="center"> +<img height="400" src="https://cheese-cracker.github.io/plots/des/4SignalDiagram.jpg" alt="Four Divisions of Signals"> </img> +<p><small> Clockwise: CT Analog, CT Digital, DT Digital, DT Analog</small></p> +</div> +<p>The differentiating factors are,</p> +<ul> +<li>Discrete time (DT) Vs Continuous time (CT)</li> +<li>Analog signal Vs Digital signal</li> +</ul> +<p>Here, digital signal and analog signals are both continuous in time but the +CT digital signal has only a discrete set of values for the ouput $y(t)$.</p> +<blockquote> +<p>In this post, the ideas of &lsquo;digital&rsquo; and &lsquo;discrete&rsquo; may be mixed because &lsquo;digital&rsquo; signals are still discrete in the y-axis.</p> +</blockquote> +<hr> +<h2 id="area-under-a-continuous-curve-vs-sum-of-many-discrete-rectangles">Area under a Continuous Curve Vs Sum of many Discrete Rectangles</h2> +<p>Considering the area under the curve for any continuous function $y(t)$, +the area is given by $\int_{t_0}^{t_n} y(t)$</p> +<p>However, if we consider the digital equivalent of this function (by quantizing the input), the area under the curve can just be the sum of distinct rectangles.</p> +<p>So we get, +$\int_{t_0}^{t_n} y(t) = \sum_{i=0}^{n-1} y(t_i)$.</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/MidRiemann2.svg"> </img> +<p><small> Wikipedia: Riemann Sum (taking midpoints)</small></p> +</div> +<p>Taking the value at each midpoints and summing the rectangles we get, +$$\int \limits_a^b m(x)dx = \lim_{n \rightarrow \infty} \frac{|b - a|}{n} \sum_{k = 1}^{n} m(a + k \frac{|b - a|}{2n})$$ +So, as we make the partition intervals smaller ($\lim_{n \rightarrow \infty} \frac{1}{n}$), this sum becomes closer to the actual integral.</p> +<blockquote> +<p>A <a href="https://en.wikipedia.org/wiki/Quantization_%28signal_processing%29#Mid-riser_and_mid-tread_uniform_quantizers"target="_blank" rel="noopener">mid-riser or mid-tread quantizer</a> in signal processing, would be analogous to a Riemann sum except for one point. The quantizer divides the signal $y(t)$ into discrete bins (and reconstructs). However, the riemann sum would divide the input $t$ into discrete bins.</p> +</blockquote> +<div align="center"> +<img src="https://cheese-cracker.github.io/plots/des/QuantizationLevels4.png"> </img> +<p><small> Wikipedia: Quantization of Signal with 4 Levels</small></p> +</div> +<p>Instead of partitioning the continuous function into <strong>rectangles</strong>, we could take the function values at two points and break it into <strong>trapezoids</strong>. (Trapezoidal Rule)</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/TrapRiemann2.png"> </img> +<p><small> Wikipedia: Trapezoidal Rule </small></p> +</div> +<p>Similarly, we can approximate with even more function points to get the other <a href="https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas"target="_blank" rel="noopener">Newton Cotes Formulas</a>.</p> +<p>So, all these summations functions are approximations to integrations (each with a same or faster convergence).</p> +<hr> +<h2 id="discrete-factorials-vs-continuous-gamma-function">Discrete Factorials Vs Continuous Gamma Function</h2> +<p>Considering another seqn of numbers, +$$1, 1, 2, 6, 24, 120, 720 &hellip;$$ +Can you guess the sequence?</p> +<p>For any given sequence in $N$, there will always be infinitely many continuous functions in $\Re$, that satisfy the sequence.</p> +<p>But one special function that represents this is the <strong>gamma</strong> function, +$$ \Gamma(z) = \int_0^{\infty} x^{z-1} e^{-x}dx$$</p> +<p>Here, +$$ \Gamma (n + 1) = n!$$ +thus captures the <strong>factorial function</strong>.</p> +<p>(Note that however the gamma function is continuous only in $\Re^{+}$.)</p> +<p>For many sequences which are a discrete recurrence relation, a continuous generating function can be also found.</p> +<hr> +<h2 id="discrete-vs-continuous---fourier-like-transforms">Discrete Vs Continuous - Fourier-Like Transforms</h2> +<p>Another interesting and useful concept when dealing with signal processing, is the <strong>fourier transforms</strong>. +It is a very essential way to transfer a random signal (think square, triangular, wavy, crazy or any time-based oscillation) +into a mixture of sine ways of different frequencies. +3blue1brown has an amazing <a href="https://odysee.com/@3Blue1Brown:b/but-what-is-the-fourier-transform-a:b"target="_blank" rel="noopener">visual introduction to the fourier transform</a>.</p> +<p>When considering fourier transforms, there are numerous generalization for different signals. +The types of transform depends on the 4 differentiating factors,</p> +<ol> +<li>Discrete Signal or Continuous Signal</li> +<li>Periodic Signal or Aperiodic (Infinite Period) Signal</li> +<li>Transform or Inverse Transform (Analysis or Synthesis)</li> +<li>Imaginary exponent Vs Complex(re + im) exponent in equation</li> +</ol> +<p>Considering the <strong>normal transform in real domain</strong>, varying points <strong>1</strong> and <strong>2</strong>, we get the following table,</p> +<div align="center"> +<img height="250" src="https://cheese-cracker.github.io/plots/des/SeriesVsTransform.png"> </img> +<p><small> Fourier Series Vs Fourier Transform</small></p> +</div> +<p>Similar to the CTFT and DTFT, there is also inverse CTFT and inverse DTFT. +This <a href="https://medium.com/sho-jp/fourier-transform-101-part-4-discrete-fourier-transform-8fc3fbb763f3"target="_blank" rel="noopener">article</a> has a nice table,</p> +<div align="center"> +<img height="500" src="https://cheese-cracker.github.io/plots/des/Medium-FT.jpeg"> </img> +<p><small> Medium: Fourier Transform Table</small></p> +<p><small>&lsquo;Complex Fourier Series&rsquo; is the same as &lsquo;Continuous Time Fourier Series&rsquo;</small></p> +</div> +<p>Switching the last parameter <strong>4</strong> from purely imaginary to complex exponents, give us +two new transforms -</p> +<ul> +<li>Laplace Transform (Continuous Domain)</li> +<li>Z - Transform (Discrete Domain)</li> +</ul> +<blockquote> +<p>In the transforms, the real component gives us the $e^x$ curves and the complex exponent gives us the $e^{ix} = cos(x) + isin(x)$ curves.</p> +</blockquote> +<h4 id="an-ugly-inconsistency">An ugly inconsistency</h4> +<p>Considering the laplace transform to be, +$$ X(s) = \int_{-\infty}^{\infty} x(t) e^{-st} dt $$ +An intuitive definition of Z-transform would be, +$$ X(z) = \sum_{-\infty}^{\infty} x[n] e^{-zn} $$ +where z just like s would be defined by $z = \sigma + i\omega$</p> +<p>Unfortunately, due to ease of usage in digital signal processing the definition of z-transform was made rather unintuitive. +Hence, it is given by, +$$X(z) = \sum_{-\infty}^{\infty} x[n] z^{n} $$ +where $z = e^{sT}$ (instead of $z=sT$)</p> +<p>From this we see the mapping,</p> +<p><strong>$j\omega$ axis for the Laplace transform $=$ unit circle for the Z transform</strong></p> +<p>See <a href="https://dsp.stackexchange.com/questions/72140/why-not-use-the-same-standard-exponentials-for-both-continuous-and-discrete-ti/72143#72143"target="_blank" rel="noopener">this thread</a> to know more. +Another <a href="https://math.stackexchange.com/questions/3169159/why-define-the-z-transform-differently-from-the-laplace-transform"target="_blank" rel="noopener">stackexchange thread</a>, also points out why the laplace transform cannot be defined the other way around.</p> +<hr> +<h2 id="discrete-recurrence-relations-vs-continuous-differential-equations">Discrete Recurrence Relations Vs Continuous Differential Equations</h2> +<p>Consider two alien species in two different planets with no natural predators +and sufficient resources to grow.</p> +<ol> +<li>The first alien species breeds naturally with its growth twice its current population (population growth rate 200%).</li> +<li>The second alien species reproduces using binary fission. So, one alien essentially splits into two new alien creatures. And all the alien species undergoes this binary fission every new years&rsquo; eve.</li> +</ol> +<p>Both these cases could be modelled as,</p> +<ol> +<li>$y&rsquo; = 2y$ where $y$ is the population, and $y&rsquo;$ is it&rsquo;s derivative (the population growth rate).</li> +<li>$a_n = 2 a_{n-1}$ where $a_n$ is the population in year $n$</li> +</ol> +<p>Notice that in case of <strong>alien species no. 1</strong> we are modelling it as a <strong>continuous differential equation</strong> whereas in the case of <strong>alien species no. 2</strong> we are modelling it as a <strong>discrete recurrence relation</strong>.</p> +<p>In case of alien species no. 1, +we have to solve the differential equation which gives us, +$$y = a_0 e^{2t}$$ +where $a_0$ is a constant representing the original population of aliens.</p> +<p>So if there where 1 million aliens, originally, +there would $e^2 \approx 7.34$ million aliens after just one year.</p> +<p>For alien species no. 2, +it is relatively straightforward to see that a population of 1 million aliens would be 2 million after the first year.</p> +<p>It is also intuitive to notice that after any $n$ years the solution to this is, +$$ a_n = a_0 2^n $$</p> +<p>This similarity between the population growth equations can be seen better by modelling the recurrence relation as an diferential equation.</p> +<p>Consider the population after 3 years, it is 4 times the population after year 1 so,</p> +<p>$$a_3 = 2 * ( 2 * a_1 )$$ +$$a_3 - a_1 = (2^2 - 1) a_1$$</p> +<p>So from this we could say for any general points a_{n+k} and a_n,</p> +<p>$$ \Delta y \approx \Delta a_n = a_{n + k} - a_n = (2^k - 1) * a_n $$ +$$ \Delta t \approx \Delta n = (n + k) - n = k $$</p> +<p>$$ \lim_{\Delta n \rightarrow 0} \frac{\Delta a_n}{\Delta n} = \lim_{\Delta k \rightarrow 0 } \frac{(2^k - 1) * a_n}{k}$$</p> +<p>Taking derivative on both numerator and denominator with the <a href="https://en.wikipedia.org/wiki/L%27H%C3%B4pital%27s_rule"target="_blank" rel="noopener">El &lsquo;Hospital&rsquo; rule</a>,</p> +<p>$$ \lim_{\Delta n \rightarrow 0} \frac{\Delta a_n}{ \Delta n} = ln(2) a_n $$</p> +<p>Modelling $a_n$ as $y$ and $n$ as $t$ we have,</p> +<p>$$ y&rsquo; = ln(2) y $$ +$$ y = a_0 e^{ln(2) t} = a_0 2^t $$</p> +<p>Or better expressed as,</p> +<p>$$ a_n = a_0 2^n $$</p> +<p>Another way to look at the two alien species is that,</p> +<ol> +<li>The 1st alien species is a 100% compound interest which is <a href="https://en.wikipedia.org/wiki/Compound_interest#Continuous_compounding"target="_blank" rel="noopener">continuous compounded</a>.</li> +<li>The 2nd alien species is a 100% compound interest which is compounded annually.</li> +</ol> +<p>Note that instead if we take any other coeffecient too this would work!</p> +<h4 id="for-2nd-order-and-above">For 2nd Order and above</h4> +<p>It also works similarly for second order differential equations and second order recurrence relations. +The technique to solve 2nd order ODE and 2nd order RR are the same,</p> +<ol> +<li>Put the solution as $y = C_0 e^{rt}$ or $a_n = \alpha^n = e^{ln(\alpha)n}$</li> +<li>Solve the quadratic equation or &ldquo;characteristic equation&rdquo; that transpires to get the general solution</li> +<li>Find the particular solution, this could be with the help of specific boundary conditions etc. and combine.</li> +</ol> +<p>Without getting into too much detail, +For the general solution of 2nd order ODE with distinct roots, +$$ y = C_1 e^{r_1 t} + C_2 e^{r_2 t}$$ +and for repeated root, +$$ y = C_1 e^{r_1 t} + C_2 t e^{r_2 t}$$</p> +<p>For the general solution of a 2nd order recurrence relation with distinct roots, +$$ y = C_1 r_1^n + C_2 r_2^n = C_1 e^{ln(r_1) n} + C_2 e^{ln(r_2) n}$$ +and for repeated root, +$$ y = C_1 r_1^n + C_2 n r_2^n = C_1 e^{ln(r_1) n} + C_2 n e^{ln(r_2) n}$$</p> +<h2 id="other-interesting-references">Other Interesting References</h2> +<ul> +<li>Can&rsquo;t find a <a href="https://math.stackexchange.com/questions/126803/generating-function-for-the-factorial-sequence"target="_blank" rel="noopener">generating function for factorials</a></li> +<li>A <a href="http://philsci-archive.pitt.edu/4692/1/AnalogDigitalContinuousDiscrete.pdf"target="_blank" rel="noopener">philosophical and cognitive science view</a> of analog, digital, continuous and discrete.</li> +<li><a href="https://medium.com/greyatom/baby-steps-of-statistics-part-1-c76bafb30288"target="_blank" rel="noopener">Baby Steps of Statistics</a></li> +<li><a href="https://medium.com/sho-jp/fourier-transform-101-part-4-discrete-fourier-transform-8fc3fbb763f3"target="_blank" rel="noopener">Fourier Transforms 101</a></li> +<li>For mental models in other domains, refer <a href="https://fs.blog/mental-models/"target="_blank" rel="noopener">Farnam Street Blog</a> or <a href="https://www.goodreads.com/book/show/41181911-super-thinking"target="_blank" rel="noopener">Super Thinking Book</a></li> +<li>Try to find an anology for discrete vs continuous, with separable and non-separable spaces. Good Resources: <a href="https://en.wikipedia.org/wiki/Separable_space"target="_blank" rel="noopener">Separable Spaces</a>, <a href="https://math.stackexchange.com/questions/3946786/example-of-non-separable-subspace-of-a-separable-hausdorff-space"target="_blank" rel="noopener">Discrete-like non-separable subspaces in separable spaces</a>, <a href="https://topology.jdabbs.com/properties"target="_blank" rel="noopener">Database of Topological Counterexamples</a></li> +</ul>Computational Geometryhttps://cheese-cracker.github.io/posts/compgeom/Thu, 01 Oct 2020 00:00:00 +0000https://cheese-cracker.github.io/posts/compgeom/<h2 id="key-resources">Key Resources</h2> +<ol> +<li>Textbook: Computational Geometry - Algorithms and Applications</li> +<li><a href="https://www.coursera.org/learn/computational-geometry"target="_blank" rel="noopener">Coursera Course</a>: For the Problemset and Implementations (Till Part 5)</li> +<li><a href="https://www.youtube.com/channel/UCuAzKw_VngkAsQh7ummYq0A/playlists?view=50&amp;shelf_id=1"target="_blank" rel="noopener">Philipp Kindermann</a>&rsquo;s Lectures Series (Part 6 and Onwards)</li> +<li>Various Random Resources found on the internet! +<ul> +<li><a href="https://geomalgorithms.com/"target="_blank" rel="noopener">Geom Algorithms</a></li> +<li><a href="https://cp-algorithms.com/"target="_blank" rel="noopener">CP Algorithms</a></li> +</ul> +</li> +</ol> +<h4 id="further-reading--interesting-resources">Further Reading / Interesting Resources</h4> +<ul> +<li><a href="https://observablehq.com/@mbostock/to-infinity-and-back-again?collection=@observablehq/algorithms"target="_blank" rel="noopener">ObservableHQ - Infinity and Back Again</a>: Voronoi Diagrams for Infinite Polygons</li> +<li>Book: Foundations of Multidimensional and Metric Data Structures - Hanen Samet (2006)</li> +<li><a href="https://www.youtube.com/playlist?list=PL8FaHk7qbOD4F7nPFfgD0dGdLos1uhUPg"target="_blank" rel="noopener">Josh Hug&rsquo;s Lectures on Multidimensional Data</a>: Good intuition on k-d trees and quad trees.</li> +<li><a href="https://www.wias-berlin.de/software/tetgen/features.html"target="_blank" rel="noopener">TestGen</a>: Voronoi Diagrams and Delaunay Tetrahedralizations for 3D Points. Software</li> +<li><a href="https://flylib.com/books/en/2.587.1.38/1/"target="_blank" rel="noopener">Generalization of Voronoi Diagrams</a>: Originally from a book on (Geometric Data Structures for Computer Graphics, 2005)</li> +</ul> +<h2 id="overview">Overview</h2> +<p>To learn computational geometry, these are the steps/resources I used,</p> +<ol> +<li>Week 1 - Week 5: Coursera - Computational Geometry +<ul> +<li>For theory, read from book and/or random resources off the internet. Philipp&rsquo;s lectures are also available for this.</li> +<li>Focus on the problemset for the course.</li> +<li>Recommended Prerequisite: Good understanding and practice of DSA. Some of the problems have tons of edge cases!</li> +</ul> +</li> +<li>Week 6 - Week 10: Philipp Kindermann&rsquo;s Lecture Series +<ul> +<li>This part is more theory oriented and covers Voronoi Diagrams, Delaunay Triangulations too.</li> +<li>Again some parts can be followed up from the book as well.</li> +<li>Recommended Prerequisite: Basic graph theory (maximal planar graph, duals), basic DSA (analyzing time complexity)</li> +</ul> +</li> +</ol> +<h5 id="general-implementation-aspects">General Implementation Aspects</h5> +<ul> +<li>Use slope pairs</li> +<li>Triangle orientation check (sign of area)</li> +<li>Sum of area of triangles to form interior</li> +<li>Ray out of a point inside intersects polygon odd times</li> +<li>Check line segment intersections by checking orientation of each of the four points (not two!)</li> +<li>It also helps to plot sample testcases for debugging</li> +<li>Modulo to cyclicly iterate through points of a Polygon</li> +<li>Carefully inspect, input/output format as well as edge cases</li> +</ul> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// My Header - (Used mostly STL instead of OOP) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#ff79c6">#define ll long long +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6">#define x first +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6">#define y second +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6"></span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;</span> vertex; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;</span> point; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> ppoint; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ppoint INF_POINT <span style="color:#ff79c6">=</span> {<span style="color:#bd93f9">2e9</span>, <span style="color:#bd93f9">2e9</span>}; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> <span style="color:#8be9fd">double</span> EPS <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">1e-16</span>; +</span></span></code></pre></div><h2 id="week-1">Week 1</h2> +<p>1. Point and Vector (Triangle Sign Check)</p> +<p>This will be used in most future problems as well. The most generalized template is below. Note that <code>area</code> is actually twice the actual area.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">int</span> <span style="color:#50fa7b">trisign</span>(ppoint a, ppoint b, ppoint pt){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> area <span style="color:#ff79c6">=</span> a.x <span style="color:#ff79c6">*</span> b.y <span style="color:#ff79c6">+</span> b.x <span style="color:#ff79c6">*</span> pt.y <span style="color:#ff79c6">+</span> pt.x <span style="color:#ff79c6">*</span> a.y <span style="color:#ff79c6">-</span> a.y <span style="color:#ff79c6">*</span> b.x <span style="color:#ff79c6">-</span> b.y <span style="color:#ff79c6">*</span> pt.x <span style="color:#ff79c6">-</span> pt.y <span style="color:#ff79c6">*</span> a.x; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(area <span style="color:#ff79c6">&gt;</span> EPS){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span> <span style="color:#ff79c6">if</span>(area <span style="color:#ff79c6">&lt;</span> <span style="color:#ff79c6">-</span>EPS){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>2. Point in Triangle</p> +<p>Principle is the sum of the 3 individual triangles (2 vertices, 1 point) would be equal to total area (3 vertices).</p> +<p>3. Point in Polygon</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/point_in_polygon_ray.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/point_in_polygon_ray.jpg" width="auto" height="auto" +alt="Point in Polygon with ray from infinity"/></a></p> +<ul> +<li>Take ray from point to infinity</li> +<li>Check intersection with each line segment O(N)</li> +<li>Parity of the number of intersection determine inside(odd) or outside(even)</li> +<li>Ignore if line segment coincides with the ray.</li> +</ul> +<p>This is used again in future problems like 4-1/4-2. +Draw a ray from <code>P</code> to <code>INF_POINT</code>. Check the if the no. of intersections are odd or even. +Make sure an endpoint is not counted twice - that&rsquo;s why <strong>semi-open interval</strong> is checked (<code>semi_check_intersect</code>).</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">inbetween</span>(ppoint a, ppoint midd, ppoint b){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> minx <span style="color:#ff79c6">=</span> min(a.x, b.x); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> miny <span style="color:#ff79c6">=</span> min(a.y, b.y); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> maxx <span style="color:#ff79c6">=</span> max(a.x, b.x); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> maxy <span style="color:#ff79c6">=</span> max(a.y, b.y); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> (minx <span style="color:#ff79c6">&lt;=</span> midd.x <span style="color:#ff79c6">&amp;&amp;</span> midd.x <span style="color:#ff79c6">&lt;=</span> maxx) <span style="color:#ff79c6">&amp;&amp;</span> (miny <span style="color:#ff79c6">&lt;=</span> midd.y <span style="color:#ff79c6">&amp;&amp;</span> midd.y <span style="color:#ff79c6">&lt;=</span> maxy); +</span></span><span style="display:flex;"><span>} +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Only check semi-interval [s1, s2) intersection [d1, d2] +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">semi_check_intersect</span>(ppoint d1, ppoint d2, ppoint s1, ppoint s2){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> s1_side <span style="color:#ff79c6">=</span> trisign(d1, d2, s1); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> s2_side <span style="color:#ff79c6">=</span> trisign(d1, d2, s2); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> d1_side <span style="color:#ff79c6">=</span> trisign(s1, s2, d1); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> d2_side <span style="color:#ff79c6">=</span> trisign(s1, s2, d2); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(s1_side<span style="color:#ff79c6">*</span>s2_side <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">0</span> <span style="color:#ff79c6">&amp;&amp;</span> d1_side<span style="color:#ff79c6">*</span>d2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// If segment lies completely inside we can ignore it; So check if strictly only s1 is present +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">return</span> (inbetween(d1, s1, d2) <span style="color:#ff79c6">&amp;&amp;</span> <span style="color:#ff79c6">!</span>inbetween(d1, s2, d2)); +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span> <span style="color:#ff79c6">if</span>(s1_side<span style="color:#ff79c6">*</span>s2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span> <span style="color:#ff79c6">&amp;&amp;</span> d1_side <span style="color:#ff79c6">*</span> d2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span>} +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">point_in_polygon</span>(vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;&amp;</span> poly, pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> p){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> ray_intersects <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> k <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; k <span style="color:#ff79c6">&lt;</span> n; <span style="color:#ff79c6">++</span>k){ +</span></span><span style="display:flex;"><span> ray_intersects <span style="color:#ff79c6">+=</span> semi_check_intersect(p, INF_POINT, poly[k], poly[(k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n]); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(ray_intersects <span style="color:#ff79c6">%</span> <span style="color:#bd93f9">2</span> <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>4. Points in Convex Polygon</p> +<p>The steps I used were as follows -</p> +<ul> +<li>Get Centroid: Choose 3 non-colinear points (<code>trisign</code>)</li> +<li>Sort by Angle: Array of pairs <code>slope_pairs</code> which stores <code>{atan2(points[i].y - centroid.y, points[i].x - centroid.x), i}</code> and then sort.</li> +<li>Binary Search by Angle (Helper Function): <code>pair&lt;ll, ll&gt; binsearch_angle(vector&lt;pair&lt;double,ll&gt;&gt;&amp; angle_pair, double angle_val)</code> gives the pair of indices of the two vertices.</li> +<li>Check in triangle: Use the previous part to check if point in the triangle given by <code>binsearch_angle</code></li> +</ul> +<h2 id="week-2">Week 2</h2> +<ul> +<li> +<p>Convex Hull Algorithms</p> +<ul> +<li> +<p>Graham Scan</p> +<ol> +<li>Initialize a pair of points in S</li> +<li>Add new point</li> +<li>Check if orientation of (n-2)nd point with ((n-3)rd, nth) point is left(ccw)/right(cw) (and 0)</li> +<li>Else pop the 2nd last point</li> +</ol> +</li> +<li> +<p>Andrew&rsquo;s (Preferred - NlogN for sort)</p> +<ol> +<li>Take line (leftmost or minx) point &amp; (rightmost or maxx) point</li> +<li>Sort Points in x-coords</li> +<li>Partition all other points (by orientation) into Lower or Upper according to below/above the partition line. (stable or resort)</li> +<li>Run Graham Scan and pop 2nd last element if right(for Upper Partition) or left(for Lower Partition)</li> +</ol> +</li> +</ul> +<p>Points to Note: - Andrew&rsquo;s Scan can also be thought similar to a sweep line - At every event point(p) check orientation of last point in S(n) wrt to S(n-1) and p - Convex Hull can also be used for other polygons (see Unit Circle&rsquo;s questions)</p> +<ul> +<li>Jarvis March +<ol> +<li>Take lowest point in H</li> +<li>Take 2nd point with smallest polar angle in H</li> +<li>Take last (n-1) and (n-2) points as line</li> +<li>Find smallest polar angle point wrt. this line</li> +<li>Repeat till 1st point is found</li> +</ol> +</li> +</ul> +</li> +</ul> +<p>1. Convex Polygon Check</p> +<p>Check if polygon is convex. Stable Partition points to upper part and lower part (like Modified Graham&rsquo;s). +Check (<code>convex_check</code>) if all Up points have no lefts. Check again if all Down points have no rights.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">convex_check</span>(vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;&gt;&amp;</span> points, <span style="color:#8be9fd">int</span> invsign){ +</span></span><span style="display:flex;"><span> ll sz <span style="color:#ff79c6">=</span> points.size(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> i <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; i <span style="color:#ff79c6">&lt;</span> sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">2</span>; <span style="color:#ff79c6">++</span>i){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// NO Left(&gt;0) if Down, NO Right(&lt;0) if Up +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(trisign(points[i], points[i<span style="color:#ff79c6">+</span><span style="color:#bd93f9">2</span>], points[i<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>]) <span style="color:#ff79c6">==</span> invsign){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p><code>invsign</code> is an integer which is 1 or -1, depending on lower or upper hull.</p> +<p>2. Convex Hull</p> +<ul> +<li>Convex hull follows similar to the convex hull check.</li> +<li>For each vertex, we check <code>while(hull_size + 1 &gt;= 3)</code></li> +<li>If <code>trisign(hull[hull_size - 2], points[i], hull[hull_size -1])</code> matches our <code>invsign</code> then pop the 2nd last vertex, Or else break out of the <code>while</code> loop to check the next vertex.</li> +<li>Function Header: <code>void construct_convex_hull(vector&lt;pair&lt;ll,ll&gt;&gt;&amp; points, vector&lt;pair&lt;ll,ll&gt;&gt;&amp; hull, int invsign);</code></li> +<li>After <code>construct_convex_hull</code> for both partitions, we zip the upper and lower Hulls. Thus forming the CCW convex hull.</li> +</ul> +<p>3. Tangents to Polygon</p> +<p>See <a href="http://www.geomalgorithms.com/a15-_tangents.html"target="_blank" rel="noopener">geomalgorithms.com</a> for excellent explaination of technique. +As stated, we need sign(left point) != sign(right point) for tangent +In our case to find left and right tangents, we can put a condition like this, inside our loop iterating through each point.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">int</span> signl <span style="color:#ff79c6">=</span> trisign(left_pt, points[i], pt); +</span></span><span style="display:flex;"><span><span style="color:#8be9fd">int</span> signr <span style="color:#ff79c6">=</span> trisign(points[i], right_pt, pt); +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">if</span>(signl <span style="color:#ff79c6">!=</span> signr){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// CCW =&gt; pt lies L/R wrt. leftpt +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(signl <span style="color:#ff79c6">==</span> sign <span style="color:#ff79c6">||</span> signr <span style="color:#ff79c6">==</span> <span style="color:#ff79c6">-</span>sign){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> points[i]; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>where <code>sign</code> is given by whether we want left or right tangent.</p> +<p>4. Union of Convex Hulls</p> +<p>Take any point Z inside Convex Polygon A. If Z is also inside B, sort the points by angle and apply graham scan. If Z is not inside B, remove inner chain and apply Graham&rsquo;s Scan on outer chain. +OR +Just apply Graham&rsquo;s Scan to all the points since both algorithms have worst case, NlogN. +This may however be slightly less optimal. (But it works :-))</p> +<h2 id="week-3">Week 3</h2> +<p>1. 2 Line Segment Intersections</p> +<p>See <a href="https://cp-algorithms.com/geometry/check-segments-intersection.html"target="_blank" rel="noopener">CP Algorithms</a> for technique. +Helper functions for this include, <code>trisign</code>, <code>inbetween</code>, <code>determinant</code> are used. +Remember to check for &lsquo;No Common Points&rsquo; for both determinant = 0 and not. Watch out for corner cases. (Tons of them!)</p> +<p>2. Polygon Intersection</p> +<p>Either Clipping (Sutherland Hodgman) or Line Sweep (Shamos-Hoey) could be used. For clipping, see <a href="https://www.geeksforgeeks.org/polygon-clipping-sutherland-hodgman-algorithm-please-change-bmp-images-jpeg-png/"target="_blank" rel="noopener">G4G</a>. +The Algorithms are as follows,</p> +<ul> +<li> +<p>Sutherland-Hodgman</p> +<ul> +<li>First choose a polygon</li> +<li>Cut out 2nd polygon from first (check orientation at each line and split half-plane)</li> +<li>Go through the vertices of the 2nd polygon and check if next vertices crosses the line or not. ~O(NM) time</li> +<li>Also, for convex + non-convex</li> +</ul> +</li> +<li> +<p>Shamos-Hoey (Sweep-Line Like) - (N + M) vertical lines from vertices - Obtain inner fragment at each line (inner up and inner down) - 4 lists of vertices (upper, lower) - Only for convex + convex</p> +<pre><code>Within the same TC but slightly less optimal, a simpler approach using all the previous functions can be used. +</code></pre> +<p>Simply, find all line segment intersections and check point in polygon for each vertex. +Then just order points cw / ccw by sorting by angle from centroid. +See <a href="https://observablehq.com/@mbostock/sutherland-hodgman-clipping?collection=@observablehq/algorithms"target="_blank" rel="noopener">D3 Mike&rsquo;s ObservableHQ</a> for an awesome visualization.</p> +</li> +</ul> +<p>3. Intersection of Horizontal and Vertical Segments</p> +<p>This is briefly discussed in &lsquo;Competitive Programming Handbook by Antti&rsquo;. +Scan the the edges and classify and store as horizontal/vertical segments. +Store in <code>start</code>, tuples of the form</p> +<ul> +<li><code>{x1, 2, vptr}</code> for vertical segments</li> +<li><code>{xmin, 1, hptr}</code> and <code>{xmax, 3, hptr}</code> for horizontal segments +The operations are 1(Add eventpt), 2(Intersect with vertical), 3(Remove Endpoint). +Sort the <code>start</code> array, and perform a line sweep over it. +Use order-statistic tree (policy-based ds) for the <code>status</code>. (or implement similar RBT using nodes)</li> +</ul> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Horizontal Segment (height) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> hzlevel; +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Vertical Segment (height, range) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;&gt;</span> vlevel; +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Starting Point Tuples (xcoord, operation, index) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;&gt;</span> start; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// In operation 2 we check intersects like this, +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>lo <span style="color:#ff79c6">=</span> status.order_of_key(vlevel[ix].first); +</span></span><span style="display:flex;"><span>hi <span style="color:#ff79c6">=</span> status.order_of_key(vlevel[ix].second<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>); +</span></span><span style="display:flex;"><span>intersects <span style="color:#ff79c6">+=</span> hi <span style="color:#ff79c6">-</span> lo; +</span></span></code></pre></div><p>4. Intersection of Set of Segments</p> +<ul> +<li> +<p>Classic Sweep Line for Segment Intersections</p> +<ul> +<li> +<p>Consists (key vars)</p> +<ul> +<li>Event Point +<ul> +<li>Upper (or left) Endpoint of Segment is p (U(p))</li> +<li>Lower Endpoint of Segment is p (L(p))</li> +<li>Intersection/Internal Point of segment is p (C(p))</li> +</ul> +</li> +<li>(Q) Event Queue of found event points</li> +<li>(S) Set of of all Segements (Array)</li> +<li>(T) Set of Status (RB Tree?)</li> +<li>Event Queue set to check if already present?</li> +</ul> +</li> +<li> +<p>FindIntersection(S)</p> +<ul> +<li>Initialize Q and T</li> +<li>Push first U( p ) endpoint (and corresponding line segment/index) in Q</li> +<li>While Q non-empty, HandleEventPoint</li> +</ul> +</li> +<li> +<p>HandleEventPoint(p)</p> +<ul> +<li>Consists of U, L, C</li> +<li>Generate L( p ) and C( p ) from adjacent segments in T</li> +<li>Segments of $L(p) \cup U(p) \cup C(p) \geq 2$ +<ul> +<li>Report intersection p</li> +</ul> +</li> +<li>Delete L( p ) since segment ends</li> +<li>Delete C( p ) to swap (2nd priority to U)</li> +<li>Insert U( p )</li> +<li>Insert Back C( p ) (finish swap)</li> +<li>If there is no U( p ) and no C( p ) +<ul> +<li>FindEventPoints(sl, sr, p) where sl, sr are the adjacent segments of p in T</li> +</ul> +</li> +<li>Else +<ul> +<li>Take leftmost segment of U( p ) union C( p ), ie (topmost priority) as sl</li> +<li>Take left neighbour of sl in T, s1</li> +<li>FindEventPoints(sl, s1, p) // top Segments intersections</li> +<li>Take rightmost segment of $U(p) \cap C(p)$, ie (least priority) as sr</li> +<li>Take right neighbour of sr in T, s2</li> +<li>FindEventPoints(sr, s2, p) // bottom Segments intersections</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Key Features for any Sweep Line</p> +<ul> +<li>Event Point (often coordinate-compressed)</li> +<li>Status Set containing elements important for current event point</li> +<li>Line sweeps across some direction (Obvious!)</li> +</ul> +</li> +</ul> +<p>Unfortunately, I wasn&rsquo;t able to code this one up. However, <a href="https://geomalgorithms.com/a09-_intersect-3.html"target="_blank" rel="noopener">geom algorithms</a> explains with code the approach to doing this.</p> +<h2 id="week-4">Week 4</h2> +<p>1. Diagonals of any Simple Polygon</p> +<p>For diagonals, one technique is to first check if diagonal intersects with any other polygon line segment. +Then check if Point-in-Polygon for the midpoint, to know if it is inside/outside. +So, <code>trisign</code>, <code>inbetween</code>, <code>semi_check_intersect</code>, <code>check_intersect</code> and <code>point_in_polygon</code> are needed. +Note that <code>check_intersect</code> includes endpoints unlike <code>semi_check_intersect</code>.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span>intersect <span style="color:#50fa7b">diagonal_check</span>(vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;&amp;</span> poly, ll i, ll j){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Check Intersections +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> k <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; k <span style="color:#ff79c6">&lt;</span> n; <span style="color:#ff79c6">++</span>k){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(k <span style="color:#ff79c6">==</span> i <span style="color:#ff79c6">||</span> k <span style="color:#ff79c6">==</span> j <span style="color:#ff79c6">||</span> (k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n <span style="color:#ff79c6">==</span> i <span style="color:#ff79c6">||</span> (k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n <span style="color:#ff79c6">==</span> j) <span style="color:#ff79c6">continue</span>; +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> res <span style="color:#ff79c6">=</span> check_intersect(poly[i], poly[j], poly[k], poly[(k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>)<span style="color:#ff79c6">%</span>n]); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(res <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">return</span> crossing; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Check if Midpoint in polygon. Assumption: diagonal does not intersect +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> midd <span style="color:#ff79c6">=</span> {(poly[i].x <span style="color:#ff79c6">+</span> poly[j].x)<span style="color:#ff79c6">/</span><span style="color:#bd93f9">2.0</span>, (poly[i].y <span style="color:#ff79c6">+</span> poly[j].y)<span style="color:#ff79c6">/</span><span style="color:#bd93f9">2.0</span>}; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(point_in_polygon(poly, midd)){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> inner; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> outer; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>2. Ear-Cutting Algorithm for Triangulation of Convex Polygons</p> +<p>Steps -</p> +<ol> +<li>Preprocess: If for every vertex, adjacent vertices form inner diagonal. Mark as Ear. ~O($N^2$ for diagonal_check)</li> +<li>Start processing ears in-order from a starting vertex (Try to maintain order in which they are checked)</li> +<li>Delete Current Ear Vertex from the polygon (&amp; is_ear) vector. Insert (diagonal with adjacent verts and the pt) as a triangle.</li> +<li>Check if vleft, vright is a ear (~O(N))</li> +<li>Stop when ear-list is empty or polygon has less than 3 vertices (all vertices are done!)</li> +</ol> +<p>Time: $O(N^3)$ (Sum of $N^2$ operations)</p> +<p>After preprocessing the ears in the <code>is_ear</code> array, the algorithm proceeds as follows,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Set start point +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">int</span> st <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">while</span>(n <span style="color:#ff79c6">&gt;</span> <span style="color:#bd93f9">3</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Start loop at previous triangle endpoint +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> j <span style="color:#ff79c6">=</span> st; j <span style="color:#ff79c6">&lt;</span> st <span style="color:#ff79c6">+</span> n; <span style="color:#ff79c6">++</span>j){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> i <span style="color:#ff79c6">=</span> j <span style="color:#ff79c6">%</span> n; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(is_ear[i]){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Find First Ear and Delete +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;</span> res_triangle <span style="color:#ff79c6">=</span> { poly[(i <span style="color:#ff79c6">-</span> <span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n], poly[i], poly[(i <span style="color:#ff79c6">+</span> <span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n] }; +</span></span><span style="display:flex;"><span> triangles.pb(res_triangle); +</span></span><span style="display:flex;"><span> is_ear.erase(is_ear.begin() <span style="color:#ff79c6">+</span> i); +</span></span><span style="display:flex;"><span> poly.erase(poly.begin() <span style="color:#ff79c6">+</span> i); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Update Polygon and check ears +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Lower Vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> is_ear[(i<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n] <span style="color:#ff79c6">=</span> check_ear(poly, (i<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Upper Vertex (new index -&gt; i % n) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> is_ear[i <span style="color:#ff79c6">%</span> n] <span style="color:#ff79c6">=</span> check_ear(poly, i <span style="color:#ff79c6">%</span> n); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Set start of next iteration +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> st <span style="color:#ff79c6">=</span> i; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">break</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>Finally, add remaining polygon into <code>triangles</code>. +The <code>check_ear</code> functions checks <code>diagonal_check</code>(from 4-1) on the neighbouring vertices. +It also helps to plot testcases like this,</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/4-2testcase.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/4-2testcase.png" width="auto" height="auto" +alt="Testcase for Polygon triangulations"/></a></p> +<p>3. Monotone Polygon Triangulation</p> +<p>Triangulation of strictly y-monotone polygons. See <a href="http://homepages.math.uic.edu/~jan/mcs481/triangulating.pdf"target="_blank" rel="noopener">MCS481 Slides</a> for a pretty good psuedocode or the Book is also great. +For Diagonal check part, time complexity would be high therefore it is better to use Concavity Check with <code>trisign</code> instead. Remember to add diagonals from last (lowermost) vertex also. <code>sidemap</code> is used to store Left/Right and <code>vertex</code> is the merged sorted vertex list.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">triangulate_monotone</span>(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;&amp;</span> verts, map<span style="color:#ff79c6">&lt;</span>point, <span style="color:#8be9fd">bool</span><span style="color:#ff79c6">&gt;</span> sidemap, vector<span style="color:#ff79c6">&lt;</span>polygon<span style="color:#ff79c6">&gt;&amp;</span> diags){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> sz <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)verts.size(); +</span></span><span style="display:flex;"><span> deque<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span> rack <span style="color:#ff79c6">=</span> {verts[<span style="color:#bd93f9">0</span>], verts[<span style="color:#bd93f9">1</span>]}; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> j <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">2</span>; j <span style="color:#ff79c6">&lt;</span> sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>; <span style="color:#ff79c6">++</span>j){ +</span></span><span style="display:flex;"><span> point vlast <span style="color:#ff79c6">=</span> rack.back(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Process Vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(sidemap[verts[j]] <span style="color:#ff79c6">!=</span> sidemap[rack.back()]){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Opposite Sides +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">while</span>((<span style="color:#8be9fd">int</span>)rack.size() <span style="color:#ff79c6">&gt;</span> <span style="color:#bd93f9">1</span>){ +</span></span><span style="display:flex;"><span> diags.pb(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span>{rack.back(), verts[j]}); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> rack.push_back(vlast); +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Same Side +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> rack.pop_back(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// rack.back() should be inward wrt. vlast and verts[j] -&gt; i.e, match sign of side of vlast +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">while</span>(rack.size() <span style="color:#ff79c6">&amp;&amp;</span> check_concave(vlast, rack.back(), verts[j], sidemap[verts[j]])){ +</span></span><span style="display:flex;"><span> diags.pb({verts[j], rack.back()}); +</span></span><span style="display:flex;"><span> vlast <span style="color:#ff79c6">=</span> rack.back(); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.push_back(vlast); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.push_back(verts[j]); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Add diags from all verts in stack (except top and bottom) to lowermost vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> rack.pop_front(); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#ff79c6">auto</span> <span style="color:#8be9fd;font-style:italic">v</span>: rack){ +</span></span><span style="display:flex;"><span> diags.push_back(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span>{verts[sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>], v}); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>4. Number of Triangulations of a Convex Polygon</p> +<ul> +<li>From the <a href="https://en.wikipedia.org/wiki/Catalan_number"target="_blank" rel="noopener">wikipedia page</a>, A convex polygon with n + 2 sides can be triangulated to n triangles by non-crossing lines.</li> +<li>Number of different ways of triangulation is Catalan Nos.</li> +<li>For any triangulation, there would be exactly 2 vertices that don&rsquo;t need to be joined by a diagonal.(or whose degrees stay the same!) So, catalan nos. is on the $n-2$ vertices connected by diagonals.</li> +<li>The $\sum c_i c_{n-i}$ Form: Recurrence relation is the breaking of the polygons by one of the diagonals.</li> +</ul> +<h2 id="week-5">Week 5</h2> +<ul> +<li> +<p>k-D Trees</p> +<ul> +<li>Base Structure: BST</li> +<li>Stores values like BST, but instead of ordering only by value like BST, it needs to order by <code>k</code> params.</li> +<li>This is done by selecting a splitting criteria, like for 2D: alternate between &lsquo;X&rsquo; and &lsquo;Y&rsquo; parameters based on whether the depth is even/odd.</li> +</ul> +</li> +<li> +<p>2D Layered Range Trees</p> +<ul> +<li>Base Structure: Red-Black Tree or balanced BST</li> +<li>See <a href="https://stackoverflow.com/questions/17466218/what-are-the-differences-between-segment-trees-interval-trees-binary-indexed-t"target="_blank" rel="noopener">differences between some well-known trees</a>.</li> +<li>2D Layered Range tree stores points in its associated array, and optimized for &ldquo;which points fall within a given interval&rdquo; queries.</li> +<li>The assoc array of point <code>v</code> is the two-pointer zip (merge-sort) of <code>2v</code> and <code>2v+1</code> vertices.</li> +<li>It can be represented similar to 2D segment tree, but value contains &ldquo;the points themselves&rdquo;. (segtree consists of sum of no. of points)</li> +<li>Both 2D layering range tree and segment trees can be used interchangeably.</li> +<li>Fractional Cascading is technique to store binary_searched index of the element as pointer. So $O(logN)$ extra factor isn&rsquo;t needed. Each element of assoc array of point <code>v</code> also contains pointers to <code>2v</code> and <code>2v+1</code> nodes arrays&rsquo; binary_searched(lower_bound) index.</li> +</ul> +</li> +<li> +<p>2D Priority Search Tree</p> +<ul> +<li>Base Structure: Binary Heap or Priority Queue (Scaled up to 2D).</li> +<li>Shows one-sided unbounded range of values.</li> +</ul> +</li> +</ul> +<p>1. Closest Point</p> +<p>Simple binary-search implementation as points have only 1 parameter.</p> +<p>2. Number of Points in Rectangle</p> +<p>The easiest implementation in via a Cartesian Tree. (similar to Kdtree) +My code is a 2D Segment Tree however I <strong>recommend</strong> using an OOP approach with <strong>Cartesian Tree</strong> instead!</p> +<p>This is was approximate workflow while designing 2D Segment Tree. See <a href="https://cp-algorithms.com/data_structures/segment_tree.html"target="_blank" rel="noopener">CP Algorithms</a>&rsquo;s +compression of 2D segment tree for ideas. Fractional Cascading for speeding up!</p> +<p>Below are the design notes for the code.</p> +<hr> +<pre tabindex="0"><code>General Design - +- buildx, buildy, queryx, queryy +- Range compression (See cp-algorithms.com tips) +- NlogN memory and (logN)^2 time per query +Construction - +- Vector with all x-coords sorted +- Vector with all y-coords sorted for each node of segtree[x] to lowerbound/upperbound y indices +- Within each node of segtree[x], store `segtree[][y]` with compressed size 4*log(Sumx_r - Sumx_l) +Query - +- Search equivalent indices for x-coords in vec +- Get each node from segtree query +- Search equivalent indices for y-coords in each vvec[v_x] +- Get each node sumval from segtree[v_x] query +Variable Names- +- v -&gt; root vertex +- l, r -&gt; current left/right segment of coords +- L, R -&gt; required left/right segment +- Lyc, Ryc -&gt; c indicates coordinate and not index +Current Progress - +- Correct Answer and correct Memory Limit +- Time Limit Exceeded in Building Segtree +- Building Time: ~ 4min 45 seconds +- Query Time(for 30000 queries): ~ 5min (9 min 45s in total) +Optimization - +- Get rid of binary search for both x &amp; y and instead check coord value +- Remove coord compression but keep construct_order_y +- Make D&amp;C of segment tree run on array with unique elements (order_x, order_y) instead +- Fractional Cascading: +- Store relation(starts) between unique array (order_x) and points +- So, construct_order_y does not require to binary search index (remove extra logN factor) +</code></pre><p>The Segment Tree is built on the unique x-coordiniates (<code>order_x</code>) array and 2nd dimension in unique y-coordinates (<code>order_y</code>). +It assumes that points do not repeat!</p> +<p>CTags-like Overview of global variables,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ll SZX <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">30001</span>; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ll INF <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">1.5e9</span>; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Segment Tree : 4*SZX and 4*SZY (still only NlogN memory since dynamic length arrays!) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> segtree[<span style="color:#bd93f9">4</span><span style="color:#ff79c6">*</span>SZX]; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Unique x-coordinates of points +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> order_x; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Unique Y-coordinates of (vx)th segment tree (4*SZX and SZY) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> order_y[<span style="color:#bd93f9">4</span><span style="color:#ff79c6">*</span>SZX]; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// List of all points in sorted x-coordinate order +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll, ll<span style="color:#ff79c6">&gt;&gt;</span> points; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Fractional-Cascading like map of unique x indices of order_x to non-unique coordinates&#39; indices in points +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll starts[SZX]; +</span></span></code></pre></div><p>Overview of Functions,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Query the (vx)th segment tree +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll <span style="color:#50fa7b">queryy</span>(ll vx, ll vy, ll ly, ll ry, ll Lyc, ll Ryc); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Build (vx)th segment tree on the basis of y-coords (USES queryy for 2*vx, 2*vx+1 segment tree values) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">buildy</span>(ll vx, ll lx, ll rx, ll vy, ll ly, ll ry); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Construct the base array for the (vx)th segment tree (Called within buildx) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>size_t <span style="color:#50fa7b">construct_order_y</span>(ll vx, ll lx, ll rx); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Builds the segment tree and proceeds to call construct_order_y and buildy +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">buildx</span>(ll vx, ll lx, ll rx); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Query the x-coordinate and proceed to call queryy +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll <span style="color:#50fa7b">queryx</span>(ll vx, ll lx, ll rx, ll Lxc, ll Rxc, ll Lyc, ll Ryc); +</span></span></code></pre></div><p>The <code>start</code> array is constructed in preprocessing stage before <code>buildx</code>. +<code>construct_order_y</code> uses <code>start</code> array for copying y-coords of original array (so no logN factor from lower_bound).</p> +<p>Building: <code>buildx</code> -&gt; <code>construct_order_y</code> -&gt; <code>buildy</code> -&gt; (either fill value 1 or <code>queryy</code>)</p> +<p>Query: Format input to lower/upper endpoints -&gt; <code>queryx</code> -&gt; <code>queryy</code> +At both <code>queryx</code> and <code>queryy</code>(similar but with <code>lxy rxy</code>), +<code>ll lxc = order_x[lx], rxc = order_x[rx];</code> +line is used. The <code>lxc rxc</code> (coordinates of query points) are used for all comparisons except for calculation of midpoint where <code>lx rx</code> (positions) are used.</p> +<hr> +<p>3. Closest Pair of Points</p> +<p>K-D Tree Implementation. See <a href="https://rosettacode.org/wiki/K-d_tree"target="_blank" rel="noopener">Rosetta Code</a> or Stanford ACM&rsquo;s Notebook. +For intuition on K-D Trees see <a href="https://www.youtube.com/watch?v=cUssdK0Tku4&amp;list=PL8FaHk7qbOD5I3wsXKTC70LwFX6KiA3Yy&amp;index=6"target="_blank" rel="noopener">Josh Hug&rsquo;s lectures</a> +General Parameters that can be tuned,</p> +<ul> +<li>Distance Metric +<ul> +<li>Euclidean Metric</li> +<li>Chessboard Metric (Used for this problem)</li> +<li>Manhattan Metric</li> +</ul> +</li> +<li>Splitting Criteria (X or Y based) +<ul> +<li>Parity of Depth/Height of current node</li> +<li>Larger of Width or Height of bounding box of current node</li> +</ul> +</li> +</ul> +<h2 id="week-6---point-location-and-trapezoid-maps">Week 6 - Point Location and Trapezoid Maps</h2> +<p>Lec 1 - &ldquo;Where the hell am I?&rdquo;</p> +<ul> +<li>Planar Subdivision: A set of polygons that form a large polygon.(Like a map of states of a country)</li> +<li>Partition into vertical lines or slabs at every vertex (like Shamos Hoey)</li> +<li>Naive Implementation +<ul> +<li>Query: Traverse two binary search trees - find vertical lines (bound on x), find region (bound on y);</li> +<li>Space Complexity can be n^2 if two full BST</li> +</ul> +</li> +</ul> +<p>Lec 2 - Decreasing Space Complexity</p> +<ul> +<li>Refinement: The Partition of Planar Subdivision S into Slabs induced by vertices. These Partitions would be trapezoids (or degenerate ones).</li> +<li>Trapezoidal Map: Splits the trapezoids of a refinement. Very useful technique for space partitioning or mapping regions in general.</li> +<li>Unlike the previous partition by vertical lines, this partition only has lines that end at another edge or outer rectangle.</li> +<li>Side: Segment of max length contained in boundary of face of trapezoid</li> +<li>Trapezoidal partition with $n$ segments have, $T(S) \leq 2n + 2*2n + 4$(segment endpoints, vertical lines, boundary rectangle) vertices and trapezois $\leq 3n + 1$</li> +<li>Constructing Trapezoid - Find each up, down left, right endpoints for each trapezoid. Time: 3N + 1 = O(N)</li> +</ul> +<p>Below is an image of a trapezoidal map of &rsquo;line segments&rsquo; from this <a href="https://github.com/marinimau/GAS-Trapezoidal-maps-final-prject"target="_blank" rel="noopener">GAS</a>, the same can be done for polygons as well.</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/trapezoidal_map_line_segments.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/trapezoidal_map_line_segments.png" width="auto" height="auto" +alt="Trapezoidal Map of Line Segments"/></a></p> +<p>Lec 3 - Randomized-Incremental Algorithm:</p> +<ul> +<li>O(NlogN) expected preprocess time</li> +<li>O(logN) query time (not worst case optimal but randomized)</li> +<li>Expected Query Time by Backward Analysis (See Lec04 of series)</li> +</ul> +<p>Lec 4 - Data Structure Trapezoid Cartesian DAG</p> +<ul> +<li>Trapezoidal Map Data Structure For 2D: Cartesian D.A.G.</li> +<li>Make sure to split Trapezoid on map (so it isn&rsquo;t n^2 time)</li> +<li>Unlike Tree, Cartesian DAG will just have pointer to that trapezoid</li> +</ul> +<p>Lec 5 - Query Time for Trapezoid Cartesian DAG</p> +<ul> +<li>LogN Query time (Amortized)</li> +<li>Backward Analysis (summation 1/i)</li> +<li>Size: O(N + 13N) = O(N) (13N comes from $\sum(3i + 1)*(4/i)$)</li> +<li>Construction: NlogN</li> +</ul> +<h2 id="week-7---voronoi-diagrams--post-office-problem">Week 7 - Voronoi Diagrams &amp; Post Office Problem</h2> +<p>Lec 1 - Post Office Problem</p> +<ul> +<li>Post Office Problem: Which is the closest Post Office to place P?</li> +<li>Answer: Voronoi Diagram with Euclidean Distance Metric. (Map of region closest to that point)</li> +</ul> +<p>Lec 2 - Definitions in Voronoi Diagrams</p> +<ul> +<li>Voronoi Cell: +$$ V(p) = { x \in R^2: d(x, p) &lt; d(x, q) \forall q \in P\ - {p}} $$</li> +<li>For Voronoi Cell, Think of definition of Ball in Topology but using relative distances instead of a constant epsilon</li> +<li>Voronoi Edge: +$$ V(p) = { x \in R^2: d(x, p) == d(x, q) \forall q \in P\ - {p}} $$</li> +</ul> +<p>Lec 3 - Overall Shape of Voronoi Diagrams</p> +<ul> +<li>Lemma: Vor( P ) consists of atmost (2n - 5) vertices and (3n - 6) edges</li> +<li>Proof of Lemma from Euler&rsquo;s Polyhedra Formula (Dual is Delaunay Triangulation and Maximal Planar Graph =&gt; 3n - 6)</li> +<li>For infinite voronoi diagrams, set dummy vertex at infinity</li> +<li>NOTE: Voronoi Vertices != Voronoi Cells (or Faces or Sites)</li> +<li>Voronoi Vertex: Circle at vertex &lsquo;x&rsquo; has atleast 3 points on it&rsquo;s largest (circumcircle which does not contain a site/face) +$$|C_p(x) \cap P| \geq 3$$</li> +<li>Voronoi Edge: For edge P to P&rsquo;, there is a vertex &lsquo;x&rsquo; which has P and P&rsquo; on it&rsquo;s largest (circumcircle which does not contain a site/face) +$$\exists x \in E(P, P&rsquo;) st.,\ \ |C_p(x) \cap P| = {P, P&rsquo;}$$</li> +</ul> +<p>Lec 4 - Computing Voronoi Diagram</p> +<ul> +<li>BF: Line Segment Intersection, Half Plane Intersections &gt; $O(N^2)$ time</li> +<li>Naive Line Sweep: Event Points are not known before swept</li> +<li>Fortune&rsquo;s Algorithm or Optimized Line Sweep: +<ul> +<li>Parabolas at the visited vertices form the equidistant line</li> +<li>Directrix is the Line Sweep at point P, and focus is the visited vertices</li> +<li>Beachline($\beta$): The lowerbound of each of the parabolas (from the visited vertices so far) merged together.</li> +<li>The intersection points of the parabolas as the line is swept form the edges of the voronoi diagram.</li> +<li>See <a href="http://www.raymondhill.net/voronoi/rhill-voronoi.html"target="_blank" rel="noopener">this</a> for demo. Also, <a href="https://jacquesheunis.com/post/fortunes-algorithm/"target="_blank" rel="noopener">this post</a> for explaination.</li> +</ul> +</li> +<li>Beachline Event Points +<ul> +<li>Site(Face) Event: New Sitepoint is found =&gt; New Arc is created</li> +<li>Circle Event: Sweep Line reaches lowest point of circle containing 3 Site Points =&gt; Arc of the inner site point is deleted. Voronoi Points are the centre of the circle formed.</li> +</ul> +</li> +</ul> +<p>Lec 5 - Fortune&rsquo;s Line Sweep Algorithm</p> +<ul> +<li>See <a href="https://pvigier.github.io/2018/11/18/fortune-algorithm-details.html"target="_blank" rel="noopener">PVigier&rsquo;s Blog</a> for implementation resources.</li> +<li>Also see this <a href="https://jacquesheunis.com/post/fortunes-algorithm/"target="_blank" rel="noopener">post by Jacques</a></li> +<li>Key Functions +<ul> +<li>Find New Circle Event Points (Site Event Points are already known)</li> +<li>Handle Circle Event (once processed; calls findNewCircleEvent)</li> +<li>Handle Site Event (once processed; calls findNewCircleEvent)</li> +</ul> +</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/fortunes.gif"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/fortunes.gif" width="auto" height="auto" +alt="Fortune&amp;rsquo;s Algorithm Wiki"/></a></p> +<h2 id="week-8---delaunay-triangulations">Week 8 - Delaunay Triangulations</h2> +<p>Lec 1 - Height Interpolation</p> +<ul> +<li>Triangulation: Planar subdivision with all inner faces triangles and outer face is Convex Hull</li> +<li>Since Maximal Planar Graph =&gt; (3n - 6) edges. But outer face is CH and needs triangulation (3 - h) edges =&gt; 3n - 3 + h edges in total</li> +</ul> +<p>Lec 2 - Angle-Optimal Triangulation</p> +<ul> +<li>Height Interpolation Optimization by choosing a better triangulation</li> +<li>Angle-Optimal Triangulation to avoid skinny triangles (this causes disparity in length Vs width - based height interpolations)</li> +<li>Angle vector $A(T)$ of Triangulation $T$ is the angles of all triangles in sorted order</li> +<li>A Triangulation is more optimum if Angle vector is <strong>lexicographically</strong> better than the other. i.e., $A(T_{optimal}) &gt; A(T)$</li> +<li>The best triangulations are called Angle-Optimal.</li> +</ul> +<p>Lec 3 - Edge-Flips &amp; Legal Triangulations</p> +<ul> +<li>Edge e is illegal in Triangulation T if triangulation obtained by flipping edge e, T&rsquo; has $A(T&rsquo;) &gt; A(T)$</li> +<li>Use Extended Thales Thm (Thales++), i.e., check angles by taking circumcircle around edge e</li> +<li>Angle-Optimal is always legal.</li> +<li>A triangle is <strong>legal</strong> iff it has no illegal edge</li> +</ul> +<p>Lec 4 - Voronoi Diagram &amp; Delaunay Triangulation</p> +<ul> +<li>Delaunay Triangulation: Straight Line Drawing of the Dual Graph of Voronoi Diagram</li> +<li>Proof +<ul> +<li>Take circumcircle on any point in edge between sites p-q in Vor(P)</li> +<li>Consider another edge u-v and show crosses lead to contradiction</li> +</ul> +</li> +<li>Alt Definition: Delauanay Triangulation iff $\forall \Delta \in T : int(C(\Delta) \cap P) = \phi$</li> +<li>AKA: Empty Circumcircle property of D.T.</li> +</ul> +<p>Lec 5 - Correctness and Computation</p> +<ul> +<li>A triangulation is legal iff it is Delaunay</li> +<li>Proof +<ul> +<li>Back Relation: By Empty Circumcircle Property and Thales++, D.T. is legal</li> +<li>Forward Relation: +<ul> +<li>By Contradiction, Take a triangle p-q-r and circumcircle. where T is legal</li> +<li>Take point s in circumcircle. Now, we need to maximize angle of chord at s. (p-s-q)</li> +<li>Take neighbouring triangle p-q-t, t lies outside circumcircle.</li> +<li>Get contradiction: angle q-s-t &gt; angle p-s-q (but this is maximal)</li> +</ul> +</li> +</ul> +</li> +<li>If pointset P is general position(i.e. No 4 points lie on an empty circle) then D.T. is unique and angle-optimal.</li> +<li>If pointset P is not general position, then all D.T. have same minimum angle but may not be angle-optimal.</li> +<li>D.T. can be constructed in $O(NlogN)$</li> +<li>Angle-Optimal Triangulation in non-general position P, can be constructed in $O(N^2)$ time. Holes (4+ points on empty circle) can be filled by trying out each flip.</li> +</ul> +<p>Below is an image also showing weighted voronoi diagrams and their corresponding delaunay triangulations, +<a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/weighted_dt.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/weighted_dt.png" width="auto" height="auto" +alt="Weighted and non-Weighted VD and DT"/></a></p> +<h2 id="week-9---convex-hull-in-3d">Week 9 - Convex Hull in 3D</h2> +<p>Lec 1 - Complexity and Visibility of CH</p> +<ul> +<li>(Upper Bound Theorem) General Time Complexity of Convex Hull in d dimensions: $O(N^{\lfloor d/2 \rfloor})$</li> +<li>In 3D, Surface of the Polyhedra forms a Planar Dual Graph =&gt; atmost (3n-6) edges and hence linear complexity. Similar for higher dimensions.</li> +<li>Construction by Random-Incremental Algorithm</li> +<li>Visibility: +<ul> +<li>If we project rays from point P to Convex Polytope.</li> +<li>The project rays that are 3D Tangent to the polytope form a ring/shadow, the point that form this is called Horizon.(Last visible edges)</li> +<li>Region facing towards P bounded by Horizon is the Visible region.</li> +</ul> +</li> +<li>Define Conflict Graph and create bipartite relation of points with facets. And mark out which facets are visible.</li> +</ul> +<p>Lec 2 - Randomized Incremental Algorithm</p> +<ul> +<li>Pseudocode/Approach of adding vertex to CH3</li> +<li>TC: $O(N^2)$ (Randomized from $O(N^3)$; not worst case optimal)</li> +</ul> +<p>Lec 3- Analysis</p> +<ul> +<li>Expected No. of Facets Created by CH are bounded to atmost (6n - 20)</li> +<li>Degree bounded by 6 for the vertices other than initial 4-point CH3, so 6*(n-4) + 4</li> +<li>See this <a href="https://codeforces.com/blog/entry/81768"target="_blank" rel="noopener">Tutorial on 3D CH</a> for simple implementation as well as some optimized version.</li> +<li>Can be further optimized with Configuration Spaces</li> +<li>Higher Degree CH are worst case optimal accordingly with Upper Bound Thm.</li> +</ul> +<p>Lec 4- Convex Hull &amp; Half-Plane Intersections</p> +<ul> +<li>Assume a mapping/relation from spaces P1 and P2, where (&lsquo;primal is the dual of the dual!&rsquo;) +<ul> +<li>Line in P1 -&gt; point in P2 (P1 is Dual of P2)</li> +<li>Line in P2 -&gt; line in P1 (P2 is Dual of P1)</li> +</ul> +</li> +<li>Convex Hull of a point set in P1 =&gt; Set of Lines in P2 +<ul> +<li>Traversing the lines corresponding to Lower Hull of P1 alongside intersections, give the Upper Envelope. Similarly for Upper CH.</li> +<li>Incidence Preserving: Every point in P1 gives Line in P2. So CH region gives area bounded by upper and lower envelope.</li> +<li>Order Preserving: Maintains an ordering through the mapping.</li> +</ul> +</li> +<li>Scaling to 3D: CH3 of points gives 3D Wrapping/Envelope of 3D Lines</li> +</ul> +<p>Lec 5- Voronoi Diagrams Revisited</p> +<ul> +<li>Distance to Unit Parabola (From Projection of point q to tangent at p&rsquo;) = intercepts $(pq)^2$</li> +<li>Take: A (set of planes/halfplanes) have an Upper Envelope (or Supremum or Least Upper Bound 3D Parabola). The planes are thus 3D Tangents to the 3D Parabola or Envelope.</li> +<li>When this is projected to the plane, +<ul> +<li>Voronoi Centres/Faces/Sites = (Intersection points of Planes and 3D Parabola)</li> +<li>Voronoi Edges = (Line Segments that for the Intersection of Planes)</li> +<li>Voronoi Vertices = (Intersection of 3 or more Planes)</li> +</ul> +</li> +<li>Take: 3D Convex Hull of (Intersection of Planes and 3D Parabola). The 3D Parabola is now the Lower Envelope (or Infimum or Greatest Lower Bound) of the (3D Convex Hull).</li> +<li>When this projected to the plane, +<ul> +<li>Delaunay Vertices = (Intersection of Planes and 3D Parabola) or (Points of 3D Convex Hull)</li> +<li>Delaunay Edges = (Edges of 3D Convex Hull)</li> +</ul> +</li> +<li>See <a href="https://www.youtube.com/watch?v=H0IVBBDJ8Kk&amp;list=PLubYOWSl9mIubi50UoQt3Sl_CV9NCjUUm&amp;index=5"target="_blank" rel="noopener">Video for Demo</a></li> +</ul> +<p>Below image is from <a href="https://pages.mtu.edu/~shene/NSF-2/DM2-BETA/index.html"target="_blank" rel="noopener">DesignMentor</a>, showing delaunay triangulation as a projection of a 3D Convex Hull</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/ch3d_as_dt.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/ch3d_as_dt.png" width="auto" height="auto" +alt="Delaunay Triangulations as Projection of 3D Convex Hull"/></a></p> +<h2 id="week-10---motion-planning">Week 10 - Motion Planning</h2> +<p>Lec 1 - Point Shaped Robots</p> +<ul> +<li>Trapezoidal Map for Path with Obstacles. Finding Path: O(NlogN) Construction and O(N) query</li> +</ul> +<p>Lec 2 - Configuration Space</p> +<ul> +<li>Degrees of Freedom: 2D(2 translation x, y + 1 rotation \theta) = 3, 3D(3 translation x,y,z + 2 rotation $\theta, \phi$) = 5</li> +<li>Configuration Polygon: Polygon s.t. foreach point in ConfPol, Robot at point (x, y) (R(x, y)) intersects with obstacle polygon(Pi). (If point robot, then this is just the obstacle polygons.)</li> +</ul> +<p>$$ CP<em>i = {(x, y): R(x, y) \cap P</em>{i}} $$</p> +<p>Lec 3 - Characterizing Configuration Spaces</p> +<ul> +<li>Minkowski&rsquo;s Sum (For Polygon!): $S_1+S_2={p + q : \forall p \in P, q \in Q}$ where p, q are point vectors</li> +<li>Geometric Representation: Replace Copy of S1 in every point of S2 to form the new shape. (or Vice versa; commutative)</li> +<li>Inversion in Polygon Algebra: Rotate polygon by 180 around origin. $S2 =-S1={-p : \forall p \in P}$</li> +<li>Configuration Polygon: $CP = P + (- R(0, 0))$ (where &lsquo;+&rsquo; is minkowski sum)</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/minkowski_sum_of_polygons.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/minkowski_sum_of_polygons.png" width="auto" height="auto" +alt="Configuration Polygon"/></a></p> +<p>Lec 4 - Complexity and Computation</p> +<ul> +<li>Atmost n+m edges in minkowski sum(S) of P (n edges) and Q (m edges)</li> +<li>We can define a map of each edge of S to a pair (i, j) of the edges in P, Q.</li> +<li>Quadratic Algorithm: Convex Hull of points where at each corner of P, Try every rotation of Q</li> +<li>Linear Algorithm: (Two-Pointers-like) Choose Bottom-Right most point for both. And move p_ptr or q_ptr based on which has a smaller angle.</li> +</ul> +<p>Lec 5 - Pseudodisks</p> +<ul> +<li>Def: Pair of Planar Objects (P1, P2) form a pseudodisk if (bound-&gt; boundary, int-&gt;interior), +<ul> +<li>$bound(O1) \cap int(O2)$ is connected</li> +<li>$bound(O2) \cap int(O1)$ is connected</li> +</ul> +</li> +<li>Consider 2 convex polygons with disjoint interiors. +<ul> +<li>Let d1 -&gt; direcion where P1 more extreme, similarly d2.</li> +<li>Then P1 is more extreme in [d1, d2] or [d2, d1]. Or in a circle, one boundary part has P1 more extreme and other with P2.</li> +</ul> +</li> +<li>For P1, P2, take CP1 = P1 + R, CP2 = P2 + R. Then proof by contradiction. So (CP1, CP2) have to be pseudodisks.</li> +</ul> +<p>Lec 6 - Union Complexity</p> +<ul> +<li>For Convex Polygons P, Q, R,.., the total union has atmost 2*(n+m+l+..) vertices. (since every (two or less) crossings can be mapped to a vertex)</li> +<li>For constant complexity convex robot R, translating among S disjoint objects with N edges. We can preprocess in $O(N (logN)^2)$ and compute collision-free path in O(N)</li> +<li>Approach +<ul> +<li>Triangulate Polygons if Not-Convex to make it convex (NlogN)</li> +<li>Compute ConfPol for each Obstacle Polygon (N)</li> +<li>Compute Union of Obstacles by sweep line (N $(logN)^2$)</li> +<li>Mark out Trapezoidal Maps etc.</li> +<li>Query: Find path in complement of unionConfPol with help of Trapezoidal Map</li> +</ul> +</li> +</ul>Numerical Analysishttps://cheese-cracker.github.io/posts/numan/Mon, 20 Jan 2020 00:00:00 +0000https://cheese-cracker.github.io/posts/numan/<h3 id="resources">Resources</h3> +<ul> +<li><a href="https://www.youtube.com/user/kvyi/playlists"target="_blank" rel="noopener">Jacob Bishop&rsquo;s Tutorials</a> Part 5-7 covers most topics</li> +<li><a href="https://www.youtube.com/watch?v=EG62xCOdLLA"target="_blank" rel="noopener">Gauss Quadrature Vs Newton Cotes&rsquo; Visualization</a></li> +<li>Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.)</li> +</ul> +<h2 id="basic-analysis">Basic Analysis</h2> +<ul> +<li>Catastrophic Cancellation</li> +<li>Significant Digits Vs Decimal points</li> +<li>Sum for minimal error, rounding/chopping</li> +<li>Taylor Series&rsquo; Approximation and Error</li> +</ul> +<h3 id="iterative-methods">Iterative Methods</h3> +<ol> +<li>Bisection</li> +<li>Regula Falsi (Method of Chords)</li> +<li>Secant +<ul> +<li>Swap to whichever is close</li> +</ul> +</li> +<li>Fixed Point Iteration +<ul> +<li>Order of convergences</li> +<li>Uniqueness</li> +<li>Error Analysis</li> +</ul> +</li> +<li>Newton Raphson +<ul> +<li>Order of convergences</li> +</ul> +</li> +</ol> +<h3 id="matrix-techniques">Matrix Techniques</h3> +<ul> +<li>Pivoting (Partial Pivoting = Every Step)</li> +<li>Scaling +<ul> +<li>First before Pivoting</li> +</ul> +</li> +<li>Matrix Norms +<ul> +<li>Norm_1(A) = max(col sum)</li> +<li>Norm_inf(A) = max(row sum)</li> +<li>Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue</li> +<li>Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm</li> +</ul> +</li> +<li>Conditional No. = ||A|| * ||A^-1||</li> +</ul> +<h3 id="matrix-iterative-methods">Matrix Iterative Methods</h3> +<p>In order to solve, systems of equation we have Gauss-El-M, Gauss-Jacobi and Gauss-Siedel. Jacobi and Siedel is mostly used for sparse arrays where G-El-M is highly ineffecient. +Newton-Raphson, Fixed Point are iterative methods also work while finding solution.</p> +<ul> +<li>Gaussian Elimination</li> +<li>G-Jacobi&rsquo;s</li> +<li>G-Jacobi&rsquo;s Matrix Version</li> +<li>G-Siedel</li> +<li>G-Siedel Matrix Version</li> +<li>Fixed Point (Matrix)</li> +<li>Newton-Raphson (Matrix)</li> +</ul> +<p>Points to note</p> +<ul> +<li>Matrix must be Diagonally Dominant (see thm) for Jacobi/Gauss-Siedel</li> +</ul> +<h3 id="interpolation-methods">Interpolation Methods</h3> +<ul> +<li>Polynomial</li> +<li>Lagrange +<ul> +<li>Error</li> +</ul> +</li> +<li>Newton Divided Difference</li> +<li>Newton Forward Difference*</li> +<li>Newton Backward Difference*</li> +<li>Hermite</li> +<li>Oscullatory (generalized Hermite)</li> +</ul> +<ul> +<li>NBD, NFD is only for equally spaced</li> +</ul> +<h4 id="table-for-ndd-like-interpolation">Table for N.D.D-like Interpolation</h4> +<ul> +<li>NDD : $frac{f_2 - f_1}{ x_2 - x_1 }$ for each el</li> +<li>NFD: $f_2 -f_1$ Only</li> +<li>NBD: Start Reverse and Take Bottom Row; Same table as NFD $f_2 - f_1$;</li> +<li>HERM: Repeat each entry twice; $frac{f_2 - f_1}{x_2 - x_1} if different or differentiation if same</li> +<li>OSC: Repeat based on no. of available vals in x, y, y&rsquo; ..; $f_2 - f_1$</li> +</ul> +<h2 id="approximation-for-integration">Approximation for Integration</h2> +<p>In order of specific to generalized.</p> +<ul> +<li>Newton Cotes&rsquo; Formula - Approximate function as polynomial and find area. +<ul> +<li>Trapezoid Rule (n = 1 approx:2 data points linear Pn)</li> +<li>Simpson&rsquo;s 1/3 Rule (n = 2 approx:3 data points quadratic Pn)</li> +<li>Simpson&rsquo;s 3/8 Rule (n = 3 approx:4 data points cubic Pn)</li> +<li>Generalized Newton Cotes'</li> +</ul> +</li> +<li>Gaussian Quadrature Method (Method of Undetermined Coeffecients) - Choose points that make the equivalent polygon (may not be contained) +<ul> +<li>Gauss-Chebyshev, Gauss-Legendre, Gauss-Hermite with different weight functions</li> +</ul> +</li> +</ul> +<h2 id="approximations-for-initial-value-problems">Approximations for Initial Value Problems</h2> +<p>Use Taylor Series to derive the equations! +Useful predictor methods also,</p> +<ul> +<li>Euler&rsquo;s Method (RK 1st Order)</li> +<li>Modified Euler Method (RK with 2nd Order AKA Heun&rsquo;s Method)</li> +<li>Runge Kutta(RK) Schemes: Move along the slope(which is approximated by the order) from one point to the next point</li> +<li>Taylor Series Expansion</li> +</ul> +<p>See Use of Butcher Table also and RK in 2 variable (using 2 variable Taylor Series)!</p> +<ul> +<li> +<p>Multi-Step Method</p> +<ul> +<li>Predictor: Adams-Bashforth (Derived from previous m+1 points NBD Polynomial approx)</li> +<li>Corrector: Adams-Moulton (Derived from previous(and including) m +2 points NBD Polynomial)</li> +</ul> +</li> +<li> +<p>Milne&rsquo;s Predictor Formula (Generalized Adams-Besforth by changing limits of integration)</p> +</li> +</ul> +<h2 id="approximating-system-of-odes">Approximating System of ODEs</h2> +<ul> +<li>Runge-Kutta 2 variable method</li> +<li>Implicit Euler&rsquo;s</li> +<li>Milne&rsquo;s Method</li> +</ul> +<h2 id="approximations-for-boundary-value-problems">Approximations for Boundary Value Problems</h2> +<ul> +<li>Finite Difference Method</li> +<li>Finite Element Methods +<ul> +<li>Collocation Method</li> +<li>Rayleigh Ritz Method</li> +<li>Galerekin&rsquo;s Weighting Function Method</li> +</ul> +</li> +</ul>Math Modellinghttps://cheese-cracker.github.io/posts/mmodelling/Mon, 20 May 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/mmodelling/<h3 id="important-topics">Important Topics</h3> +<ul> +<li><a href="https://www.math24.net/routh-hurwitz-criterion/"target="_blank" rel="noopener">Routh Hurwitz Test</a></li> +<li>Matrix of Variation/Jacobian of dx/dt (and dy/dt)</li> +<li>Stability of solution +<ul> +<li>Local Stability (Matrix of Variation) Eigenvalues +<ul> +<li>Positive Definate : Unstable</li> +<li>Negative Definate : Local AS</li> +<li>Imaginary Eigenvalues: Spiral</li> +</ul> +</li> +<li>Global Stability (Appropriate Lyaponov Function) +<ul> +<li>Test stability by Lyapunov Funcn or any other (V) has derivative negative definate</li> +</ul> +</li> +</ul> +</li> +</ul> +<p>$$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$</p> +<p>$$\frac{dV}{dt} = \frac{\dot{x}}{x}( x - x^*) + other$$</p> +<ul> +<li>Quick Finding of Eigenvalues (see Prerequisites)</li> +<li>Complex Eigenvalues and Calculation of Spiral</li> +<li>Linearization of Solution</li> +<li>Logistic regression Model +$$ \frac{dx}{dt} = rx(1 - \frac{x}{k})$$</li> +<li>Persistance / Permanance of Solution</li> +<li>Picard-Landlof Theorem - Existence of Solution</li> +<li>Sylvester&rsquo;s Criteria - b^2 - 4ac conditions</li> +<li>Hamiltonian +$$ H(x, t, u, \lambda) = g*{divident}(x, t, u) + \lambda f*{capital\ assets}(x, t, u) $$</li> +<li>Pontrayagin&rsquo;s Maximum Principle +$$ \frac{d\lambda}{dt} = -\frac{dH}{dx}$$</li> +<li>Bang-Bang and Singular Control (Control Theory)</li> +<li>De Carte&rsquo;s Rule of Sign</li> +<li>Dulac Bendixson Criteria for periodicity of soln</li> +<li>Bionic Equilibrium Conditions (for Optimal Harvesting)</li> +<li>Hopf Bifurcation: The point where behavior of system stability changes. Opposite stability before and after critical value.</li> +<li>Lebesgue Cycle Stability</li> +<li>Basic Reproduction No.</li> +<li>LimSup Method for showing boundedness</li> +<li>Standard Comparison Theorem, Amax &gt; Bmin, well-posedness &hellip;</li> +</ul> +<hr> +<h3 id="models">Models</h3> +<ol> +<li>Malthusian Growth Model +$$ dx/dt = rx$$</li> +<li>Logistic Growth Model (inter-specific interference)</li> +<li>Resource-Consumer and similar models - +<ul> +<li>Prey-Predator Model (or Resource Consumer) +<ul> +<li>specialized prey-predator</li> +<li>generalized prey-predator</li> +</ul> +</li> +<li>Competetive Model</li> +<li>Cooperation Model</li> +</ul> +</li> +<li>3 Species Food Chain Model +(Logistic Growth with interspecie interface)</li> +<li>Opimal Harvesting (fish) Model - Max Sustainable Yield</li> +<li>Migration of Fishes Model</li> +<li>Pollution Toxicant Models- +<ul> +<li>2D Model</li> +<li>3D Model - Uptake of Conc (POST-Midsem)</li> +</ul> +</li> +<li>Susceptible-Infected and variant models +<ul> +<li>SI Model</li> +<li>SIS Model(with immunity)</li> +<li>SIR Model(with complete cure forever)</li> +<li>SEIR Model(Both Exposed and Recovery types)</li> +</ul> +</li> +</ol> +<h4 id="analysis-of-solution">Analysis of Solution</h4> +<ul> +<li>Boundedness</li> +<li>Positivity and Solution Space $\Omega$</li> +<li>Persistance of Solution (Show Lower Bound)</li> +<li>Periodicity or not (Dulac Bendixson Criteria)</li> +<li>Equilibrium Points</li> +<li>Local Stability Analysis +<ul> +<li>Linearize solution and then find values OR&hellip;</li> +<li>Use generalized matrix of variation and plug in values</li> +</ul> +</li> +<li>Global Stability Analysis +<ul> +<li>Choose Lyapanov Function and terms based on Logistic Growth or not</li> +<li>Differentiate and show Negative Definate</li> +<li>Use Sylvester&rsquo;s Criteria and compare terms using Routh-Hurwitz Criteria</li> +<li>Routh Array to show stability</li> +</ul> +</li> +</ul> +<h4 id="other-analysis-techniques">Other Analysis Techniques</h4> +<ul> +<li>Rate $\dot{r}$ for growth and $\dot{\theta}$ for clockwise/anticlockwise in spirals</li> +<li>Lebesgue Cycle stability in spirals</li> +<li>Critical points in Hopf Bifurcation and stability chart</li> +<li>Basic Reproduction Number Calculation</li> +</ul> +<hr> +<h4 id="sample-model-to-check-equilibrium-points">Sample Model to check equilibrium points</h4> +<div class="mermaid"> +graph TD +A[Formulate the Rate Diffn Equations] --> AB +AB[ Find Omega. Check if bounded with limsup and show positive also. Check Persistance/Periodicity] --> B +B[Find equilibrium points where rate = 0] --> C +C[Local Stability. Get matrix of variation/Jacobian at these points] --> D +C --> E[Get Char Eqn with Eigenvalue] +E --> F[Use Routh Hurwitz to get roots' sign] +F --> G[From sign of eigenvalues determine stability of Local Solution] +D[Get Eigenvalues of the matrix of variation] --> G +G --> H +H[Global Stability. Use Lyapunov function variants Derivative] --> I[Check if negative definate by adding/subtracting] +</div> +<h4 id="harvesting-model-sample-flow">Harvesting Model Sample Flow</h4> +<p>Steps for Solving</p> +<ol> +<li>Formulate the Rate Diffn Equations</li> +<li>Find the equilibrium points and conditions</li> +<li>Plug x* value in harvesting rate equation qEx</li> +<li>Get max E by finding minima at x* and put the value into harvesting rate</li> +</ol> +<p>For optimal harvesting policy,</p> +<ol start="5"> +<li>Find hamiltonian with - f as <em>net revenue in continuous time stream</em> - g as <em>rate of change of assets</em> +$$ H = e^{-\delta t}(pqx-c)E + \lambda_1 \frac{dx}{dt} +\lambda_2 \frac{dy}{dt}$$</li> +<li>Find <strong>minima of H wrt. E</strong> .Get switching func and equate to 0 for singular control</li> +<li>Apply Pontrayagin&rsquo;s Max Principle Condition and use with step 6.</li> +<li>Find discount value and check notes of these points</li> +</ol> +<p>Bionic Equilibrium is value of E at +$$\dot{x} = \dot{y} = 0$$</p> +<hr> +<h4 id="sir-model">SIR Model</h4> +<p>Steps for Solving,</p> +<ol> +<li>Show Bounded by taking sum of population(N) and finding LimSupN(t) will be const</li> +<li>Take S(t) and with Comparison Theorem, show &gt;=0</li> +<li>Use Dulac Bendixson with H = 1/SI, and show no sign change so not periodic</li> +<li>Find Equilibrium Points (approx E*) with reproduction no. &lsquo;R&rsquo;</li> +<li>Matrix of Variation with &lsquo;R&rsquo; cases</li> +<li>Lyapunov Function and one term will not allow sylvester&rsquo;s criteria</li> +<li>Choose C = S* to get, +$$ \dot{V} = -\beta I (S - S^*) -\beta S^* (I-I^*)( S - S^* ) &lt; 0 $$</li> +</ol> +<h4 id="other-useful-prerequisites">Other Useful Prerequisites</h4> +<ul> +<li> +<p>Green&rsquo;s Thm</p> +</li> +<li> +<p>Stoke&rsquo;s Thm</p> +</li> +<li> +<p>Gauss Divergent Thm</p> +</li> +<li> +<p>Finding Eigenvalues fast +$$ \lambda^2 - Tr(A)\lambda + Det(A) $$ +<em>Trace is sum of diagonal entries</em></p> +</li> +<li> +<p>Routh Hurwitz Criteria +See <a href="https://www.math24.net/routh-hurwitz-criterion/"target="_blank" rel="noopener">Routh Hurwitz Test</a> - Conditions - All positive coeff always - All minors must be positive - 2nd Degree: no more conditions - 3rd Degree a1*a2 - a3*a0 &gt; 0 (for 3 degree see below)</p> +<p>$$ +Routh\ Array = +\begin{bmatrix} +a_{N} &amp; - a_{N-2} \ +a_{N-1} &amp; a_{N-3} \ +\end{bmatrix} +$$</p> +</li> +<li> +<p>Another view to understand <a href="https://youtu.be/WBCZBOB3LCA"target="_blank" rel="noopener">Routh Hurwitz Graphical</a></p> +<ul> +<li>Background +<ul> +<li>If one sign different =&gt; one is positive. Hence unstable.</li> +<li>If all negative =&gt; same as all positive coeff</li> +</ul> +</li> +</ul> +</li> +</ul>Principles of Economicshttps://cheese-cracker.github.io/posts/poe/Mon, 20 May 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/poe/<h3 id="introduction">Introduction</h3> +<p>These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). +Feel free to collaborate to the <strong><a href="https://hackmd.io/PtXbIdS-R52MuXXW6gc9uA?both"target="_blank" rel="noopener">Online Version of POE Notes</a></strong>. +These are only supplementary notes and NOT Lecture Notes. +Some useful resources.</p> +<ul> +<li><strong><a href="https://youtu.be/ucJBO9UTmwo"target="_blank" rel="noopener">ACDC ECON Tutorials</a></strong> by Jacob Cliffords for both Micro and Macro</li> +<li><strong><a href="https://www.khanacademy.org/economics-finance-domain/microeconomics/choices-opp-cost-tutorial/marginal-utility-tutorial/v/marginal-utility"target="_blank" rel="noopener">Khan Academy - Microeconomics</a></strong></li> +</ul> +<h3 id="elasticity-curves-part">Elasticity Curves Part</h3> +<p>Elasticity : % change quantity / % change price +$$\epsilon = \frac{ \% \Delta Q}{\% \Delta P}$$</p> +<p>(Similar to sensitivity)</p> +<ul> +<li> +<p>Inelastic</p> +<ul> +<li>monopoly</li> +<li>necessity</li> +<li>small E = Not much choice</li> +<li>E &lt; 1 ( or slope &gt; 45)</li> +<li>TR decreases for increase in quantity</li> +</ul> +</li> +<li> +<p>Elastic</p> +<ul> +<li>perfectly competetive</li> +<li>large E = plenty choice</li> +<li>E &gt; 1 ( or slope &lt; 45)</li> +<li>TR increases for increase in quantity</li> +</ul> +</li> +</ul> +<h4 id="types-of-elasticity">Types of Elasticity</h4> +<ul> +<li>Cross Price Elasticity <strong>sensitivity of A</strong> has, $\epsilon_{cross\ price} = \frac{ \% \Delta Q\ of\ B}{ \% \Delta P\ of\ A}$</li> +<li>Income Elasticity $\epsilon_{income} = \frac{ \% \Delta Q}{ \% \Delta Income}$</li> +</ul> +<h4 id="other-terms">Other Terms</h4> +<ul> +<li>Consumer Surplus = Buyer&rsquo;s Max - Price (Upper Triangle)</li> +<li>Producer Surplus = Price - Seller&rsquo;s Min (Lower Triangle/Part) +<blockquote> +<p>See CH-13 Monopoly and Antitrust for Graph and Explaination</p> +</blockquote> +</li> +</ul> +<h3 id="6---household-behavior-and-customer-choice">6 - Household behavior and Customer Choice</h3> +<ul> +<li>Household Demand Factors- Price, Income, relative prices preferences</li> +<li>Budget Constraint (Eqn)</li> +</ul> +<ol> +<li> +<p>Utility</p> +<ul> +<li>Rule of Diminishing Marginal Utility, Saturating curve of TU</li> +<li>Utility Maximizing Rule $\frac{MU}{Price}$</li> +<li>Diamond-Water Paradox <em>Water becomes granted so diminishing MU +and downward-sloping (double derivative +ve)</em></li> +</ul> +</li> +<li> +<p>Income and Substitution Effect</p> +<ul> +<li>Income effect is the <strong>change in consumption of a product</strong> due +to the relative change in <strong>price of product</strong> (well-being) +<code>Parallel Shift of Budget Constraint</code></li> +<li>Substitution effect is the <em>relatively cheap</em> as compared to +competitors hence shift in purchasing towards that product (not +substitutes) <code>Angle turn along the Indifference Curve</code></li> +</ul> +<ol> +<li> +<p>Income Effect on Labour Supply Curve +Labour Supply Curve is Backward Sloping Curve</p> +<ul> +<li>Substitution is upward slope part</li> +</ul> +<p><em>you have to work hard coz you earn more now</em></p> +<ul> +<li>Income Effect is reverse slope part<br></li> +</ul> +<p><em>if you become rich, then you wanna party and do play!</em></p> +</li> +</ol> +</li> +<li> +<p>Indifference Curves</p> +<ul> +<li>Curve that yields same total utility</li> +</ul> +<p><em>consumer is indifferent between any points on curve</em></p> +<ul> +<li>Diminishing MRS (law of diminishing utility)</li> +</ul> +<p><em>that&rsquo;s why it slopes asymptoetically</em></p> +<ul> +<li>Chooses highest curve touching budget constraint</li> +</ul> +<p><em>slope of indifference curve = slope of budget line</em></p> +</li> +</ol> +<h3 id="7---production-process-behavior-of-profit-maximizing-firms">7 - Production Process: behavior of Profit-Maximizing Firms</h3> +<p>Analagous to Chapter 6 but slightly different. Production process is in +terms of inputs and outputs. K(capital)-L(labour) is the new +Price-Quantity with MRTS slope</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/costmineq.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/costmineq.jpg" width="auto" height="auto" +alt="Cost Min Eq"/></a></p> +<ol> +<li> +<p>Behavior of Profit Maximizing Firms</p> +<ul> +<li>how much output to supply</li> +<li>how to produce that output</li> +<li>how much of each input demand</li> +</ul> +<ol> +<li> +<p>Profit and Economic Costs</p> +<ul> +<li>Total Revenue, Total Cost, Economic Profit</li> +<li>Most Important factor of production for opportunity cost = +capital</li> +<li>Rate of return : annual net income % of total income +(breaks into shares?) so it&rsquo;s just enough to keep owners happy +(like risk-free bonds)</li> +<li>Normal Rate of Return = zero profit equilibrium point</li> +<li>Input Type +<ul> +<li>Fixed</li> +<li>Variable</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Short Run and Long Run</p> +<ul> +<li>short run : fixed rate of production (no scaling up/down or +no exiting/entering)</li> +<li>long run : firms can choose to expand or contract</li> +</ul> +</li> +<li> +<p>Others-</p> +<blockquote> +<p>See Optimal method of production chart in CH-8 below</p> +</blockquote> +</li> +</ol> +</li> +<li> +<p>Production Process</p> +<p>Total, Average and Normal Product of Labour. See Curves in CH-8</p> +<ul> +<li> +<p>Equivalent-Law of diminishing returns (MP of Labour)</p> +</li> +<li> +<p>3 Stages of TP, AP, MP Curve-</p> +<ol> +<li>MP reaches maximum (double derivative 0)</li> +<li>AP = MP</li> +<li>MP = 0 and thus TP is maximum</li> +</ol> +</li> +</ul> +</li> +<li> +<p>Equivalent behavior (Others)</p> +<table> +<thead> +<tr> +<th>Producer Market</th> +<th>Consumer Market</th> +</tr> +</thead> +<tbody> +<tr> +<td>Isoquant</td> +<td>Indifference Curve</td> +</tr> +<tr> +<td>Isocost</td> +<td>Budget Constraint</td> +</tr> +<tr> +<td>X</td> +<td>Labour(L)</td> +</tr> +<tr> +<td>Y</td> +<td>Capital</td> +</tr> +<tr> +<td>MRTS</td> +<td>MRS</td> +</tr> +<tr> +<td>Cost-Min Eq</td> +<td>Utility-Max Eq</td> +</tr> +</tbody> +</table> +</li> +</ol> +<h3 id="8---short-run-costs-and-output-decisions">8 - Short Run Costs and Output Decisions</h3> +<p>TC (overhead), TFC, TVC, AFC, AVC, MC (=MVC), AP, MP See Curves.</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/shortruncosts.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/shortruncosts.jpg" width="auto" height="auto" +alt="Table 8.4 Short Run Costs of Firm"/></a></p> +<ol> +<li> +<p>Types of Costs</p> +<p>Main Types Costs</p> +<ul> +<li>Fixed Cost</li> +<li>Variable Cost</li> +</ul> +<p>Analyze costs as</p> +<ul> +<li>Total Cost</li> +<li>Average Cost = $\frac{TC}{Q}$ where Q is quantity at that time</li> +<li>Marginal Cost = increase in TC for production of 1 more unit +output</li> +</ul> +</li> +<li> +<p>Cost Curves</p> +<ul> +<li>Variable costs depends on - +<ul> +<li>techniques of production</li> +<li>prices of inputs required</li> +</ul> +</li> +<li>Plot has <code>x-axis = Output and y-axis = type of cost</code></li> +</ul> +<ol> +<li> +<p>Fixed Cost Curves</p> +<p>Spreading Overhead</p> +<ul> +<li>Fall of total fixed cost by increasing quantity (small cost +per quantity; down asymptoete)</li> +<li>TFC still remains line parallel x-axis(Output)</li> +</ul> +</li> +<li> +<p>Variable Cost Curve</p> +<p>Increases with quantity</p> +</li> +<li> +<p>Marginal Cost Curve</p> +<p><em>slight decrease till max then increase all the way</em></p> +<ul> +<li>Marginal Cost increases with output (since no change in +scale of production</li> +<li>diminshing returns = increasing marginal cost</li> +</ul> +</li> +<li> +<p>Notes on Curves</p> +<ul> +<li>Marginal Costs is slope of TVC</li> +<li>The dip point (minima) of MC is the inflection point of TVC</li> +<li>MC cuts AVC at min of AVC and ATC at min of +ATC</li> +<li><strong><a href="https://www.khanacademy.org/economics-finance-domain/ap-microeconomics/production-cost-and-the-perfect-competition-model-temporary/short-run-production-costs/v/graphical-impact-of-cost-changes-on-marginal-and-average-costs"target="_blank" rel="noopener">Short Run Curves</a></strong></li> +</ul> +</li> +</ol> +<p><em>Where MC crosses is where others stop falling</em></p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/POE_Curves.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/POE_Curves.jpg" width="auto" height="auto" +alt="Product and Cost Curves"/></a></p> +</li> +<li> +<p>Output Decisions and Summary</p> +<ul> +<li>Marginal Revenue Curve and Demand Curve identical in a +<strong>perfectly competetive market</strong></li> +<li>Profit Maximizing- Take $MR = MC$ +(where Price from Demand Curve cuts MC for competetive)</li> +<li><em>Firms will produce only as long as MR &gt; MC</em></li> +<li><em>Profit Maximizing Rule is the Loss Minimizing Rule</em></li> +</ul> +</li> +<li> +<p>Types of Questions-</p> +<ul> +<li>Table-based question (fill the table of TFC, TVC, AVC, MC&hellip;.)</li> +<li>Equation of TC in Q given</li> +<li>Sketch graphs for different situations</li> +</ul> +</li> +</ol> +<h3 id="9---long-run-costs-and-output-decisions">9 - Long Run Costs and Output Decisions</h3> +<ul> +<li>Terms +<ul> +<li>Shutdown Point TR &lt; TFC (or P &lt; AVC)</li> +<li>Long term contraction if TR &lt; TC (Contracts and then exits)</li> +<li>Operating Profit: TR - TVC (may be losses!)</li> +<li>Economic Profit Vs Accounting Profit at 0-profit point</li> +</ul> +</li> +</ul> +<h5 id="long-run-average-cost-curve">Long Run Average Cost Curve</h5> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/lrac.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/lrac.jpg" width="auto" height="auto" +alt="LRAC"/></a></p> +<p>The graph is split into 3 parts-</p> +<ol> +<li>Economies of Scale (Beginning Drop) : More Cost but More Quantity = Less ATC</li> +<li>Constant Returns (Constant Line at Min) : Same as short run</li> +<li>Diseconomies of Scale (Upward after Dip) : More Cost but not much more Quantity = More ATC</li> +</ol> +<h5 id="long-run-industry-supply-curve">Long Run Industry supply Curve</h5> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/lrisdecreasing.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/lrisdecreasing.jpg" width="auto" height="auto" +alt="LRIS in Decreasing Cost Industry"/></a></p> +<p>Decreasing Cost Industry Above</p> +<p>LRIS Calculation</p> +<ul> +<li>Demands expands to D2</li> +<li>Prices Rise to P1'</li> +<li>New Firms enter and supply shifts to SRS3</li> +<li>Price goes down to P3</li> +<li>Based on decrease in price (Decreasing cost) or increase (Increasing Cost)</li> +<li>Since P3 &lt; P0 so LRAC decreases and Decreasing Cost-Ind</li> +</ul> +<h3 id="10---labour-and-land-markets">10 - Labour and Land Markets</h3> +<ul> +<li>Shifts in Input Demand Curves +<ul> +<li>Demand for Outputs</li> +<li>Quanitity of Complementary and Substitute</li> +<li>Price of other inputs</li> +<li>Technology Change</li> +</ul> +</li> +<li>Profit Maximizing</li> +</ul> +<h5 id="labour-market">Labour Market</h5> +<ul> +<li>Derived Demand: Indirect demand like Labour not Goods and Services</li> +<li>Marginal Product of Labour: Additional Output produced by adding another unit of labour</li> +<li>Marginal Product of Labour Increases then decreases. e.g- +<blockquote> +<p><em>Too many cooks, spoil the broth&hellip;.. too few cooks, can&rsquo;t make the broth?</em></p> +</blockquote> +</li> +<li>Marginal Revenue Product MRP(L): Price of output X MR(L)</li> +<li>Market Labour Supply Curve</li> +<li>Profit-Maximizing (from MR = MC): MRP(L) = Wage(W)</li> +<li>In perfectly competetive firms, combine all MRP(L) have common price of output (see questions)</li> +</ul> +<h5 id="land-market">Land Market</h5> +<ul> +<li>Demand Determinant: Price determined exclusively by its demand. Supply is Fixed (perfectly inelastic). e.g - Land</li> +<li>Pure Rent: Return to factor of production with fixed supply</li> +</ul> +<h3 id="11---capital-market-and-investment-decisions">11 - Capital Market and Investment Decisions</h3> +<h3 id="market-structures-and-151">Market Structures (and 15.1)</h3> +<ul> +<li>Perfect Competition (E = $\infty$)</li> +<li>Monopolistic Competition (Not Monopoly-Like!)</li> +<li>Oligopoly</li> +<li>Monopoly (E = 0)</li> +</ul> +<h4 id="151-monopolistic-competition---industry-characterstics">15.1 Monopolistic Competition - Industry Characterstics</h4> +<ul> +<li>Large no. of firm</li> +<li>No barriers to entry</li> +<li>Product Differentiation</li> +</ul> +<h3 id="13---monopoly-and-antitrust">13 - Monopoly and Antitrust</h3> +<ul> +<li> +<p>Marginal Revenue -</p> +<ul> +<li>For Monopoly, TR is max when MR = 0</li> +<li>For Competetive Firm, MR = price (varied by market)</li> +<li>MR has slope less (more -ve) coz Additional Output =&gt; Lower Price for more demand.</li> +</ul> +</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/monopolycomparison.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/monopolycomparison.png" width="auto" height="auto" +alt="Monopoly Firm Welfare Loss and Prices"/></a></p> +<ul> +<li> +<p>Pricing and Ineffeciencies-</p> +<ul> +<li>Firm produces Q at $MR = MC$ (at Q1) but prices Demand Curve (P1)</li> +<li>Leads to Dead Weight Loss (Allocated Ineffeciency) - unecessarily less customers = A-B-C Triangle</li> +<li>Consumer Surplus - Lost high pricing for rich customers = Triangle P1-A-F</li> +<li>Producer Surplus - Price of good higher than cost-to-manufacture = Area of E-C-P1-A</li> +</ul> +</li> +<li> +<p>Barriers to Entry -</p> +<ul> +<li>Economies of Scale - Very Large (or high advertisement costs) +(Predatory Pricing &hellip;See Oligopoly)</li> +<li>Patents - (Mostly Medicine Companies)</li> +<li>Government Rules - Laws favouring Gov Monopolies or through Lobbying</li> +<li>Ownership of Exclusive Capital - Own Diamond Mines etc.</li> +<li>Network Externalities - Dependant on the popularity of the product</li> +</ul> +</li> +<li> +<p>Social Costs of Monopoly -</p> +<ul> +<li>Deadweight Loss (Depriving Customers of the product)</li> +<li>Rent-Seeking behavior (through lobbying and building Barriers)</li> +</ul> +</li> +</ul> +<h3 id="14---oligopoly">14 - Oligopoly</h3> +<ul> +<li> +<p>Measures for Oligopoly</p> +<ul> +<li>HHI = Sum of Squared-Market-Shares (&gt;1,800 for High)</li> +<li>CR (Conc. Ratio) = % Share of top n companies (&gt;80% for High)</li> +</ul> +</li> +<li> +<p>Types of Oligopoly</p> +<ul> +<li>Non-Collusive +<ul> +<li>Cournot&rsquo;s Duopoly</li> +</ul> +</li> +<li>Collusive (Can be Tacit or Non-Tacit) +<ul> +<li>Price Leadership</li> +<li>Cartels and Collusion</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Price Leadership - Dominant Firm decides market price for smaller firm.</p> +</li> +<li> +<p>Predatory Pricing - Temporarily selling at artificially low price to kill competitors</p> +</li> +<li> +<p>Cartel Duopoly - Use like monopoly with $MR = MC_1 = MC_2$</p> +</li> +</ul> +<h4 id="cournots-model">Cournot&rsquo;s Model</h4> +<ul> +<li>Assumptions- Identical Firms with homogenous products</li> +<li>Response Func = Func of output of a Firm</li> +<li>Inverse Demand Func - price of product</li> +<li>Same Equilibrium for both firms</li> +<li>Steps to solve +<ul> +<li>Equate $MR = MC$ for each firm</li> +<li>Output of each firm as func of other firm (Response Func)</li> +<li>Intersection of Responses (Can be plotted) is the Nash Eq.</li> +</ul> +</li> +</ul> +<h4 id="game-theory">Game Theory</h4> +<ul> +<li>Dominant Strategy - Player has a strategy which is better <strong>irrespective</strong> of the other&rsquo;s solution</li> +<li>Nash Equilibrium - All players play their best strategy (Need not be dominant-dominant!)</li> +<li>Maximin Strategy - Low risk to maximize the min gain (opposed to minmax)</li> +<li>Tit-for-tat Strategy - Response Based Strategy</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/prisonersdilemma.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/prisonersdilemma.png" width="auto" height="auto" +alt="Prisoner&amp;rsquo;s Dilemma"/></a></p> +<ul> +<li>Prisoner&rsquo;s Dilemma (see above) - Dominant-Dominant is not Nash Eq. (or best strategies)</li> +</ul> +<h3 id="20---intro-to-macro">20 - Intro to Macro</h3> +<ul> +<li>Aggregate: To refer to sums only</li> +<li>Recession/Slump or Expansion/Boom</li> +<li>Depression = Long lasting depression</li> +<li>Business Cycle: One cycle of slight recession and expansion</li> +<li>Macroeconomic Concerns +<ul> +<li>Output Growth: Aggregate Output</li> +<li>Unemployment: unemployment rate not too low(business will not have labour) and not too high (jobless people)</li> +<li>Inflation and Deflation: +Mild Inflation rate is required - Hyperinflation: rapid and devaluation (Venzuala, Turkey..) - Deflation: Nobody buys anything = No businesses (Japan)</li> +</ul> +</li> +<li>Circular Flow Diagram between Household, Gov, Firms, World</li> +</ul> +<h4 id="class-notes-terms">Class Notes Terms</h4> +<ol> +<li>Goods and Services Market</li> +<li>Financial Markets - Trading Securities (equities</li> +<li>Money Markets</li> +</ol> +<p>Policies,</p> +<ol> +<li>Fiscal Policy - Tax &amp; Spending policies of Gov</li> +<li>Monetary Policies - +<ul> +<li>CRR: Cash Reserve Ratio (~4%)</li> +<li>SLR: Statutory Liquidity Ratio (~19.4%)</li> +<li>Repo Rate: Repurchase Agreement</li> +<li>Reverse Repo Rate: Reverse Repurchase Agreement</li> +</ul> +</li> +</ol> +<h3 id="21---measure-outputs-and-income-national">21 - Measure Outputs and Income (National)</h3> +<ul> +<li>Domestic Vs National : Region-based Vs Nationality(citizenship) based. +<em>See Honda Plant in Nagpur Example</em></li> +<li>Gross Vs Net: Without Depreciation Vs True with Depreciation</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/gdpconversion.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/gdpconversion.jpg" width="auto" height="auto" +alt="Conversions for GDP"/></a></p> +<ul> +<li>Note that depreciation is mostly considered only for net domestic-private investments and not others</li> +</ul> +<h5 id="exclusions-to-gdp">Exclusions to GDP</h5> +<ul> +<li>Final Goods and Services only not intermediate</li> +<li>Value added method for calculating GDP</li> +<li>Exclude Used Goods - No new production or revenue generation (except rent)</li> +<li>Exclude Paper Transactions (like stocks and bonds but not broker fees) - No new production and only exchanges.</li> +<li>Only domestically owned production - Only region based and not on citizenship (see GNP).</li> +</ul> +<h5 id="expenditure-approach">Expenditure Approach</h5> +<p>$$GDP = C + I + G +(Ex -Im)$$</p> +<ul> +<li> +<p>Personal Consumption C: Household spending on goods and services</p> +<ul> +<li>Durable: Furniture, cars&hellip;<em>(longer lasting)</em></li> +<li>Nondurable: Food, clothing, gasoline..<em>(short lived)</em></li> +<li>Services: Doctors, Educations&hellip;</li> +</ul> +</li> +<li> +<p>Gross Private Domestic Investment I: Purchase of new capital like</p> +<ul> +<li>Residential: Houses etc.</li> +<li>Non-Residential: Machines, Tools, Plants</li> +<li>Change in Business Inventory: Goods produced for later sale in inventories</li> +</ul> +</li> +<li> +<p>Government Consumption and Gross Investment G: Goods (schools, government programmes, institutions&hellip;) and services (military salaries&hellip;)</p> +<ul> +<li>Central (or Federal)</li> +<li>State</li> +</ul> +</li> +<li> +<p>Net Exports (Ex - Im):</p> +<ul> +<li>Exports by the country shows production</li> +<li>Imports is production from other countries</li> +</ul> +</li> +</ul> +<h5 id="income-approach">Income Approach</h5> +<p>This approach to GDP is from National income which is in decreasing order of magnitude from,</p> +<ol> +<li>Compensation of Employees</li> +<li>Proprietors&rsquo; Income (Uncorporated businesses&rsquo; income)</li> +<li>Rental Income</li> +<li>Corporate Profits</li> +<li>Net Interest (!only interest from businesses)</li> +<li>Indirect Taxes minus subsidies</li> +<li>Net Business Transfers Payments by Businesses</li> +<li>Surplus from Government Institutions (often -ve unlike others)</li> +</ol> +<h6 id="national-income-to-personal-saving">National Income to Personal Saving</h6> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/nationalpersonal.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/nationalpersonal.jpg" width="auto" height="auto" +alt="National Income"/></a></p> +<h5 id="nominal-vs-real-gdp">Nominal Vs Real GDP</h5> +<ul> +<li>Real GDP = Nominal GDP adjusted for price change</li> +<li>Real Vs Nominal Output</li> +<li>Fixed-Weight Procedure: Prices in base year as weights for reference</li> +<li>GDP Deflator Method - Using series of % changes to measure overall price</li> +<li>Problems of fixed-weight procedure</li> +</ul> +<h5 id="limitations">Limitations</h5> +<ul> +<li>GDP does not reflect crime rate, increase in leisure time, pollution, domestic work and social ill.</li> +<li>Informal Economy - illegal transactions and tax evasion</li> +<li>Gross National Income per Capita as measure</li> +</ul> +<h3 id="251-2---money-and-banks">25(.1, .2) - Money and Banks</h3> +<p><strong><a href="https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/banking-and-money"target="_blank" rel="noopener">Khan Academy - Money and Banking</a></strong></p> +<p>Money as,</p> +<ol> +<li>Medium of Exchanges (<em>Not like barter, where we trade goods like cocoa</em>)</li> +<li>Store of value - Asset that can be used to transport purchasing power (<em>you can save for now and still spend later</em>)</li> +<li>Unit of account (<em>compare price of pizza and banana</em>)</li> +</ol> +<ul> +<li> +<p>Commodity Monies - Using cigerretes / Ramen as money in Jails.</p> +</li> +<li> +<p>Fiat Money / Token Money - Money that is intrinsically useless (<em>paper of rupee notes aren&rsquo;t useful</em>)</p> +</li> +<li> +<p>Legal tender - What RBI says can be accepted as &lsquo;money&rsquo; (ONLY currency!) +<em>see 51% torn part of dollar bill is legal tender in US</em></p> +</li> +<li> +<p>Currency Debasement - Hyperinflation of currency value due to too much supply of currency (<em>zimbabwe, post-war Germany, Venzuala&hellip;</em>)</p> +</li> +<li> +<p>Measuring Money Supply? +Money Supply = Currency + Deposits</p> +</li> +<li> +<p>Types of Money</p> +<ul> +<li>M1 = Currency + Demand Deposits + Other Deposits</li> +<li>M2 = M1 + Saving Deposits with Post Office</li> +<li>M3 = M1 + Time Deposits with Bank ( Most Useful )</li> +<li>M4 = M3 + Total Deposits with Post Office Saving Organization (excluding NSC)</li> +</ul> +</li> +</ul> +<h4 id="creation-of-money-by-banks">Creation of Money by Banks</h4> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/creationofmoney.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/creationofmoney.png" width="auto" height="auto" +alt="Creation of Money by Banks"/></a></p> +<p>(<strong>See Table 25.3 of Textbook for better understanding</strong>)</p>Graphs and Networkshttps://cheese-cracker.github.io/posts/graphsnetworks/Sun, 10 Mar 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/graphsnetworks/<h3 id="list-of-algorithms">List of Algorithms</h3> +<ol> +<li> +<p>Minimum Spanning Trees</p> +<ul> +<li>Krusikal&rsquo;s (Any point but min with no cycle)</li> +<li>Prim&rsquo;s (From starting point)</li> +</ul> +</li> +<li> +<p>Graph Traversal Techniques</p> +<ul> +<li>BFS</li> +<li>DFS</li> +<li>Djkstra&rsquo;s Shortest Path</li> +<li>Apply DFS for checking cut vertex</li> +</ul> +</li> +<li> +<p>Eulerian/Hamiltonian Graphs</p> +<ul> +<li>Eulerian Graph even degree</li> +<li>Fleury&rsquo;s Algorithm</li> +<li>Closure of Graph</li> +<li>Sufficient conditions of Hamiltonian Graph (and Restricted +Hamiltonian Algo)</li> +</ul> +</li> +<li> +<p>Travelling Salesman Problem</p> +<ul> +<li>TSP1- From weight matrix, draw tables</li> +<li>TSP2 - Take min span, DFS from leaf node and join all endpoints</li> +</ul> +</li> +<li> +<p>Network Flow Algo - MaxFlow Mincut</p> +</li> +</ol> +<h3 id="resources">Resources</h3> +<ul> +<li><a href="https://github.com/mrpandey/d3graphTheory"target="_blank" rel="noopener">D3 Graph Theory</a></li> +<li>Algebraic Graph Theory Courses by <a href="http://www.cs.yale.edu/homes/spielman/"target="_blank" rel="noopener">Dan Spielman</a> and his <a href="https://youtu.be/CDMQR422LGM"target="_blank" rel="noopener">Miracles video</a></li> +<li><a href="https://www.youtube.com/playlist?list=PLdWX5TZJp5AbxTuiLuNc-wsnbp8Q1ajBy"target="_blank" rel="noopener">Spectral Graph Theory Course</a> and sources from <a href="http://www.cs.yale.edu/homes/spielman/eigs/"target="_blank" rel="noopener">Dan&rsquo;s Course</a></li> +<li><a href="http://www.cs.yale.edu/homes/spielman/eigs2/papers.html"target="_blank" rel="noopener">Recommended Papers for Eigenvalues of Graphs with applications by Dan</a></li> +</ul> +<h3 id="proofquestion-hints">Proof/Question Hints</h3> +<div class="mermaid"> +graph TD +A[Proof Types in Graphs and Networks] --> B[Contradiction] +A --> C[Construction or deletion] +A --> D[Induction] +</div> +<p><em>Induction is by far the most popular. Contradiction is sometimes used with a construction</em></p> +<ul> +<li>Take Longest path in graph (delete or not)</li> +<li>Check type of cycles in graph</li> +<li>Adjacency Matrix, Caylay Matrix, Graph Laplacian and Incidence Matrix based approach</li> +<li>Number of components more or less (cut-edge, hamiltonian&hellip;)</li> +<li>If cycle length 2, Bipartite</li> +<li>Planar = draw planar drawing</li> +<li>Non-planar +<ul> +<li>Euler&rsquo;s Formula or 5-degree or variants(girth-analysis)</li> +<li>Check any Subgraph non-planar</li> +<li>Kuratowski and/or Wagner</li> +</ul> +</li> +<li>If no triangles, then relation between q &amp; r (where q unrestricted)</li> +</ul> +<h3 id="list-of-theorems">List of Theorems</h3> +<ol> +<li>Isomorphic if complement is isomorphic</li> +<li>Every tree (with &gt;= 2 vertices) has &gt;=2 leaves</li> +<li>Simple G with n vert, k components, has atleast n-k edges</li> +<li>Characterstics of Tree</li> +<li>If G has walk, G contains path</li> +<li>Every closed odd walk contains odd cycle</li> +<li><strong>Bipartite iff no odd cycle</strong></li> +<li>Kirchoff&rsquo;s Matrix-Tree Thm</li> +<li>Caylay Thm</li> +<li>Euler even degree (and disjoint cycle) thm</li> +<li>Whitney&rsquo;s Thm</li> +<li>Euler&rsquo;s Planar Graph Formula and Thm</li> +<li>Max Planar Graph thms using Girth Formula</li> +<li>Planarity of Graphs - Kuratowski and Wagner Thms</li> +<li>Graph Coloring +<ul> +<li>Simple graph with K-blocks has max chromatic no. of blocks</li> +<li>For any simple graph, max chromatic no. &lt; max degree + 1</li> +<li>Five Color Theorem (Step towards of 4 Color Thm)</li> +</ul> +</li> +</ol> +<h3 id="week-wise-review">Week Wise Review</h3> +<h4 id="week-1">Week 1</h4> +<ul> +<li>Types of Graphs</li> +<li>Graphical Sequence Algorithm</li> +<li>Degree Sum and Edges relation</li> +<li>Neighbourhood (open/close)</li> +<li>k-regular graphs</li> +<li>Isomorphic or not</li> +<li>Subgraphs and Induced Subgraphs</li> +</ul> +<h5 id="types-of-graphs">Types of Graphs</h5> +<ul> +<li>Null</li> +<li>Complete</li> +<li>Bipartite</li> +<li>Complete Bipartite</li> +<li>Cycle</li> +<li>Path</li> +<li>(Graphs n = 1, 2 vertices)</li> +<li>(self-compliment Graphs)</li> +<li>(planar graphs)</li> +</ul> +<h4 id="week-2">Week 2</h4> +<div class="mermaid"> +graph TD +A[Walk] --> B[Trails] +A --> C[Closed Walk] +B --> D[Paths] +B --> E[Circuits] +C --> E +E --> F[Cycle] +</div> +<p>See Examples for each Case!</p> +<ul> +<li> +<p>walk :: anything from start_vertex to end_vertex</p> +</li> +<li> +<p>trail :: edges distinct</p> +</li> +<li> +<p>path :: vertices distinct</p> +</li> +<li> +<p>closed walk :: start_vertex = end_vertex</p> +</li> +<li> +<p>Connectivity, Components</p> +</li> +<li> +<p>Cut-Edge, Cut-Vertex</p> +</li> +<li> +<p>Contraction of graph, minor of a graph (Contraction)</p> +</li> +<li> +<p>Weakly/Strongly Connected</p> +</li> +</ul> +<h5 id="isomorphic-graphs">Isomorphic Graphs</h5> +<div class="mermaid"> +graph LR +A[Degree Sequence] --> B[Degrees of connection of those vertices] +B --> C[Find Points Mapping] +</div> +<ul> +<li>Odd/Even Cycles and/or biparitite</li> +<li>Compliment Isomorphism</li> +</ul> +<h4 id="week-3">Week 3</h4> +<ul> +<li>Trees, Forests (star, path)</li> +<li>Represent arithematical equations graphically</li> +<li>Every tree has k leaves</li> +<li>G contains atleast $E - V + 1$ cycles</li> +<li>Characterstics of Tree (see proof)</li> +<li>distance: shortest u,v path in tree (don&rsquo;t count start!)</li> +<li>eccentricity: max of distance between all u-v path for u</li> +<li>diameter: max of eccentricites of all vertices (farthest two points)</li> +<li>center: point with min eccentricity</li> +<li>radius: min of eccentricities (or eccentricity of center)</li> +<li>rooted trees, ordered rooted trees, parent, child, ancestor, descendants, siblings</li> +<li>Binary trees, Regular binary trees (deg 3 or less)</li> +</ul> +<h4 id="week-4">Week 4</h4> +<ul> +<li>wiring, spanning trees, spanning forests</li> +<li>Three main types of Matrices +<ul> +<li>Adjacency Matrix: (V, V) based and shows no. of edges between each pair of vertices (1 or 0 only for simple graphs)</li> +<li>Incidence Matrix: which edges are incident for each vertex (V, E)</li> +<li>Graph Laplacian: Degree of vertices along diagonal. -1 wherever edge. 0 wherever no edges. See <a href="https://youtu.be/PFE3VMsR2AU"target="_blank" rel="noopener">graph laplacian video</a></li> +</ul> +</li> +<li>Kirchoff&rsquo;s Matrix-Tree Thm</li> +<li>Minimum Cost Spanning Trees, Weight Func</li> +<li>Krusikal and Prim&rsquo;s Min Spanning Tree finding algo</li> +</ul> +<h4 id="week-5">Week 5</h4> +<ul> +<li>Edge Based +<ul> +<li>eulerian trail( <em>n-2 even 2 odd</em> )</li> +<li>eulerian circuit (<em>all even</em>)</li> +<li>eulerian graph (contains eulerian circuit)</li> +</ul> +</li> +<li>Euler-Path finding algorithm (and proof of even degree)</li> +<li>Fleury&rsquo;s Algo</li> +<li>Hamiltonian path, hamiltonian graph, sufficient conditions for hamiltonian graph</li> +</ul> +<p><em>Hamiltonian Cycle is just another way of saying subgraph Cn!</em></p> +<ul> +<li>Hamiltonian closure and finding hamiltonian graphs</li> +<li>TSP1 and TSP2 graph algos</li> +</ul> +<h4 id="week-6">Week 6</h4> +<ul> +<li>Connectivity, edge cuts, k-edge-connected(returns bool), edge-connectivity (returns int connectivity)</li> +<li>Vertex Connectivity, Vertex-Cut Set, min degree, max degree</li> +<li>Whitney&rsquo;s Thm</li> +</ul> +<h4 id="network-flows-and-related-topics-week-before-midsem">Network Flows and Related Topics (Week before Midsem)</h4> +<ul> +<li>Flow - flow, capacity, source, sink</li> +<li>Maximum Flow Problem :: Ford-Fulkerson Algo, Residual Graph, Augmented Paths</li> +<li>Min Cut Problem :: S-T cut, Cap(A, B), Cut where Residual Graph paths end</li> +<li>Flow value Lemma (same as out of source)</li> +<li>Max-Flow Min-Cut Thm +$$ val(f) = \sum*{out\ of\ a} f(e) - \sum*{in\ to\ a} f(e) = \sum_{out\ of\ a} f(e) = cap(A, B)$$</li> +<li>Disjoint Paths - Ford-Fulkerson with capacities all 1</li> +<li>Menger&rsquo;s Thm - Min no. of vertices required to be removed to disconnect u-v path</li> +<li>k-connected k-vertex disjoint paths</li> +</ul> +<h6 id="blocks-and-block-diagrams">Blocks and Block Diagrams</h6> +<div class="mermaid"> +graph TD +A[Find all cut vertices] --> B[Mark out Blocks such that one not contained in other] +B --> C[Draw Graph with block dots and cut vertex dots] +</div> +<h4 id="week-7">Week 7</h4> +<ul> +<li>Planar Graphs, Planar Embeddings</li> +<li>Planar Drawing</li> +<li>Face, Boundary</li> +<li>Euler&rsquo;s Graph Formula p - q + r = 2</li> +<li>Maximal Planar Graphs and Girth Formula +$$ \frac{g(n-2)}{g-2}$$</li> +<li>Homeomorphic and Subdivisions</li> +<li>Kuratowski and Wagner Thms</li> +<li>Duality / Dual Plane</li> +<li>Crossing Number</li> +</ul> +<h6 id="kuratowskiwagner-thm">Kuratowski/Wagner Thm</h6> +<div class="mermaid"> +graph LR; +A[Indentify partition of vertices] --> B[Delete Edges to trim down to Bipartite]; +</div> +<h4 id="week-8">Week 8</h4> +<ul> +<li>Chromatic Number of Graph, k-colorable</li> +<li>Chromatic No. of Blocks thm and max degree + 1 thms</li> +<li>Booke&rsquo;s Thm Neither Complete nor odd cycle &lt; max degree</li> +<li>5 Color Thm (Towards 4-color)</li> +<li>Edge Chromatic No. and Thm for Bipartite graphs and simple graph</li> +</ul> +<h4 id="graph-numbers-and-their-relations">Graph Numbers and their relations</h4> \ No newline at end of file diff --git a/tags/graphs/index.xml b/tags/graphs/index.xml index 122d406..44e1d22 100644 --- a/tags/graphs/index.xml +++ b/tags/graphs/index.xml @@ -1,4 +1,180 @@ -Graphs on Futuristic ideashttps://cheese-cracker.github.io/tags/graphs/Recent content in Graphs on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Graphs on Futuristic ideashttps://cheese-cracker.github.io/tags/graphs/Recent content in Graphs on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 01 Oct 2020 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/index.html b/tags/index.html index 28d4e65..5a5ed9e 100644 --- a/tags/index.html +++ b/tags/index.html @@ -3,5 +3,5 @@ -

Tags

Tags

\ No newline at end of file diff --git a/tags/index.xml b/tags/index.xml index d2791a8..9848501 100644 --- a/tags/index.xml +++ b/tags/index.xml @@ -1,4 +1,180 @@ -Tags on Futuristic ideashttps://cheese-cracker.github.io/tags/Recent content in Tags on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Tags on Futuristic ideashttps://cheese-cracker.github.io/tags/Recent content in Tags on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/index/index.xml b/tags/index/index.xml index d9dbf7f..2c61974 100644 --- a/tags/index/index.xml +++ b/tags/index/index.xml @@ -1,4 +1,180 @@ -Index on Futuristic ideashttps://cheese-cracker.github.io/tags/index/Recent content in Index on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Index on Futuristic ideashttps://cheese-cracker.github.io/tags/index/Recent content in Index on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/markets/index.html b/tags/markets/index.html new file mode 100644 index 0000000..0fa7fb1 --- /dev/null +++ b/tags/markets/index.html @@ -0,0 +1,7 @@ +Markets – Futuristic ideas +

Markets

\ No newline at end of file diff --git a/tags/markets/index.xml b/tags/markets/index.xml new file mode 100644 index 0000000..a9874f7 --- /dev/null +++ b/tags/markets/index.xml @@ -0,0 +1,2547 @@ +Markets on Futuristic ideashttps://cheese-cracker.github.io/tags/markets/Recent content in Markets on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +<p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. +In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/DvsC.jpg"> </img> +<p><small> Poster originally by mathbytori.blogspot.com </small></p> +</div> +<blockquote> +<p>Throughout this post, the terms &lsquo;discrete&rsquo; and &lsquo;continuous&rsquo; are somewhat loosely defined.</p> +</blockquote> +<p>A simple intuition on continuous and discrete would give us,</p> +<table> +<thead> +<tr> +<th style="text-align:center">Discrete</th> +<th style="text-align:center">Continuous</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:center">Distinct, seperate and countable</td> +<td style="text-align:center">Fluid, mostly singular</td> +</tr> +<tr> +<td style="text-align:center">Dotted Line</td> +<td style="text-align:center">Normal straight Line</td> +</tr> +<tr> +<td style="text-align:center">Scattered</td> +<td style="text-align:center">Unionized</td> +</tr> +<tr> +<td style="text-align:center">Set of Integers $Z$: Distinct points on the number line</td> +<td style="text-align:center">Set of Real Numbers $\Re$: Continuous line on the number line</td> +</tr> +<tr> +<td style="text-align:center">Sets not dense <small>(in any metric space)</small></td> +<td style="text-align:center">Set is dense <small>(in any metric space)</small></td> +</tr> +<tr> +<td style="text-align:center">Non-seperable Metric Space<small>(like discrete metric space)</small></td> +<td style="text-align:center">Seperable Metric Space</td> +</tr> +<tr> +<td style="text-align:center">Discrete Probability Distribution</td> +<td style="text-align:center">Continuous Probability Distributions</td> +</tr> +<tr> +<td style="text-align:center">Histograms</td> +<td style="text-align:center">Kernel Density Estimates</td> +</tr> +<tr> +<td style="text-align:center">Digital Image Processing</td> +<td style="text-align:center">Analog Image Processing</td> +</tr> +<tr> +<td style="text-align:center">Discrete Delaunay Triangulations</td> +<td style="text-align:center">Continuous Voronoi Diagrams</td> +</tr> +<tr> +<td style="text-align:center">Discrete Time Signals</td> +<td style="text-align:center">Continuous Time Signals</td> +</tr> +<tr> +<td style="text-align:center">Sum of many discrete rectangles</td> +<td style="text-align:center">Area under a continuous curve</td> +</tr> +<tr> +<td style="text-align:center">Discrete Factorials</td> +<td style="text-align:center">Continuous Gamma Function</td> +</tr> +<tr> +<td style="text-align:center">Discrete Transforms</td> +<td style="text-align:center">Continuous Transforms</td> +</tr> +<tr> +<td style="text-align:center">Discrete Recurrence Relations</td> +<td style="text-align:center">Continuous Differential Equations</td> +</tr> +</tbody> +</table> +<blockquote> +<p>A common trend to notice is that <strong>discrete</strong> things tend to take a <strong>finite or countable</strong> set of values.</p> +</blockquote> +<hr> +<h2 id="discrete-signals-vs-continuous-signals">Discrete Signals Vs Continuous Signals</h2> +<p>Moving to more concrete definitions, +Let us take the example of Continuous vs Discrete in the context of Signals. +This divides us into four parts shown below,</p> +<div align="center"> +<img height="400" src="https://cheese-cracker.github.io/plots/des/4SignalDiagram.jpg" alt="Four Divisions of Signals"> </img> +<p><small> Clockwise: CT Analog, CT Digital, DT Digital, DT Analog</small></p> +</div> +<p>The differentiating factors are,</p> +<ul> +<li>Discrete time (DT) Vs Continuous time (CT)</li> +<li>Analog signal Vs Digital signal</li> +</ul> +<p>Here, digital signal and analog signals are both continuous in time but the +CT digital signal has only a discrete set of values for the ouput $y(t)$.</p> +<blockquote> +<p>In this post, the ideas of &lsquo;digital&rsquo; and &lsquo;discrete&rsquo; may be mixed because &lsquo;digital&rsquo; signals are still discrete in the y-axis.</p> +</blockquote> +<hr> +<h2 id="area-under-a-continuous-curve-vs-sum-of-many-discrete-rectangles">Area under a Continuous Curve Vs Sum of many Discrete Rectangles</h2> +<p>Considering the area under the curve for any continuous function $y(t)$, +the area is given by $\int_{t_0}^{t_n} y(t)$</p> +<p>However, if we consider the digital equivalent of this function (by quantizing the input), the area under the curve can just be the sum of distinct rectangles.</p> +<p>So we get, +$\int_{t_0}^{t_n} y(t) = \sum_{i=0}^{n-1} y(t_i)$.</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/MidRiemann2.svg"> </img> +<p><small> Wikipedia: Riemann Sum (taking midpoints)</small></p> +</div> +<p>Taking the value at each midpoints and summing the rectangles we get, +$$\int \limits_a^b m(x)dx = \lim_{n \rightarrow \infty} \frac{|b - a|}{n} \sum_{k = 1}^{n} m(a + k \frac{|b - a|}{2n})$$ +So, as we make the partition intervals smaller ($\lim_{n \rightarrow \infty} \frac{1}{n}$), this sum becomes closer to the actual integral.</p> +<blockquote> +<p>A <a href="https://en.wikipedia.org/wiki/Quantization_%28signal_processing%29#Mid-riser_and_mid-tread_uniform_quantizers"target="_blank" rel="noopener">mid-riser or mid-tread quantizer</a> in signal processing, would be analogous to a Riemann sum except for one point. The quantizer divides the signal $y(t)$ into discrete bins (and reconstructs). However, the riemann sum would divide the input $t$ into discrete bins.</p> +</blockquote> +<div align="center"> +<img src="https://cheese-cracker.github.io/plots/des/QuantizationLevels4.png"> </img> +<p><small> Wikipedia: Quantization of Signal with 4 Levels</small></p> +</div> +<p>Instead of partitioning the continuous function into <strong>rectangles</strong>, we could take the function values at two points and break it into <strong>trapezoids</strong>. (Trapezoidal Rule)</p> +<div align="center"> +<img height="300" src="https://cheese-cracker.github.io/plots/des/TrapRiemann2.png"> </img> +<p><small> Wikipedia: Trapezoidal Rule </small></p> +</div> +<p>Similarly, we can approximate with even more function points to get the other <a href="https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas"target="_blank" rel="noopener">Newton Cotes Formulas</a>.</p> +<p>So, all these summations functions are approximations to integrations (each with a same or faster convergence).</p> +<hr> +<h2 id="discrete-factorials-vs-continuous-gamma-function">Discrete Factorials Vs Continuous Gamma Function</h2> +<p>Considering another seqn of numbers, +$$1, 1, 2, 6, 24, 120, 720 &hellip;$$ +Can you guess the sequence?</p> +<p>For any given sequence in $N$, there will always be infinitely many continuous functions in $\Re$, that satisfy the sequence.</p> +<p>But one special function that represents this is the <strong>gamma</strong> function, +$$ \Gamma(z) = \int_0^{\infty} x^{z-1} e^{-x}dx$$</p> +<p>Here, +$$ \Gamma (n + 1) = n!$$ +thus captures the <strong>factorial function</strong>.</p> +<p>(Note that however the gamma function is continuous only in $\Re^{+}$.)</p> +<p>For many sequences which are a discrete recurrence relation, a continuous generating function can be also found.</p> +<hr> +<h2 id="discrete-vs-continuous---fourier-like-transforms">Discrete Vs Continuous - Fourier-Like Transforms</h2> +<p>Another interesting and useful concept when dealing with signal processing, is the <strong>fourier transforms</strong>. +It is a very essential way to transfer a random signal (think square, triangular, wavy, crazy or any time-based oscillation) +into a mixture of sine ways of different frequencies. +3blue1brown has an amazing <a href="https://odysee.com/@3Blue1Brown:b/but-what-is-the-fourier-transform-a:b"target="_blank" rel="noopener">visual introduction to the fourier transform</a>.</p> +<p>When considering fourier transforms, there are numerous generalization for different signals. +The types of transform depends on the 4 differentiating factors,</p> +<ol> +<li>Discrete Signal or Continuous Signal</li> +<li>Periodic Signal or Aperiodic (Infinite Period) Signal</li> +<li>Transform or Inverse Transform (Analysis or Synthesis)</li> +<li>Imaginary exponent Vs Complex(re + im) exponent in equation</li> +</ol> +<p>Considering the <strong>normal transform in real domain</strong>, varying points <strong>1</strong> and <strong>2</strong>, we get the following table,</p> +<div align="center"> +<img height="250" src="https://cheese-cracker.github.io/plots/des/SeriesVsTransform.png"> </img> +<p><small> Fourier Series Vs Fourier Transform</small></p> +</div> +<p>Similar to the CTFT and DTFT, there is also inverse CTFT and inverse DTFT. +This <a href="https://medium.com/sho-jp/fourier-transform-101-part-4-discrete-fourier-transform-8fc3fbb763f3"target="_blank" rel="noopener">article</a> has a nice table,</p> +<div align="center"> +<img height="500" src="https://cheese-cracker.github.io/plots/des/Medium-FT.jpeg"> </img> +<p><small> Medium: Fourier Transform Table</small></p> +<p><small>&lsquo;Complex Fourier Series&rsquo; is the same as &lsquo;Continuous Time Fourier Series&rsquo;</small></p> +</div> +<p>Switching the last parameter <strong>4</strong> from purely imaginary to complex exponents, give us +two new transforms -</p> +<ul> +<li>Laplace Transform (Continuous Domain)</li> +<li>Z - Transform (Discrete Domain)</li> +</ul> +<blockquote> +<p>In the transforms, the real component gives us the $e^x$ curves and the complex exponent gives us the $e^{ix} = cos(x) + isin(x)$ curves.</p> +</blockquote> +<h4 id="an-ugly-inconsistency">An ugly inconsistency</h4> +<p>Considering the laplace transform to be, +$$ X(s) = \int_{-\infty}^{\infty} x(t) e^{-st} dt $$ +An intuitive definition of Z-transform would be, +$$ X(z) = \sum_{-\infty}^{\infty} x[n] e^{-zn} $$ +where z just like s would be defined by $z = \sigma + i\omega$</p> +<p>Unfortunately, due to ease of usage in digital signal processing the definition of z-transform was made rather unintuitive. +Hence, it is given by, +$$X(z) = \sum_{-\infty}^{\infty} x[n] z^{n} $$ +where $z = e^{sT}$ (instead of $z=sT$)</p> +<p>From this we see the mapping,</p> +<p><strong>$j\omega$ axis for the Laplace transform $=$ unit circle for the Z transform</strong></p> +<p>See <a href="https://dsp.stackexchange.com/questions/72140/why-not-use-the-same-standard-exponentials-for-both-continuous-and-discrete-ti/72143#72143"target="_blank" rel="noopener">this thread</a> to know more. +Another <a href="https://math.stackexchange.com/questions/3169159/why-define-the-z-transform-differently-from-the-laplace-transform"target="_blank" rel="noopener">stackexchange thread</a>, also points out why the laplace transform cannot be defined the other way around.</p> +<hr> +<h2 id="discrete-recurrence-relations-vs-continuous-differential-equations">Discrete Recurrence Relations Vs Continuous Differential Equations</h2> +<p>Consider two alien species in two different planets with no natural predators +and sufficient resources to grow.</p> +<ol> +<li>The first alien species breeds naturally with its growth twice its current population (population growth rate 200%).</li> +<li>The second alien species reproduces using binary fission. So, one alien essentially splits into two new alien creatures. And all the alien species undergoes this binary fission every new years&rsquo; eve.</li> +</ol> +<p>Both these cases could be modelled as,</p> +<ol> +<li>$y&rsquo; = 2y$ where $y$ is the population, and $y&rsquo;$ is it&rsquo;s derivative (the population growth rate).</li> +<li>$a_n = 2 a_{n-1}$ where $a_n$ is the population in year $n$</li> +</ol> +<p>Notice that in case of <strong>alien species no. 1</strong> we are modelling it as a <strong>continuous differential equation</strong> whereas in the case of <strong>alien species no. 2</strong> we are modelling it as a <strong>discrete recurrence relation</strong>.</p> +<p>In case of alien species no. 1, +we have to solve the differential equation which gives us, +$$y = a_0 e^{2t}$$ +where $a_0$ is a constant representing the original population of aliens.</p> +<p>So if there where 1 million aliens, originally, +there would $e^2 \approx 7.34$ million aliens after just one year.</p> +<p>For alien species no. 2, +it is relatively straightforward to see that a population of 1 million aliens would be 2 million after the first year.</p> +<p>It is also intuitive to notice that after any $n$ years the solution to this is, +$$ a_n = a_0 2^n $$</p> +<p>This similarity between the population growth equations can be seen better by modelling the recurrence relation as an diferential equation.</p> +<p>Consider the population after 3 years, it is 4 times the population after year 1 so,</p> +<p>$$a_3 = 2 * ( 2 * a_1 )$$ +$$a_3 - a_1 = (2^2 - 1) a_1$$</p> +<p>So from this we could say for any general points a_{n+k} and a_n,</p> +<p>$$ \Delta y \approx \Delta a_n = a_{n + k} - a_n = (2^k - 1) * a_n $$ +$$ \Delta t \approx \Delta n = (n + k) - n = k $$</p> +<p>$$ \lim_{\Delta n \rightarrow 0} \frac{\Delta a_n}{\Delta n} = \lim_{\Delta k \rightarrow 0 } \frac{(2^k - 1) * a_n}{k}$$</p> +<p>Taking derivative on both numerator and denominator with the <a href="https://en.wikipedia.org/wiki/L%27H%C3%B4pital%27s_rule"target="_blank" rel="noopener">El &lsquo;Hospital&rsquo; rule</a>,</p> +<p>$$ \lim_{\Delta n \rightarrow 0} \frac{\Delta a_n}{ \Delta n} = ln(2) a_n $$</p> +<p>Modelling $a_n$ as $y$ and $n$ as $t$ we have,</p> +<p>$$ y&rsquo; = ln(2) y $$ +$$ y = a_0 e^{ln(2) t} = a_0 2^t $$</p> +<p>Or better expressed as,</p> +<p>$$ a_n = a_0 2^n $$</p> +<p>Another way to look at the two alien species is that,</p> +<ol> +<li>The 1st alien species is a 100% compound interest which is <a href="https://en.wikipedia.org/wiki/Compound_interest#Continuous_compounding"target="_blank" rel="noopener">continuous compounded</a>.</li> +<li>The 2nd alien species is a 100% compound interest which is compounded annually.</li> +</ol> +<p>Note that instead if we take any other coeffecient too this would work!</p> +<h4 id="for-2nd-order-and-above">For 2nd Order and above</h4> +<p>It also works similarly for second order differential equations and second order recurrence relations. +The technique to solve 2nd order ODE and 2nd order RR are the same,</p> +<ol> +<li>Put the solution as $y = C_0 e^{rt}$ or $a_n = \alpha^n = e^{ln(\alpha)n}$</li> +<li>Solve the quadratic equation or &ldquo;characteristic equation&rdquo; that transpires to get the general solution</li> +<li>Find the particular solution, this could be with the help of specific boundary conditions etc. and combine.</li> +</ol> +<p>Without getting into too much detail, +For the general solution of 2nd order ODE with distinct roots, +$$ y = C_1 e^{r_1 t} + C_2 e^{r_2 t}$$ +and for repeated root, +$$ y = C_1 e^{r_1 t} + C_2 t e^{r_2 t}$$</p> +<p>For the general solution of a 2nd order recurrence relation with distinct roots, +$$ y = C_1 r_1^n + C_2 r_2^n = C_1 e^{ln(r_1) n} + C_2 e^{ln(r_2) n}$$ +and for repeated root, +$$ y = C_1 r_1^n + C_2 n r_2^n = C_1 e^{ln(r_1) n} + C_2 n e^{ln(r_2) n}$$</p> +<h2 id="other-interesting-references">Other Interesting References</h2> +<ul> +<li>Can&rsquo;t find a <a href="https://math.stackexchange.com/questions/126803/generating-function-for-the-factorial-sequence"target="_blank" rel="noopener">generating function for factorials</a></li> +<li>A <a href="http://philsci-archive.pitt.edu/4692/1/AnalogDigitalContinuousDiscrete.pdf"target="_blank" rel="noopener">philosophical and cognitive science view</a> of analog, digital, continuous and discrete.</li> +<li><a href="https://medium.com/greyatom/baby-steps-of-statistics-part-1-c76bafb30288"target="_blank" rel="noopener">Baby Steps of Statistics</a></li> +<li><a href="https://medium.com/sho-jp/fourier-transform-101-part-4-discrete-fourier-transform-8fc3fbb763f3"target="_blank" rel="noopener">Fourier Transforms 101</a></li> +<li>For mental models in other domains, refer <a href="https://fs.blog/mental-models/"target="_blank" rel="noopener">Farnam Street Blog</a> or <a href="https://www.goodreads.com/book/show/41181911-super-thinking"target="_blank" rel="noopener">Super Thinking Book</a></li> +<li>Try to find an anology for discrete vs continuous, with separable and non-separable spaces. Good Resources: <a href="https://en.wikipedia.org/wiki/Separable_space"target="_blank" rel="noopener">Separable Spaces</a>, <a href="https://math.stackexchange.com/questions/3946786/example-of-non-separable-subspace-of-a-separable-hausdorff-space"target="_blank" rel="noopener">Discrete-like non-separable subspaces in separable spaces</a>, <a href="https://topology.jdabbs.com/properties"target="_blank" rel="noopener">Database of Topological Counterexamples</a></li> +</ul>Computational Geometryhttps://cheese-cracker.github.io/posts/compgeom/Thu, 01 Oct 2020 00:00:00 +0000https://cheese-cracker.github.io/posts/compgeom/<h2 id="key-resources">Key Resources</h2> +<ol> +<li>Textbook: Computational Geometry - Algorithms and Applications</li> +<li><a href="https://www.coursera.org/learn/computational-geometry"target="_blank" rel="noopener">Coursera Course</a>: For the Problemset and Implementations (Till Part 5)</li> +<li><a href="https://www.youtube.com/channel/UCuAzKw_VngkAsQh7ummYq0A/playlists?view=50&amp;shelf_id=1"target="_blank" rel="noopener">Philipp Kindermann</a>&rsquo;s Lectures Series (Part 6 and Onwards)</li> +<li>Various Random Resources found on the internet! +<ul> +<li><a href="https://geomalgorithms.com/"target="_blank" rel="noopener">Geom Algorithms</a></li> +<li><a href="https://cp-algorithms.com/"target="_blank" rel="noopener">CP Algorithms</a></li> +</ul> +</li> +</ol> +<h4 id="further-reading--interesting-resources">Further Reading / Interesting Resources</h4> +<ul> +<li><a href="https://observablehq.com/@mbostock/to-infinity-and-back-again?collection=@observablehq/algorithms"target="_blank" rel="noopener">ObservableHQ - Infinity and Back Again</a>: Voronoi Diagrams for Infinite Polygons</li> +<li>Book: Foundations of Multidimensional and Metric Data Structures - Hanen Samet (2006)</li> +<li><a href="https://www.youtube.com/playlist?list=PL8FaHk7qbOD4F7nPFfgD0dGdLos1uhUPg"target="_blank" rel="noopener">Josh Hug&rsquo;s Lectures on Multidimensional Data</a>: Good intuition on k-d trees and quad trees.</li> +<li><a href="https://www.wias-berlin.de/software/tetgen/features.html"target="_blank" rel="noopener">TestGen</a>: Voronoi Diagrams and Delaunay Tetrahedralizations for 3D Points. Software</li> +<li><a href="https://flylib.com/books/en/2.587.1.38/1/"target="_blank" rel="noopener">Generalization of Voronoi Diagrams</a>: Originally from a book on (Geometric Data Structures for Computer Graphics, 2005)</li> +</ul> +<h2 id="overview">Overview</h2> +<p>To learn computational geometry, these are the steps/resources I used,</p> +<ol> +<li>Week 1 - Week 5: Coursera - Computational Geometry +<ul> +<li>For theory, read from book and/or random resources off the internet. Philipp&rsquo;s lectures are also available for this.</li> +<li>Focus on the problemset for the course.</li> +<li>Recommended Prerequisite: Good understanding and practice of DSA. Some of the problems have tons of edge cases!</li> +</ul> +</li> +<li>Week 6 - Week 10: Philipp Kindermann&rsquo;s Lecture Series +<ul> +<li>This part is more theory oriented and covers Voronoi Diagrams, Delaunay Triangulations too.</li> +<li>Again some parts can be followed up from the book as well.</li> +<li>Recommended Prerequisite: Basic graph theory (maximal planar graph, duals), basic DSA (analyzing time complexity)</li> +</ul> +</li> +</ol> +<h5 id="general-implementation-aspects">General Implementation Aspects</h5> +<ul> +<li>Use slope pairs</li> +<li>Triangle orientation check (sign of area)</li> +<li>Sum of area of triangles to form interior</li> +<li>Ray out of a point inside intersects polygon odd times</li> +<li>Check line segment intersections by checking orientation of each of the four points (not two!)</li> +<li>It also helps to plot sample testcases for debugging</li> +<li>Modulo to cyclicly iterate through points of a Polygon</li> +<li>Carefully inspect, input/output format as well as edge cases</li> +</ul> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// My Header - (Used mostly STL instead of OOP) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#ff79c6">#define ll long long +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6">#define x first +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6">#define y second +</span></span></span><span style="display:flex;"><span><span style="color:#ff79c6"></span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;</span> vertex; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;</span> point; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">typedef</span> pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> ppoint; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ppoint INF_POINT <span style="color:#ff79c6">=</span> {<span style="color:#bd93f9">2e9</span>, <span style="color:#bd93f9">2e9</span>}; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> <span style="color:#8be9fd">double</span> EPS <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">1e-16</span>; +</span></span></code></pre></div><h2 id="week-1">Week 1</h2> +<p>1. Point and Vector (Triangle Sign Check)</p> +<p>This will be used in most future problems as well. The most generalized template is below. Note that <code>area</code> is actually twice the actual area.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">int</span> <span style="color:#50fa7b">trisign</span>(ppoint a, ppoint b, ppoint pt){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> area <span style="color:#ff79c6">=</span> a.x <span style="color:#ff79c6">*</span> b.y <span style="color:#ff79c6">+</span> b.x <span style="color:#ff79c6">*</span> pt.y <span style="color:#ff79c6">+</span> pt.x <span style="color:#ff79c6">*</span> a.y <span style="color:#ff79c6">-</span> a.y <span style="color:#ff79c6">*</span> b.x <span style="color:#ff79c6">-</span> b.y <span style="color:#ff79c6">*</span> pt.x <span style="color:#ff79c6">-</span> pt.y <span style="color:#ff79c6">*</span> a.x; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(area <span style="color:#ff79c6">&gt;</span> EPS){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span> <span style="color:#ff79c6">if</span>(area <span style="color:#ff79c6">&lt;</span> <span style="color:#ff79c6">-</span>EPS){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>2. Point in Triangle</p> +<p>Principle is the sum of the 3 individual triangles (2 vertices, 1 point) would be equal to total area (3 vertices).</p> +<p>3. Point in Polygon</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/point_in_polygon_ray.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/point_in_polygon_ray.jpg" width="auto" height="auto" +alt="Point in Polygon with ray from infinity"/></a></p> +<ul> +<li>Take ray from point to infinity</li> +<li>Check intersection with each line segment O(N)</li> +<li>Parity of the number of intersection determine inside(odd) or outside(even)</li> +<li>Ignore if line segment coincides with the ray.</li> +</ul> +<p>This is used again in future problems like 4-1/4-2. +Draw a ray from <code>P</code> to <code>INF_POINT</code>. Check the if the no. of intersections are odd or even. +Make sure an endpoint is not counted twice - that&rsquo;s why <strong>semi-open interval</strong> is checked (<code>semi_check_intersect</code>).</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">inbetween</span>(ppoint a, ppoint midd, ppoint b){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> minx <span style="color:#ff79c6">=</span> min(a.x, b.x); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> miny <span style="color:#ff79c6">=</span> min(a.y, b.y); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> maxx <span style="color:#ff79c6">=</span> max(a.x, b.x); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">double</span> maxy <span style="color:#ff79c6">=</span> max(a.y, b.y); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> (minx <span style="color:#ff79c6">&lt;=</span> midd.x <span style="color:#ff79c6">&amp;&amp;</span> midd.x <span style="color:#ff79c6">&lt;=</span> maxx) <span style="color:#ff79c6">&amp;&amp;</span> (miny <span style="color:#ff79c6">&lt;=</span> midd.y <span style="color:#ff79c6">&amp;&amp;</span> midd.y <span style="color:#ff79c6">&lt;=</span> maxy); +</span></span><span style="display:flex;"><span>} +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Only check semi-interval [s1, s2) intersection [d1, d2] +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">semi_check_intersect</span>(ppoint d1, ppoint d2, ppoint s1, ppoint s2){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> s1_side <span style="color:#ff79c6">=</span> trisign(d1, d2, s1); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> s2_side <span style="color:#ff79c6">=</span> trisign(d1, d2, s2); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> d1_side <span style="color:#ff79c6">=</span> trisign(s1, s2, d1); +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> d2_side <span style="color:#ff79c6">=</span> trisign(s1, s2, d2); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(s1_side<span style="color:#ff79c6">*</span>s2_side <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">0</span> <span style="color:#ff79c6">&amp;&amp;</span> d1_side<span style="color:#ff79c6">*</span>d2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// If segment lies completely inside we can ignore it; So check if strictly only s1 is present +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">return</span> (inbetween(d1, s1, d2) <span style="color:#ff79c6">&amp;&amp;</span> <span style="color:#ff79c6">!</span>inbetween(d1, s2, d2)); +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span> <span style="color:#ff79c6">if</span>(s1_side<span style="color:#ff79c6">*</span>s2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span> <span style="color:#ff79c6">&amp;&amp;</span> d1_side <span style="color:#ff79c6">*</span> d2_side <span style="color:#ff79c6">&lt;=</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span>} +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">point_in_polygon</span>(vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;&amp;</span> poly, pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> p){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> ray_intersects <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> k <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; k <span style="color:#ff79c6">&lt;</span> n; <span style="color:#ff79c6">++</span>k){ +</span></span><span style="display:flex;"><span> ray_intersects <span style="color:#ff79c6">+=</span> semi_check_intersect(p, INF_POINT, poly[k], poly[(k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n]); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(ray_intersects <span style="color:#ff79c6">%</span> <span style="color:#bd93f9">2</span> <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">0</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>4. Points in Convex Polygon</p> +<p>The steps I used were as follows -</p> +<ul> +<li>Get Centroid: Choose 3 non-colinear points (<code>trisign</code>)</li> +<li>Sort by Angle: Array of pairs <code>slope_pairs</code> which stores <code>{atan2(points[i].y - centroid.y, points[i].x - centroid.x), i}</code> and then sort.</li> +<li>Binary Search by Angle (Helper Function): <code>pair&lt;ll, ll&gt; binsearch_angle(vector&lt;pair&lt;double,ll&gt;&gt;&amp; angle_pair, double angle_val)</code> gives the pair of indices of the two vertices.</li> +<li>Check in triangle: Use the previous part to check if point in the triangle given by <code>binsearch_angle</code></li> +</ul> +<h2 id="week-2">Week 2</h2> +<ul> +<li> +<p>Convex Hull Algorithms</p> +<ul> +<li> +<p>Graham Scan</p> +<ol> +<li>Initialize a pair of points in S</li> +<li>Add new point</li> +<li>Check if orientation of (n-2)nd point with ((n-3)rd, nth) point is left(ccw)/right(cw) (and 0)</li> +<li>Else pop the 2nd last point</li> +</ol> +</li> +<li> +<p>Andrew&rsquo;s (Preferred - NlogN for sort)</p> +<ol> +<li>Take line (leftmost or minx) point &amp; (rightmost or maxx) point</li> +<li>Sort Points in x-coords</li> +<li>Partition all other points (by orientation) into Lower or Upper according to below/above the partition line. (stable or resort)</li> +<li>Run Graham Scan and pop 2nd last element if right(for Upper Partition) or left(for Lower Partition)</li> +</ol> +</li> +</ul> +<p>Points to Note: - Andrew&rsquo;s Scan can also be thought similar to a sweep line - At every event point(p) check orientation of last point in S(n) wrt to S(n-1) and p - Convex Hull can also be used for other polygons (see Unit Circle&rsquo;s questions)</p> +<ul> +<li>Jarvis March +<ol> +<li>Take lowest point in H</li> +<li>Take 2nd point with smallest polar angle in H</li> +<li>Take last (n-1) and (n-2) points as line</li> +<li>Find smallest polar angle point wrt. this line</li> +<li>Repeat till 1st point is found</li> +</ol> +</li> +</ul> +</li> +</ul> +<p>1. Convex Polygon Check</p> +<p>Check if polygon is convex. Stable Partition points to upper part and lower part (like Modified Graham&rsquo;s). +Check (<code>convex_check</code>) if all Up points have no lefts. Check again if all Down points have no rights.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">bool</span> <span style="color:#50fa7b">convex_check</span>(vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;&gt;&amp;</span> points, <span style="color:#8be9fd">int</span> invsign){ +</span></span><span style="display:flex;"><span> ll sz <span style="color:#ff79c6">=</span> points.size(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> i <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; i <span style="color:#ff79c6">&lt;</span> sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">2</span>; <span style="color:#ff79c6">++</span>i){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// NO Left(&gt;0) if Down, NO Right(&lt;0) if Up +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(trisign(points[i], points[i<span style="color:#ff79c6">+</span><span style="color:#bd93f9">2</span>], points[i<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>]) <span style="color:#ff79c6">==</span> invsign){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> <span style="color:#bd93f9">1</span>; +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p><code>invsign</code> is an integer which is 1 or -1, depending on lower or upper hull.</p> +<p>2. Convex Hull</p> +<ul> +<li>Convex hull follows similar to the convex hull check.</li> +<li>For each vertex, we check <code>while(hull_size + 1 &gt;= 3)</code></li> +<li>If <code>trisign(hull[hull_size - 2], points[i], hull[hull_size -1])</code> matches our <code>invsign</code> then pop the 2nd last vertex, Or else break out of the <code>while</code> loop to check the next vertex.</li> +<li>Function Header: <code>void construct_convex_hull(vector&lt;pair&lt;ll,ll&gt;&gt;&amp; points, vector&lt;pair&lt;ll,ll&gt;&gt;&amp; hull, int invsign);</code></li> +<li>After <code>construct_convex_hull</code> for both partitions, we zip the upper and lower Hulls. Thus forming the CCW convex hull.</li> +</ul> +<p>3. Tangents to Polygon</p> +<p>See <a href="http://www.geomalgorithms.com/a15-_tangents.html"target="_blank" rel="noopener">geomalgorithms.com</a> for excellent explaination of technique. +As stated, we need sign(left point) != sign(right point) for tangent +In our case to find left and right tangents, we can put a condition like this, inside our loop iterating through each point.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">int</span> signl <span style="color:#ff79c6">=</span> trisign(left_pt, points[i], pt); +</span></span><span style="display:flex;"><span><span style="color:#8be9fd">int</span> signr <span style="color:#ff79c6">=</span> trisign(points[i], right_pt, pt); +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">if</span>(signl <span style="color:#ff79c6">!=</span> signr){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// CCW =&gt; pt lies L/R wrt. leftpt +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(signl <span style="color:#ff79c6">==</span> sign <span style="color:#ff79c6">||</span> signr <span style="color:#ff79c6">==</span> <span style="color:#ff79c6">-</span>sign){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> points[i]; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>where <code>sign</code> is given by whether we want left or right tangent.</p> +<p>4. Union of Convex Hulls</p> +<p>Take any point Z inside Convex Polygon A. If Z is also inside B, sort the points by angle and apply graham scan. If Z is not inside B, remove inner chain and apply Graham&rsquo;s Scan on outer chain. +OR +Just apply Graham&rsquo;s Scan to all the points since both algorithms have worst case, NlogN. +This may however be slightly less optimal. (But it works :-))</p> +<h2 id="week-3">Week 3</h2> +<p>1. 2 Line Segment Intersections</p> +<p>See <a href="https://cp-algorithms.com/geometry/check-segments-intersection.html"target="_blank" rel="noopener">CP Algorithms</a> for technique. +Helper functions for this include, <code>trisign</code>, <code>inbetween</code>, <code>determinant</code> are used. +Remember to check for &lsquo;No Common Points&rsquo; for both determinant = 0 and not. Watch out for corner cases. (Tons of them!)</p> +<p>2. Polygon Intersection</p> +<p>Either Clipping (Sutherland Hodgman) or Line Sweep (Shamos-Hoey) could be used. For clipping, see <a href="https://www.geeksforgeeks.org/polygon-clipping-sutherland-hodgman-algorithm-please-change-bmp-images-jpeg-png/"target="_blank" rel="noopener">G4G</a>. +The Algorithms are as follows,</p> +<ul> +<li> +<p>Sutherland-Hodgman</p> +<ul> +<li>First choose a polygon</li> +<li>Cut out 2nd polygon from first (check orientation at each line and split half-plane)</li> +<li>Go through the vertices of the 2nd polygon and check if next vertices crosses the line or not. ~O(NM) time</li> +<li>Also, for convex + non-convex</li> +</ul> +</li> +<li> +<p>Shamos-Hoey (Sweep-Line Like) - (N + M) vertical lines from vertices - Obtain inner fragment at each line (inner up and inner down) - 4 lists of vertices (upper, lower) - Only for convex + convex</p> +<pre><code>Within the same TC but slightly less optimal, a simpler approach using all the previous functions can be used. +</code></pre> +<p>Simply, find all line segment intersections and check point in polygon for each vertex. +Then just order points cw / ccw by sorting by angle from centroid. +See <a href="https://observablehq.com/@mbostock/sutherland-hodgman-clipping?collection=@observablehq/algorithms"target="_blank" rel="noopener">D3 Mike&rsquo;s ObservableHQ</a> for an awesome visualization.</p> +</li> +</ul> +<p>3. Intersection of Horizontal and Vertical Segments</p> +<p>This is briefly discussed in &lsquo;Competitive Programming Handbook by Antti&rsquo;. +Scan the the edges and classify and store as horizontal/vertical segments. +Store in <code>start</code>, tuples of the form</p> +<ul> +<li><code>{x1, 2, vptr}</code> for vertical segments</li> +<li><code>{xmin, 1, hptr}</code> and <code>{xmax, 3, hptr}</code> for horizontal segments +The operations are 1(Add eventpt), 2(Intersect with vertical), 3(Remove Endpoint). +Sort the <code>start</code> array, and perform a line sweep over it. +Use order-statistic tree (policy-based ds) for the <code>status</code>. (or implement similar RBT using nodes)</li> +</ul> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Horizontal Segment (height) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> hzlevel; +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Vertical Segment (height, range) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll,ll<span style="color:#ff79c6">&gt;&gt;</span> vlevel; +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Starting Point Tuples (xcoord, operation, index) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;&gt;</span> start; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// In operation 2 we check intersects like this, +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>lo <span style="color:#ff79c6">=</span> status.order_of_key(vlevel[ix].first); +</span></span><span style="display:flex;"><span>hi <span style="color:#ff79c6">=</span> status.order_of_key(vlevel[ix].second<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>); +</span></span><span style="display:flex;"><span>intersects <span style="color:#ff79c6">+=</span> hi <span style="color:#ff79c6">-</span> lo; +</span></span></code></pre></div><p>4. Intersection of Set of Segments</p> +<ul> +<li> +<p>Classic Sweep Line for Segment Intersections</p> +<ul> +<li> +<p>Consists (key vars)</p> +<ul> +<li>Event Point +<ul> +<li>Upper (or left) Endpoint of Segment is p (U(p))</li> +<li>Lower Endpoint of Segment is p (L(p))</li> +<li>Intersection/Internal Point of segment is p (C(p))</li> +</ul> +</li> +<li>(Q) Event Queue of found event points</li> +<li>(S) Set of of all Segements (Array)</li> +<li>(T) Set of Status (RB Tree?)</li> +<li>Event Queue set to check if already present?</li> +</ul> +</li> +<li> +<p>FindIntersection(S)</p> +<ul> +<li>Initialize Q and T</li> +<li>Push first U( p ) endpoint (and corresponding line segment/index) in Q</li> +<li>While Q non-empty, HandleEventPoint</li> +</ul> +</li> +<li> +<p>HandleEventPoint(p)</p> +<ul> +<li>Consists of U, L, C</li> +<li>Generate L( p ) and C( p ) from adjacent segments in T</li> +<li>Segments of $L(p) \cup U(p) \cup C(p) \geq 2$ +<ul> +<li>Report intersection p</li> +</ul> +</li> +<li>Delete L( p ) since segment ends</li> +<li>Delete C( p ) to swap (2nd priority to U)</li> +<li>Insert U( p )</li> +<li>Insert Back C( p ) (finish swap)</li> +<li>If there is no U( p ) and no C( p ) +<ul> +<li>FindEventPoints(sl, sr, p) where sl, sr are the adjacent segments of p in T</li> +</ul> +</li> +<li>Else +<ul> +<li>Take leftmost segment of U( p ) union C( p ), ie (topmost priority) as sl</li> +<li>Take left neighbour of sl in T, s1</li> +<li>FindEventPoints(sl, s1, p) // top Segments intersections</li> +<li>Take rightmost segment of $U(p) \cap C(p)$, ie (least priority) as sr</li> +<li>Take right neighbour of sr in T, s2</li> +<li>FindEventPoints(sr, s2, p) // bottom Segments intersections</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Key Features for any Sweep Line</p> +<ul> +<li>Event Point (often coordinate-compressed)</li> +<li>Status Set containing elements important for current event point</li> +<li>Line sweeps across some direction (Obvious!)</li> +</ul> +</li> +</ul> +<p>Unfortunately, I wasn&rsquo;t able to code this one up. However, <a href="https://geomalgorithms.com/a09-_intersect-3.html"target="_blank" rel="noopener">geom algorithms</a> explains with code the approach to doing this.</p> +<h2 id="week-4">Week 4</h2> +<p>1. Diagonals of any Simple Polygon</p> +<p>For diagonals, one technique is to first check if diagonal intersects with any other polygon line segment. +Then check if Point-in-Polygon for the midpoint, to know if it is inside/outside. +So, <code>trisign</code>, <code>inbetween</code>, <code>semi_check_intersect</code>, <code>check_intersect</code> and <code>point_in_polygon</code> are needed. +Note that <code>check_intersect</code> includes endpoints unlike <code>semi_check_intersect</code>.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span>intersect <span style="color:#50fa7b">diagonal_check</span>(vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;&amp;</span> poly, ll i, ll j){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Check Intersections +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> k <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; k <span style="color:#ff79c6">&lt;</span> n; <span style="color:#ff79c6">++</span>k){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(k <span style="color:#ff79c6">==</span> i <span style="color:#ff79c6">||</span> k <span style="color:#ff79c6">==</span> j <span style="color:#ff79c6">||</span> (k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n <span style="color:#ff79c6">==</span> i <span style="color:#ff79c6">||</span> (k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n <span style="color:#ff79c6">==</span> j) <span style="color:#ff79c6">continue</span>; +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> res <span style="color:#ff79c6">=</span> check_intersect(poly[i], poly[j], poly[k], poly[(k<span style="color:#ff79c6">+</span><span style="color:#bd93f9">1</span>)<span style="color:#ff79c6">%</span>n]); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(res <span style="color:#ff79c6">==</span> <span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">return</span> crossing; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Check if Midpoint in polygon. Assumption: diagonal does not intersect +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> pair<span style="color:#ff79c6">&lt;</span><span style="color:#8be9fd">double</span>, <span style="color:#8be9fd">double</span><span style="color:#ff79c6">&gt;</span> midd <span style="color:#ff79c6">=</span> {(poly[i].x <span style="color:#ff79c6">+</span> poly[j].x)<span style="color:#ff79c6">/</span><span style="color:#bd93f9">2.0</span>, (poly[i].y <span style="color:#ff79c6">+</span> poly[j].y)<span style="color:#ff79c6">/</span><span style="color:#bd93f9">2.0</span>}; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(point_in_polygon(poly, midd)){ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> inner; +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">return</span> outer; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>2. Ear-Cutting Algorithm for Triangulation of Convex Polygons</p> +<p>Steps -</p> +<ol> +<li>Preprocess: If for every vertex, adjacent vertices form inner diagonal. Mark as Ear. ~O($N^2$ for diagonal_check)</li> +<li>Start processing ears in-order from a starting vertex (Try to maintain order in which they are checked)</li> +<li>Delete Current Ear Vertex from the polygon (&amp; is_ear) vector. Insert (diagonal with adjacent verts and the pt) as a triangle.</li> +<li>Check if vleft, vright is a ear (~O(N))</li> +<li>Stop when ear-list is empty or polygon has less than 3 vertices (all vertices are done!)</li> +</ol> +<p>Time: $O(N^3)$ (Sum of $N^2$ operations)</p> +<p>After preprocessing the ears in the <code>is_ear</code> array, the algorithm proceeds as follows,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Set start point +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">int</span> st <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">0</span>; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">while</span>(n <span style="color:#ff79c6">&gt;</span> <span style="color:#bd93f9">3</span>){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Start loop at previous triangle endpoint +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> j <span style="color:#ff79c6">=</span> st; j <span style="color:#ff79c6">&lt;</span> st <span style="color:#ff79c6">+</span> n; <span style="color:#ff79c6">++</span>j){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> i <span style="color:#ff79c6">=</span> j <span style="color:#ff79c6">%</span> n; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">if</span>(is_ear[i]){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Find First Ear and Delete +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> vector<span style="color:#ff79c6">&lt;</span>vertex<span style="color:#ff79c6">&gt;</span> res_triangle <span style="color:#ff79c6">=</span> { poly[(i <span style="color:#ff79c6">-</span> <span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n], poly[i], poly[(i <span style="color:#ff79c6">+</span> <span style="color:#bd93f9">1</span>) <span style="color:#ff79c6">%</span> n] }; +</span></span><span style="display:flex;"><span> triangles.pb(res_triangle); +</span></span><span style="display:flex;"><span> is_ear.erase(is_ear.begin() <span style="color:#ff79c6">+</span> i); +</span></span><span style="display:flex;"><span> poly.erase(poly.begin() <span style="color:#ff79c6">+</span> i); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Update Polygon and check ears +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> n <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)poly.size(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Lower Vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> is_ear[(i<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n] <span style="color:#ff79c6">=</span> check_ear(poly, (i<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span> <span style="color:#ff79c6">+</span> n) <span style="color:#ff79c6">%</span> n); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Upper Vertex (new index -&gt; i % n) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> is_ear[i <span style="color:#ff79c6">%</span> n] <span style="color:#ff79c6">=</span> check_ear(poly, i <span style="color:#ff79c6">%</span> n); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Set start of next iteration +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> st <span style="color:#ff79c6">=</span> i; +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">break</span>; +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>Finally, add remaining polygon into <code>triangles</code>. +The <code>check_ear</code> functions checks <code>diagonal_check</code>(from 4-1) on the neighbouring vertices. +It also helps to plot testcases like this,</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/4-2testcase.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/4-2testcase.png" width="auto" height="auto" +alt="Testcase for Polygon triangulations"/></a></p> +<p>3. Monotone Polygon Triangulation</p> +<p>Triangulation of strictly y-monotone polygons. See <a href="http://homepages.math.uic.edu/~jan/mcs481/triangulating.pdf"target="_blank" rel="noopener">MCS481 Slides</a> for a pretty good psuedocode or the Book is also great. +For Diagonal check part, time complexity would be high therefore it is better to use Concavity Check with <code>trisign</code> instead. Remember to add diagonals from last (lowermost) vertex also. <code>sidemap</code> is used to store Left/Right and <code>vertex</code> is the merged sorted vertex list.</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">triangulate_monotone</span>(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;&amp;</span> verts, map<span style="color:#ff79c6">&lt;</span>point, <span style="color:#8be9fd">bool</span><span style="color:#ff79c6">&gt;</span> sidemap, vector<span style="color:#ff79c6">&lt;</span>polygon<span style="color:#ff79c6">&gt;&amp;</span> diags){ +</span></span><span style="display:flex;"><span> <span style="color:#8be9fd">int</span> sz <span style="color:#ff79c6">=</span> (<span style="color:#8be9fd">int</span>)verts.size(); +</span></span><span style="display:flex;"><span> deque<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span> rack <span style="color:#ff79c6">=</span> {verts[<span style="color:#bd93f9">0</span>], verts[<span style="color:#bd93f9">1</span>]}; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#8be9fd">int</span> j <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">2</span>; j <span style="color:#ff79c6">&lt;</span> sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>; <span style="color:#ff79c6">++</span>j){ +</span></span><span style="display:flex;"><span> point vlast <span style="color:#ff79c6">=</span> rack.back(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Process Vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">if</span>(sidemap[verts[j]] <span style="color:#ff79c6">!=</span> sidemap[rack.back()]){ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Opposite Sides +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">while</span>((<span style="color:#8be9fd">int</span>)rack.size() <span style="color:#ff79c6">&gt;</span> <span style="color:#bd93f9">1</span>){ +</span></span><span style="display:flex;"><span> diags.pb(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span>{rack.back(), verts[j]}); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> rack.push_back(vlast); +</span></span><span style="display:flex;"><span> }<span style="color:#ff79c6">else</span>{ +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Same Side +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> rack.pop_back(); +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// rack.back() should be inward wrt. vlast and verts[j] -&gt; i.e, match sign of side of vlast +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> <span style="color:#ff79c6">while</span>(rack.size() <span style="color:#ff79c6">&amp;&amp;</span> check_concave(vlast, rack.back(), verts[j], sidemap[verts[j]])){ +</span></span><span style="display:flex;"><span> diags.pb({verts[j], rack.back()}); +</span></span><span style="display:flex;"><span> vlast <span style="color:#ff79c6">=</span> rack.back(); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.push_back(vlast); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> rack.push_back(verts[j]); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span> <span style="color:#6272a4">// Add diags from all verts in stack (except top and bottom) to lowermost vertex +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span> rack.pop_front(); +</span></span><span style="display:flex;"><span> rack.pop_back(); +</span></span><span style="display:flex;"><span> <span style="color:#ff79c6">for</span>(<span style="color:#ff79c6">auto</span> <span style="color:#8be9fd;font-style:italic">v</span>: rack){ +</span></span><span style="display:flex;"><span> diags.push_back(vector<span style="color:#ff79c6">&lt;</span>point<span style="color:#ff79c6">&gt;</span>{verts[sz<span style="color:#ff79c6">-</span><span style="color:#bd93f9">1</span>], v}); +</span></span><span style="display:flex;"><span> } +</span></span><span style="display:flex;"><span>} +</span></span></code></pre></div><p>4. Number of Triangulations of a Convex Polygon</p> +<ul> +<li>From the <a href="https://en.wikipedia.org/wiki/Catalan_number"target="_blank" rel="noopener">wikipedia page</a>, A convex polygon with n + 2 sides can be triangulated to n triangles by non-crossing lines.</li> +<li>Number of different ways of triangulation is Catalan Nos.</li> +<li>For any triangulation, there would be exactly 2 vertices that don&rsquo;t need to be joined by a diagonal.(or whose degrees stay the same!) So, catalan nos. is on the $n-2$ vertices connected by diagonals.</li> +<li>The $\sum c_i c_{n-i}$ Form: Recurrence relation is the breaking of the polygons by one of the diagonals.</li> +</ul> +<h2 id="week-5">Week 5</h2> +<ul> +<li> +<p>k-D Trees</p> +<ul> +<li>Base Structure: BST</li> +<li>Stores values like BST, but instead of ordering only by value like BST, it needs to order by <code>k</code> params.</li> +<li>This is done by selecting a splitting criteria, like for 2D: alternate between &lsquo;X&rsquo; and &lsquo;Y&rsquo; parameters based on whether the depth is even/odd.</li> +</ul> +</li> +<li> +<p>2D Layered Range Trees</p> +<ul> +<li>Base Structure: Red-Black Tree or balanced BST</li> +<li>See <a href="https://stackoverflow.com/questions/17466218/what-are-the-differences-between-segment-trees-interval-trees-binary-indexed-t"target="_blank" rel="noopener">differences between some well-known trees</a>.</li> +<li>2D Layered Range tree stores points in its associated array, and optimized for &ldquo;which points fall within a given interval&rdquo; queries.</li> +<li>The assoc array of point <code>v</code> is the two-pointer zip (merge-sort) of <code>2v</code> and <code>2v+1</code> vertices.</li> +<li>It can be represented similar to 2D segment tree, but value contains &ldquo;the points themselves&rdquo;. (segtree consists of sum of no. of points)</li> +<li>Both 2D layering range tree and segment trees can be used interchangeably.</li> +<li>Fractional Cascading is technique to store binary_searched index of the element as pointer. So $O(logN)$ extra factor isn&rsquo;t needed. Each element of assoc array of point <code>v</code> also contains pointers to <code>2v</code> and <code>2v+1</code> nodes arrays&rsquo; binary_searched(lower_bound) index.</li> +</ul> +</li> +<li> +<p>2D Priority Search Tree</p> +<ul> +<li>Base Structure: Binary Heap or Priority Queue (Scaled up to 2D).</li> +<li>Shows one-sided unbounded range of values.</li> +</ul> +</li> +</ul> +<p>1. Closest Point</p> +<p>Simple binary-search implementation as points have only 1 parameter.</p> +<p>2. Number of Points in Rectangle</p> +<p>The easiest implementation in via a Cartesian Tree. (similar to Kdtree) +My code is a 2D Segment Tree however I <strong>recommend</strong> using an OOP approach with <strong>Cartesian Tree</strong> instead!</p> +<p>This is was approximate workflow while designing 2D Segment Tree. See <a href="https://cp-algorithms.com/data_structures/segment_tree.html"target="_blank" rel="noopener">CP Algorithms</a>&rsquo;s +compression of 2D segment tree for ideas. Fractional Cascading for speeding up!</p> +<p>Below are the design notes for the code.</p> +<hr> +<pre tabindex="0"><code>General Design - +- buildx, buildy, queryx, queryy +- Range compression (See cp-algorithms.com tips) +- NlogN memory and (logN)^2 time per query +Construction - +- Vector with all x-coords sorted +- Vector with all y-coords sorted for each node of segtree[x] to lowerbound/upperbound y indices +- Within each node of segtree[x], store `segtree[][y]` with compressed size 4*log(Sumx_r - Sumx_l) +Query - +- Search equivalent indices for x-coords in vec +- Get each node from segtree query +- Search equivalent indices for y-coords in each vvec[v_x] +- Get each node sumval from segtree[v_x] query +Variable Names- +- v -&gt; root vertex +- l, r -&gt; current left/right segment of coords +- L, R -&gt; required left/right segment +- Lyc, Ryc -&gt; c indicates coordinate and not index +Current Progress - +- Correct Answer and correct Memory Limit +- Time Limit Exceeded in Building Segtree +- Building Time: ~ 4min 45 seconds +- Query Time(for 30000 queries): ~ 5min (9 min 45s in total) +Optimization - +- Get rid of binary search for both x &amp; y and instead check coord value +- Remove coord compression but keep construct_order_y +- Make D&amp;C of segment tree run on array with unique elements (order_x, order_y) instead +- Fractional Cascading: +- Store relation(starts) between unique array (order_x) and points +- So, construct_order_y does not require to binary search index (remove extra logN factor) +</code></pre><p>The Segment Tree is built on the unique x-coordiniates (<code>order_x</code>) array and 2nd dimension in unique y-coordinates (<code>order_y</code>). +It assumes that points do not repeat!</p> +<p>CTags-like Overview of global variables,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ll SZX <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">30001</span>; +</span></span><span style="display:flex;"><span><span style="color:#ff79c6">const</span> ll INF <span style="color:#ff79c6">=</span> <span style="color:#bd93f9">1.5e9</span>; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Segment Tree : 4*SZX and 4*SZY (still only NlogN memory since dynamic length arrays!) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> segtree[<span style="color:#bd93f9">4</span><span style="color:#ff79c6">*</span>SZX]; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Unique x-coordinates of points +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> order_x; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Unique Y-coordinates of (vx)th segment tree (4*SZX and SZY) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>ll<span style="color:#ff79c6">&gt;</span> order_y[<span style="color:#bd93f9">4</span><span style="color:#ff79c6">*</span>SZX]; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// List of all points in sorted x-coordinate order +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>vector<span style="color:#ff79c6">&lt;</span>pair<span style="color:#ff79c6">&lt;</span>ll, ll<span style="color:#ff79c6">&gt;&gt;</span> points; +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Fractional-Cascading like map of unique x indices of order_x to non-unique coordinates&#39; indices in points +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll starts[SZX]; +</span></span></code></pre></div><p>Overview of Functions,</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span><span style="color:#6272a4">// Query the (vx)th segment tree +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll <span style="color:#50fa7b">queryy</span>(ll vx, ll vy, ll ly, ll ry, ll Lyc, ll Ryc); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Build (vx)th segment tree on the basis of y-coords (USES queryy for 2*vx, 2*vx+1 segment tree values) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">buildy</span>(ll vx, ll lx, ll rx, ll vy, ll ly, ll ry); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Construct the base array for the (vx)th segment tree (Called within buildx) +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>size_t <span style="color:#50fa7b">construct_order_y</span>(ll vx, ll lx, ll rx); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Builds the segment tree and proceeds to call construct_order_y and buildy +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span><span style="color:#8be9fd">void</span> <span style="color:#50fa7b">buildx</span>(ll vx, ll lx, ll rx); +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Query the x-coordinate and proceed to call queryy +</span></span></span><span style="display:flex;"><span><span style="color:#6272a4"></span>ll <span style="color:#50fa7b">queryx</span>(ll vx, ll lx, ll rx, ll Lxc, ll Rxc, ll Lyc, ll Ryc); +</span></span></code></pre></div><p>The <code>start</code> array is constructed in preprocessing stage before <code>buildx</code>. +<code>construct_order_y</code> uses <code>start</code> array for copying y-coords of original array (so no logN factor from lower_bound).</p> +<p>Building: <code>buildx</code> -&gt; <code>construct_order_y</code> -&gt; <code>buildy</code> -&gt; (either fill value 1 or <code>queryy</code>)</p> +<p>Query: Format input to lower/upper endpoints -&gt; <code>queryx</code> -&gt; <code>queryy</code> +At both <code>queryx</code> and <code>queryy</code>(similar but with <code>lxy rxy</code>), +<code>ll lxc = order_x[lx], rxc = order_x[rx];</code> +line is used. The <code>lxc rxc</code> (coordinates of query points) are used for all comparisons except for calculation of midpoint where <code>lx rx</code> (positions) are used.</p> +<hr> +<p>3. Closest Pair of Points</p> +<p>K-D Tree Implementation. See <a href="https://rosettacode.org/wiki/K-d_tree"target="_blank" rel="noopener">Rosetta Code</a> or Stanford ACM&rsquo;s Notebook. +For intuition on K-D Trees see <a href="https://www.youtube.com/watch?v=cUssdK0Tku4&amp;list=PL8FaHk7qbOD5I3wsXKTC70LwFX6KiA3Yy&amp;index=6"target="_blank" rel="noopener">Josh Hug&rsquo;s lectures</a> +General Parameters that can be tuned,</p> +<ul> +<li>Distance Metric +<ul> +<li>Euclidean Metric</li> +<li>Chessboard Metric (Used for this problem)</li> +<li>Manhattan Metric</li> +</ul> +</li> +<li>Splitting Criteria (X or Y based) +<ul> +<li>Parity of Depth/Height of current node</li> +<li>Larger of Width or Height of bounding box of current node</li> +</ul> +</li> +</ul> +<h2 id="week-6---point-location-and-trapezoid-maps">Week 6 - Point Location and Trapezoid Maps</h2> +<p>Lec 1 - &ldquo;Where the hell am I?&rdquo;</p> +<ul> +<li>Planar Subdivision: A set of polygons that form a large polygon.(Like a map of states of a country)</li> +<li>Partition into vertical lines or slabs at every vertex (like Shamos Hoey)</li> +<li>Naive Implementation +<ul> +<li>Query: Traverse two binary search trees - find vertical lines (bound on x), find region (bound on y);</li> +<li>Space Complexity can be n^2 if two full BST</li> +</ul> +</li> +</ul> +<p>Lec 2 - Decreasing Space Complexity</p> +<ul> +<li>Refinement: The Partition of Planar Subdivision S into Slabs induced by vertices. These Partitions would be trapezoids (or degenerate ones).</li> +<li>Trapezoidal Map: Splits the trapezoids of a refinement. Very useful technique for space partitioning or mapping regions in general.</li> +<li>Unlike the previous partition by vertical lines, this partition only has lines that end at another edge or outer rectangle.</li> +<li>Side: Segment of max length contained in boundary of face of trapezoid</li> +<li>Trapezoidal partition with $n$ segments have, $T(S) \leq 2n + 2*2n + 4$(segment endpoints, vertical lines, boundary rectangle) vertices and trapezois $\leq 3n + 1$</li> +<li>Constructing Trapezoid - Find each up, down left, right endpoints for each trapezoid. Time: 3N + 1 = O(N)</li> +</ul> +<p>Below is an image of a trapezoidal map of &rsquo;line segments&rsquo; from this <a href="https://github.com/marinimau/GAS-Trapezoidal-maps-final-prject"target="_blank" rel="noopener">GAS</a>, the same can be done for polygons as well.</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/trapezoidal_map_line_segments.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/trapezoidal_map_line_segments.png" width="auto" height="auto" +alt="Trapezoidal Map of Line Segments"/></a></p> +<p>Lec 3 - Randomized-Incremental Algorithm:</p> +<ul> +<li>O(NlogN) expected preprocess time</li> +<li>O(logN) query time (not worst case optimal but randomized)</li> +<li>Expected Query Time by Backward Analysis (See Lec04 of series)</li> +</ul> +<p>Lec 4 - Data Structure Trapezoid Cartesian DAG</p> +<ul> +<li>Trapezoidal Map Data Structure For 2D: Cartesian D.A.G.</li> +<li>Make sure to split Trapezoid on map (so it isn&rsquo;t n^2 time)</li> +<li>Unlike Tree, Cartesian DAG will just have pointer to that trapezoid</li> +</ul> +<p>Lec 5 - Query Time for Trapezoid Cartesian DAG</p> +<ul> +<li>LogN Query time (Amortized)</li> +<li>Backward Analysis (summation 1/i)</li> +<li>Size: O(N + 13N) = O(N) (13N comes from $\sum(3i + 1)*(4/i)$)</li> +<li>Construction: NlogN</li> +</ul> +<h2 id="week-7---voronoi-diagrams--post-office-problem">Week 7 - Voronoi Diagrams &amp; Post Office Problem</h2> +<p>Lec 1 - Post Office Problem</p> +<ul> +<li>Post Office Problem: Which is the closest Post Office to place P?</li> +<li>Answer: Voronoi Diagram with Euclidean Distance Metric. (Map of region closest to that point)</li> +</ul> +<p>Lec 2 - Definitions in Voronoi Diagrams</p> +<ul> +<li>Voronoi Cell: +$$ V(p) = { x \in R^2: d(x, p) &lt; d(x, q) \forall q \in P\ - {p}} $$</li> +<li>For Voronoi Cell, Think of definition of Ball in Topology but using relative distances instead of a constant epsilon</li> +<li>Voronoi Edge: +$$ V(p) = { x \in R^2: d(x, p) == d(x, q) \forall q \in P\ - {p}} $$</li> +</ul> +<p>Lec 3 - Overall Shape of Voronoi Diagrams</p> +<ul> +<li>Lemma: Vor( P ) consists of atmost (2n - 5) vertices and (3n - 6) edges</li> +<li>Proof of Lemma from Euler&rsquo;s Polyhedra Formula (Dual is Delaunay Triangulation and Maximal Planar Graph =&gt; 3n - 6)</li> +<li>For infinite voronoi diagrams, set dummy vertex at infinity</li> +<li>NOTE: Voronoi Vertices != Voronoi Cells (or Faces or Sites)</li> +<li>Voronoi Vertex: Circle at vertex &lsquo;x&rsquo; has atleast 3 points on it&rsquo;s largest (circumcircle which does not contain a site/face) +$$|C_p(x) \cap P| \geq 3$$</li> +<li>Voronoi Edge: For edge P to P&rsquo;, there is a vertex &lsquo;x&rsquo; which has P and P&rsquo; on it&rsquo;s largest (circumcircle which does not contain a site/face) +$$\exists x \in E(P, P&rsquo;) st.,\ \ |C_p(x) \cap P| = {P, P&rsquo;}$$</li> +</ul> +<p>Lec 4 - Computing Voronoi Diagram</p> +<ul> +<li>BF: Line Segment Intersection, Half Plane Intersections &gt; $O(N^2)$ time</li> +<li>Naive Line Sweep: Event Points are not known before swept</li> +<li>Fortune&rsquo;s Algorithm or Optimized Line Sweep: +<ul> +<li>Parabolas at the visited vertices form the equidistant line</li> +<li>Directrix is the Line Sweep at point P, and focus is the visited vertices</li> +<li>Beachline($\beta$): The lowerbound of each of the parabolas (from the visited vertices so far) merged together.</li> +<li>The intersection points of the parabolas as the line is swept form the edges of the voronoi diagram.</li> +<li>See <a href="http://www.raymondhill.net/voronoi/rhill-voronoi.html"target="_blank" rel="noopener">this</a> for demo. Also, <a href="https://jacquesheunis.com/post/fortunes-algorithm/"target="_blank" rel="noopener">this post</a> for explaination.</li> +</ul> +</li> +<li>Beachline Event Points +<ul> +<li>Site(Face) Event: New Sitepoint is found =&gt; New Arc is created</li> +<li>Circle Event: Sweep Line reaches lowest point of circle containing 3 Site Points =&gt; Arc of the inner site point is deleted. Voronoi Points are the centre of the circle formed.</li> +</ul> +</li> +</ul> +<p>Lec 5 - Fortune&rsquo;s Line Sweep Algorithm</p> +<ul> +<li>See <a href="https://pvigier.github.io/2018/11/18/fortune-algorithm-details.html"target="_blank" rel="noopener">PVigier&rsquo;s Blog</a> for implementation resources.</li> +<li>Also see this <a href="https://jacquesheunis.com/post/fortunes-algorithm/"target="_blank" rel="noopener">post by Jacques</a></li> +<li>Key Functions +<ul> +<li>Find New Circle Event Points (Site Event Points are already known)</li> +<li>Handle Circle Event (once processed; calls findNewCircleEvent)</li> +<li>Handle Site Event (once processed; calls findNewCircleEvent)</li> +</ul> +</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/fortunes.gif"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/fortunes.gif" width="auto" height="auto" +alt="Fortune&amp;rsquo;s Algorithm Wiki"/></a></p> +<h2 id="week-8---delaunay-triangulations">Week 8 - Delaunay Triangulations</h2> +<p>Lec 1 - Height Interpolation</p> +<ul> +<li>Triangulation: Planar subdivision with all inner faces triangles and outer face is Convex Hull</li> +<li>Since Maximal Planar Graph =&gt; (3n - 6) edges. But outer face is CH and needs triangulation (3 - h) edges =&gt; 3n - 3 + h edges in total</li> +</ul> +<p>Lec 2 - Angle-Optimal Triangulation</p> +<ul> +<li>Height Interpolation Optimization by choosing a better triangulation</li> +<li>Angle-Optimal Triangulation to avoid skinny triangles (this causes disparity in length Vs width - based height interpolations)</li> +<li>Angle vector $A(T)$ of Triangulation $T$ is the angles of all triangles in sorted order</li> +<li>A Triangulation is more optimum if Angle vector is <strong>lexicographically</strong> better than the other. i.e., $A(T_{optimal}) &gt; A(T)$</li> +<li>The best triangulations are called Angle-Optimal.</li> +</ul> +<p>Lec 3 - Edge-Flips &amp; Legal Triangulations</p> +<ul> +<li>Edge e is illegal in Triangulation T if triangulation obtained by flipping edge e, T&rsquo; has $A(T&rsquo;) &gt; A(T)$</li> +<li>Use Extended Thales Thm (Thales++), i.e., check angles by taking circumcircle around edge e</li> +<li>Angle-Optimal is always legal.</li> +<li>A triangle is <strong>legal</strong> iff it has no illegal edge</li> +</ul> +<p>Lec 4 - Voronoi Diagram &amp; Delaunay Triangulation</p> +<ul> +<li>Delaunay Triangulation: Straight Line Drawing of the Dual Graph of Voronoi Diagram</li> +<li>Proof +<ul> +<li>Take circumcircle on any point in edge between sites p-q in Vor(P)</li> +<li>Consider another edge u-v and show crosses lead to contradiction</li> +</ul> +</li> +<li>Alt Definition: Delauanay Triangulation iff $\forall \Delta \in T : int(C(\Delta) \cap P) = \phi$</li> +<li>AKA: Empty Circumcircle property of D.T.</li> +</ul> +<p>Lec 5 - Correctness and Computation</p> +<ul> +<li>A triangulation is legal iff it is Delaunay</li> +<li>Proof +<ul> +<li>Back Relation: By Empty Circumcircle Property and Thales++, D.T. is legal</li> +<li>Forward Relation: +<ul> +<li>By Contradiction, Take a triangle p-q-r and circumcircle. where T is legal</li> +<li>Take point s in circumcircle. Now, we need to maximize angle of chord at s. (p-s-q)</li> +<li>Take neighbouring triangle p-q-t, t lies outside circumcircle.</li> +<li>Get contradiction: angle q-s-t &gt; angle p-s-q (but this is maximal)</li> +</ul> +</li> +</ul> +</li> +<li>If pointset P is general position(i.e. No 4 points lie on an empty circle) then D.T. is unique and angle-optimal.</li> +<li>If pointset P is not general position, then all D.T. have same minimum angle but may not be angle-optimal.</li> +<li>D.T. can be constructed in $O(NlogN)$</li> +<li>Angle-Optimal Triangulation in non-general position P, can be constructed in $O(N^2)$ time. Holes (4+ points on empty circle) can be filled by trying out each flip.</li> +</ul> +<p>Below is an image also showing weighted voronoi diagrams and their corresponding delaunay triangulations, +<a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/weighted_dt.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/weighted_dt.png" width="auto" height="auto" +alt="Weighted and non-Weighted VD and DT"/></a></p> +<h2 id="week-9---convex-hull-in-3d">Week 9 - Convex Hull in 3D</h2> +<p>Lec 1 - Complexity and Visibility of CH</p> +<ul> +<li>(Upper Bound Theorem) General Time Complexity of Convex Hull in d dimensions: $O(N^{\lfloor d/2 \rfloor})$</li> +<li>In 3D, Surface of the Polyhedra forms a Planar Dual Graph =&gt; atmost (3n-6) edges and hence linear complexity. Similar for higher dimensions.</li> +<li>Construction by Random-Incremental Algorithm</li> +<li>Visibility: +<ul> +<li>If we project rays from point P to Convex Polytope.</li> +<li>The project rays that are 3D Tangent to the polytope form a ring/shadow, the point that form this is called Horizon.(Last visible edges)</li> +<li>Region facing towards P bounded by Horizon is the Visible region.</li> +</ul> +</li> +<li>Define Conflict Graph and create bipartite relation of points with facets. And mark out which facets are visible.</li> +</ul> +<p>Lec 2 - Randomized Incremental Algorithm</p> +<ul> +<li>Pseudocode/Approach of adding vertex to CH3</li> +<li>TC: $O(N^2)$ (Randomized from $O(N^3)$; not worst case optimal)</li> +</ul> +<p>Lec 3- Analysis</p> +<ul> +<li>Expected No. of Facets Created by CH are bounded to atmost (6n - 20)</li> +<li>Degree bounded by 6 for the vertices other than initial 4-point CH3, so 6*(n-4) + 4</li> +<li>See this <a href="https://codeforces.com/blog/entry/81768"target="_blank" rel="noopener">Tutorial on 3D CH</a> for simple implementation as well as some optimized version.</li> +<li>Can be further optimized with Configuration Spaces</li> +<li>Higher Degree CH are worst case optimal accordingly with Upper Bound Thm.</li> +</ul> +<p>Lec 4- Convex Hull &amp; Half-Plane Intersections</p> +<ul> +<li>Assume a mapping/relation from spaces P1 and P2, where (&lsquo;primal is the dual of the dual!&rsquo;) +<ul> +<li>Line in P1 -&gt; point in P2 (P1 is Dual of P2)</li> +<li>Line in P2 -&gt; line in P1 (P2 is Dual of P1)</li> +</ul> +</li> +<li>Convex Hull of a point set in P1 =&gt; Set of Lines in P2 +<ul> +<li>Traversing the lines corresponding to Lower Hull of P1 alongside intersections, give the Upper Envelope. Similarly for Upper CH.</li> +<li>Incidence Preserving: Every point in P1 gives Line in P2. So CH region gives area bounded by upper and lower envelope.</li> +<li>Order Preserving: Maintains an ordering through the mapping.</li> +</ul> +</li> +<li>Scaling to 3D: CH3 of points gives 3D Wrapping/Envelope of 3D Lines</li> +</ul> +<p>Lec 5- Voronoi Diagrams Revisited</p> +<ul> +<li>Distance to Unit Parabola (From Projection of point q to tangent at p&rsquo;) = intercepts $(pq)^2$</li> +<li>Take: A (set of planes/halfplanes) have an Upper Envelope (or Supremum or Least Upper Bound 3D Parabola). The planes are thus 3D Tangents to the 3D Parabola or Envelope.</li> +<li>When this is projected to the plane, +<ul> +<li>Voronoi Centres/Faces/Sites = (Intersection points of Planes and 3D Parabola)</li> +<li>Voronoi Edges = (Line Segments that for the Intersection of Planes)</li> +<li>Voronoi Vertices = (Intersection of 3 or more Planes)</li> +</ul> +</li> +<li>Take: 3D Convex Hull of (Intersection of Planes and 3D Parabola). The 3D Parabola is now the Lower Envelope (or Infimum or Greatest Lower Bound) of the (3D Convex Hull).</li> +<li>When this projected to the plane, +<ul> +<li>Delaunay Vertices = (Intersection of Planes and 3D Parabola) or (Points of 3D Convex Hull)</li> +<li>Delaunay Edges = (Edges of 3D Convex Hull)</li> +</ul> +</li> +<li>See <a href="https://www.youtube.com/watch?v=H0IVBBDJ8Kk&amp;list=PLubYOWSl9mIubi50UoQt3Sl_CV9NCjUUm&amp;index=5"target="_blank" rel="noopener">Video for Demo</a></li> +</ul> +<p>Below image is from <a href="https://pages.mtu.edu/~shene/NSF-2/DM2-BETA/index.html"target="_blank" rel="noopener">DesignMentor</a>, showing delaunay triangulation as a projection of a 3D Convex Hull</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/ch3d_as_dt.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/ch3d_as_dt.png" width="auto" height="auto" +alt="Delaunay Triangulations as Projection of 3D Convex Hull"/></a></p> +<h2 id="week-10---motion-planning">Week 10 - Motion Planning</h2> +<p>Lec 1 - Point Shaped Robots</p> +<ul> +<li>Trapezoidal Map for Path with Obstacles. Finding Path: O(NlogN) Construction and O(N) query</li> +</ul> +<p>Lec 2 - Configuration Space</p> +<ul> +<li>Degrees of Freedom: 2D(2 translation x, y + 1 rotation \theta) = 3, 3D(3 translation x,y,z + 2 rotation $\theta, \phi$) = 5</li> +<li>Configuration Polygon: Polygon s.t. foreach point in ConfPol, Robot at point (x, y) (R(x, y)) intersects with obstacle polygon(Pi). (If point robot, then this is just the obstacle polygons.)</li> +</ul> +<p>$$ CP<em>i = {(x, y): R(x, y) \cap P</em>{i}} $$</p> +<p>Lec 3 - Characterizing Configuration Spaces</p> +<ul> +<li>Minkowski&rsquo;s Sum (For Polygon!): $S_1+S_2={p + q : \forall p \in P, q \in Q}$ where p, q are point vectors</li> +<li>Geometric Representation: Replace Copy of S1 in every point of S2 to form the new shape. (or Vice versa; commutative)</li> +<li>Inversion in Polygon Algebra: Rotate polygon by 180 around origin. $S2 =-S1={-p : \forall p \in P}$</li> +<li>Configuration Polygon: $CP = P + (- R(0, 0))$ (where &lsquo;+&rsquo; is minkowski sum)</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/compgeom/minkowski_sum_of_polygons.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/compgeom/minkowski_sum_of_polygons.png" width="auto" height="auto" +alt="Configuration Polygon"/></a></p> +<p>Lec 4 - Complexity and Computation</p> +<ul> +<li>Atmost n+m edges in minkowski sum(S) of P (n edges) and Q (m edges)</li> +<li>We can define a map of each edge of S to a pair (i, j) of the edges in P, Q.</li> +<li>Quadratic Algorithm: Convex Hull of points where at each corner of P, Try every rotation of Q</li> +<li>Linear Algorithm: (Two-Pointers-like) Choose Bottom-Right most point for both. And move p_ptr or q_ptr based on which has a smaller angle.</li> +</ul> +<p>Lec 5 - Pseudodisks</p> +<ul> +<li>Def: Pair of Planar Objects (P1, P2) form a pseudodisk if (bound-&gt; boundary, int-&gt;interior), +<ul> +<li>$bound(O1) \cap int(O2)$ is connected</li> +<li>$bound(O2) \cap int(O1)$ is connected</li> +</ul> +</li> +<li>Consider 2 convex polygons with disjoint interiors. +<ul> +<li>Let d1 -&gt; direcion where P1 more extreme, similarly d2.</li> +<li>Then P1 is more extreme in [d1, d2] or [d2, d1]. Or in a circle, one boundary part has P1 more extreme and other with P2.</li> +</ul> +</li> +<li>For P1, P2, take CP1 = P1 + R, CP2 = P2 + R. Then proof by contradiction. So (CP1, CP2) have to be pseudodisks.</li> +</ul> +<p>Lec 6 - Union Complexity</p> +<ul> +<li>For Convex Polygons P, Q, R,.., the total union has atmost 2*(n+m+l+..) vertices. (since every (two or less) crossings can be mapped to a vertex)</li> +<li>For constant complexity convex robot R, translating among S disjoint objects with N edges. We can preprocess in $O(N (logN)^2)$ and compute collision-free path in O(N)</li> +<li>Approach +<ul> +<li>Triangulate Polygons if Not-Convex to make it convex (NlogN)</li> +<li>Compute ConfPol for each Obstacle Polygon (N)</li> +<li>Compute Union of Obstacles by sweep line (N $(logN)^2$)</li> +<li>Mark out Trapezoidal Maps etc.</li> +<li>Query: Find path in complement of unionConfPol with help of Trapezoidal Map</li> +</ul> +</li> +</ul>Numerical Analysishttps://cheese-cracker.github.io/posts/numan/Mon, 20 Jan 2020 00:00:00 +0000https://cheese-cracker.github.io/posts/numan/<h3 id="resources">Resources</h3> +<ul> +<li><a href="https://www.youtube.com/user/kvyi/playlists"target="_blank" rel="noopener">Jacob Bishop&rsquo;s Tutorials</a> Part 5-7 covers most topics</li> +<li><a href="https://www.youtube.com/watch?v=EG62xCOdLLA"target="_blank" rel="noopener">Gauss Quadrature Vs Newton Cotes&rsquo; Visualization</a></li> +<li>Check Calculator function input for Iterative Approximation Methods( Newton-Rhapson, Fixed Point Iteration etc.)</li> +</ul> +<h2 id="basic-analysis">Basic Analysis</h2> +<ul> +<li>Catastrophic Cancellation</li> +<li>Significant Digits Vs Decimal points</li> +<li>Sum for minimal error, rounding/chopping</li> +<li>Taylor Series&rsquo; Approximation and Error</li> +</ul> +<h3 id="iterative-methods">Iterative Methods</h3> +<ol> +<li>Bisection</li> +<li>Regula Falsi (Method of Chords)</li> +<li>Secant +<ul> +<li>Swap to whichever is close</li> +</ul> +</li> +<li>Fixed Point Iteration +<ul> +<li>Order of convergences</li> +<li>Uniqueness</li> +<li>Error Analysis</li> +</ul> +</li> +<li>Newton Raphson +<ul> +<li>Order of convergences</li> +</ul> +</li> +</ol> +<h3 id="matrix-techniques">Matrix Techniques</h3> +<ul> +<li>Pivoting (Partial Pivoting = Every Step)</li> +<li>Scaling +<ul> +<li>First before Pivoting</li> +</ul> +</li> +<li>Matrix Norms +<ul> +<li>Norm_1(A) = max(col sum)</li> +<li>Norm_inf(A) = max(row sum)</li> +<li>Norm_2(A) = Spectral Norm = $\sqrt \lambda$ for eigenvalue</li> +<li>Norm_F(A) = root of(Sum of all a_ij^2) = Frobenius Norm</li> +</ul> +</li> +<li>Conditional No. = ||A|| * ||A^-1||</li> +</ul> +<h3 id="matrix-iterative-methods">Matrix Iterative Methods</h3> +<p>In order to solve, systems of equation we have Gauss-El-M, Gauss-Jacobi and Gauss-Siedel. Jacobi and Siedel is mostly used for sparse arrays where G-El-M is highly ineffecient. +Newton-Raphson, Fixed Point are iterative methods also work while finding solution.</p> +<ul> +<li>Gaussian Elimination</li> +<li>G-Jacobi&rsquo;s</li> +<li>G-Jacobi&rsquo;s Matrix Version</li> +<li>G-Siedel</li> +<li>G-Siedel Matrix Version</li> +<li>Fixed Point (Matrix)</li> +<li>Newton-Raphson (Matrix)</li> +</ul> +<p>Points to note</p> +<ul> +<li>Matrix must be Diagonally Dominant (see thm) for Jacobi/Gauss-Siedel</li> +</ul> +<h3 id="interpolation-methods">Interpolation Methods</h3> +<ul> +<li>Polynomial</li> +<li>Lagrange +<ul> +<li>Error</li> +</ul> +</li> +<li>Newton Divided Difference</li> +<li>Newton Forward Difference*</li> +<li>Newton Backward Difference*</li> +<li>Hermite</li> +<li>Oscullatory (generalized Hermite)</li> +</ul> +<ul> +<li>NBD, NFD is only for equally spaced</li> +</ul> +<h4 id="table-for-ndd-like-interpolation">Table for N.D.D-like Interpolation</h4> +<ul> +<li>NDD : $frac{f_2 - f_1}{ x_2 - x_1 }$ for each el</li> +<li>NFD: $f_2 -f_1$ Only</li> +<li>NBD: Start Reverse and Take Bottom Row; Same table as NFD $f_2 - f_1$;</li> +<li>HERM: Repeat each entry twice; $frac{f_2 - f_1}{x_2 - x_1} if different or differentiation if same</li> +<li>OSC: Repeat based on no. of available vals in x, y, y&rsquo; ..; $f_2 - f_1$</li> +</ul> +<h2 id="approximation-for-integration">Approximation for Integration</h2> +<p>In order of specific to generalized.</p> +<ul> +<li>Newton Cotes&rsquo; Formula - Approximate function as polynomial and find area. +<ul> +<li>Trapezoid Rule (n = 1 approx:2 data points linear Pn)</li> +<li>Simpson&rsquo;s 1/3 Rule (n = 2 approx:3 data points quadratic Pn)</li> +<li>Simpson&rsquo;s 3/8 Rule (n = 3 approx:4 data points cubic Pn)</li> +<li>Generalized Newton Cotes'</li> +</ul> +</li> +<li>Gaussian Quadrature Method (Method of Undetermined Coeffecients) - Choose points that make the equivalent polygon (may not be contained) +<ul> +<li>Gauss-Chebyshev, Gauss-Legendre, Gauss-Hermite with different weight functions</li> +</ul> +</li> +</ul> +<h2 id="approximations-for-initial-value-problems">Approximations for Initial Value Problems</h2> +<p>Use Taylor Series to derive the equations! +Useful predictor methods also,</p> +<ul> +<li>Euler&rsquo;s Method (RK 1st Order)</li> +<li>Modified Euler Method (RK with 2nd Order AKA Heun&rsquo;s Method)</li> +<li>Runge Kutta(RK) Schemes: Move along the slope(which is approximated by the order) from one point to the next point</li> +<li>Taylor Series Expansion</li> +</ul> +<p>See Use of Butcher Table also and RK in 2 variable (using 2 variable Taylor Series)!</p> +<ul> +<li> +<p>Multi-Step Method</p> +<ul> +<li>Predictor: Adams-Bashforth (Derived from previous m+1 points NBD Polynomial approx)</li> +<li>Corrector: Adams-Moulton (Derived from previous(and including) m +2 points NBD Polynomial)</li> +</ul> +</li> +<li> +<p>Milne&rsquo;s Predictor Formula (Generalized Adams-Besforth by changing limits of integration)</p> +</li> +</ul> +<h2 id="approximating-system-of-odes">Approximating System of ODEs</h2> +<ul> +<li>Runge-Kutta 2 variable method</li> +<li>Implicit Euler&rsquo;s</li> +<li>Milne&rsquo;s Method</li> +</ul> +<h2 id="approximations-for-boundary-value-problems">Approximations for Boundary Value Problems</h2> +<ul> +<li>Finite Difference Method</li> +<li>Finite Element Methods +<ul> +<li>Collocation Method</li> +<li>Rayleigh Ritz Method</li> +<li>Galerekin&rsquo;s Weighting Function Method</li> +</ul> +</li> +</ul>Math Modellinghttps://cheese-cracker.github.io/posts/mmodelling/Mon, 20 May 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/mmodelling/<h3 id="important-topics">Important Topics</h3> +<ul> +<li><a href="https://www.math24.net/routh-hurwitz-criterion/"target="_blank" rel="noopener">Routh Hurwitz Test</a></li> +<li>Matrix of Variation/Jacobian of dx/dt (and dy/dt)</li> +<li>Stability of solution +<ul> +<li>Local Stability (Matrix of Variation) Eigenvalues +<ul> +<li>Positive Definate : Unstable</li> +<li>Negative Definate : Local AS</li> +<li>Imaginary Eigenvalues: Spiral</li> +</ul> +</li> +<li>Global Stability (Appropriate Lyaponov Function) +<ul> +<li>Test stability by Lyapunov Funcn or any other (V) has derivative negative definate</li> +</ul> +</li> +</ul> +</li> +</ul> +<p>$$V(x) = x - x^* - x^* ln(\frac{x}{x^*}) \frac{k_1}{2}(T- T^*)^2 + \frac{k_2}{2}(U-U^*)^2$$</p> +<p>$$\frac{dV}{dt} = \frac{\dot{x}}{x}( x - x^*) + other$$</p> +<ul> +<li>Quick Finding of Eigenvalues (see Prerequisites)</li> +<li>Complex Eigenvalues and Calculation of Spiral</li> +<li>Linearization of Solution</li> +<li>Logistic regression Model +$$ \frac{dx}{dt} = rx(1 - \frac{x}{k})$$</li> +<li>Persistance / Permanance of Solution</li> +<li>Picard-Landlof Theorem - Existence of Solution</li> +<li>Sylvester&rsquo;s Criteria - b^2 - 4ac conditions</li> +<li>Hamiltonian +$$ H(x, t, u, \lambda) = g*{divident}(x, t, u) + \lambda f*{capital\ assets}(x, t, u) $$</li> +<li>Pontrayagin&rsquo;s Maximum Principle +$$ \frac{d\lambda}{dt} = -\frac{dH}{dx}$$</li> +<li>Bang-Bang and Singular Control (Control Theory)</li> +<li>De Carte&rsquo;s Rule of Sign</li> +<li>Dulac Bendixson Criteria for periodicity of soln</li> +<li>Bionic Equilibrium Conditions (for Optimal Harvesting)</li> +<li>Hopf Bifurcation: The point where behavior of system stability changes. Opposite stability before and after critical value.</li> +<li>Lebesgue Cycle Stability</li> +<li>Basic Reproduction No.</li> +<li>LimSup Method for showing boundedness</li> +<li>Standard Comparison Theorem, Amax &gt; Bmin, well-posedness &hellip;</li> +</ul> +<hr> +<h3 id="models">Models</h3> +<ol> +<li>Malthusian Growth Model +$$ dx/dt = rx$$</li> +<li>Logistic Growth Model (inter-specific interference)</li> +<li>Resource-Consumer and similar models - +<ul> +<li>Prey-Predator Model (or Resource Consumer) +<ul> +<li>specialized prey-predator</li> +<li>generalized prey-predator</li> +</ul> +</li> +<li>Competetive Model</li> +<li>Cooperation Model</li> +</ul> +</li> +<li>3 Species Food Chain Model +(Logistic Growth with interspecie interface)</li> +<li>Opimal Harvesting (fish) Model - Max Sustainable Yield</li> +<li>Migration of Fishes Model</li> +<li>Pollution Toxicant Models- +<ul> +<li>2D Model</li> +<li>3D Model - Uptake of Conc (POST-Midsem)</li> +</ul> +</li> +<li>Susceptible-Infected and variant models +<ul> +<li>SI Model</li> +<li>SIS Model(with immunity)</li> +<li>SIR Model(with complete cure forever)</li> +<li>SEIR Model(Both Exposed and Recovery types)</li> +</ul> +</li> +</ol> +<h4 id="analysis-of-solution">Analysis of Solution</h4> +<ul> +<li>Boundedness</li> +<li>Positivity and Solution Space $\Omega$</li> +<li>Persistance of Solution (Show Lower Bound)</li> +<li>Periodicity or not (Dulac Bendixson Criteria)</li> +<li>Equilibrium Points</li> +<li>Local Stability Analysis +<ul> +<li>Linearize solution and then find values OR&hellip;</li> +<li>Use generalized matrix of variation and plug in values</li> +</ul> +</li> +<li>Global Stability Analysis +<ul> +<li>Choose Lyapanov Function and terms based on Logistic Growth or not</li> +<li>Differentiate and show Negative Definate</li> +<li>Use Sylvester&rsquo;s Criteria and compare terms using Routh-Hurwitz Criteria</li> +<li>Routh Array to show stability</li> +</ul> +</li> +</ul> +<h4 id="other-analysis-techniques">Other Analysis Techniques</h4> +<ul> +<li>Rate $\dot{r}$ for growth and $\dot{\theta}$ for clockwise/anticlockwise in spirals</li> +<li>Lebesgue Cycle stability in spirals</li> +<li>Critical points in Hopf Bifurcation and stability chart</li> +<li>Basic Reproduction Number Calculation</li> +</ul> +<hr> +<h4 id="sample-model-to-check-equilibrium-points">Sample Model to check equilibrium points</h4> +<div class="mermaid"> +graph TD +A[Formulate the Rate Diffn Equations] --> AB +AB[ Find Omega. Check if bounded with limsup and show positive also. Check Persistance/Periodicity] --> B +B[Find equilibrium points where rate = 0] --> C +C[Local Stability. Get matrix of variation/Jacobian at these points] --> D +C --> E[Get Char Eqn with Eigenvalue] +E --> F[Use Routh Hurwitz to get roots' sign] +F --> G[From sign of eigenvalues determine stability of Local Solution] +D[Get Eigenvalues of the matrix of variation] --> G +G --> H +H[Global Stability. Use Lyapunov function variants Derivative] --> I[Check if negative definate by adding/subtracting] +</div> +<h4 id="harvesting-model-sample-flow">Harvesting Model Sample Flow</h4> +<p>Steps for Solving</p> +<ol> +<li>Formulate the Rate Diffn Equations</li> +<li>Find the equilibrium points and conditions</li> +<li>Plug x* value in harvesting rate equation qEx</li> +<li>Get max E by finding minima at x* and put the value into harvesting rate</li> +</ol> +<p>For optimal harvesting policy,</p> +<ol start="5"> +<li>Find hamiltonian with - f as <em>net revenue in continuous time stream</em> - g as <em>rate of change of assets</em> +$$ H = e^{-\delta t}(pqx-c)E + \lambda_1 \frac{dx}{dt} +\lambda_2 \frac{dy}{dt}$$</li> +<li>Find <strong>minima of H wrt. E</strong> .Get switching func and equate to 0 for singular control</li> +<li>Apply Pontrayagin&rsquo;s Max Principle Condition and use with step 6.</li> +<li>Find discount value and check notes of these points</li> +</ol> +<p>Bionic Equilibrium is value of E at +$$\dot{x} = \dot{y} = 0$$</p> +<hr> +<h4 id="sir-model">SIR Model</h4> +<p>Steps for Solving,</p> +<ol> +<li>Show Bounded by taking sum of population(N) and finding LimSupN(t) will be const</li> +<li>Take S(t) and with Comparison Theorem, show &gt;=0</li> +<li>Use Dulac Bendixson with H = 1/SI, and show no sign change so not periodic</li> +<li>Find Equilibrium Points (approx E*) with reproduction no. &lsquo;R&rsquo;</li> +<li>Matrix of Variation with &lsquo;R&rsquo; cases</li> +<li>Lyapunov Function and one term will not allow sylvester&rsquo;s criteria</li> +<li>Choose C = S* to get, +$$ \dot{V} = -\beta I (S - S^*) -\beta S^* (I-I^*)( S - S^* ) &lt; 0 $$</li> +</ol> +<h4 id="other-useful-prerequisites">Other Useful Prerequisites</h4> +<ul> +<li> +<p>Green&rsquo;s Thm</p> +</li> +<li> +<p>Stoke&rsquo;s Thm</p> +</li> +<li> +<p>Gauss Divergent Thm</p> +</li> +<li> +<p>Finding Eigenvalues fast +$$ \lambda^2 - Tr(A)\lambda + Det(A) $$ +<em>Trace is sum of diagonal entries</em></p> +</li> +<li> +<p>Routh Hurwitz Criteria +See <a href="https://www.math24.net/routh-hurwitz-criterion/"target="_blank" rel="noopener">Routh Hurwitz Test</a> - Conditions - All positive coeff always - All minors must be positive - 2nd Degree: no more conditions - 3rd Degree a1*a2 - a3*a0 &gt; 0 (for 3 degree see below)</p> +<p>$$ +Routh\ Array = +\begin{bmatrix} +a_{N} &amp; - a_{N-2} \ +a_{N-1} &amp; a_{N-3} \ +\end{bmatrix} +$$</p> +</li> +<li> +<p>Another view to understand <a href="https://youtu.be/WBCZBOB3LCA"target="_blank" rel="noopener">Routh Hurwitz Graphical</a></p> +<ul> +<li>Background +<ul> +<li>If one sign different =&gt; one is positive. Hence unstable.</li> +<li>If all negative =&gt; same as all positive coeff</li> +</ul> +</li> +</ul> +</li> +</ul>Principles of Economicshttps://cheese-cracker.github.io/posts/poe/Mon, 20 May 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/poe/<h3 id="introduction">Introduction</h3> +<p>These are my notes for POE. The notes were written using markdown and vim (see iamcco/markdown.nvim plugin) and Pandoc (with eisvogel template). +Feel free to collaborate to the <strong><a href="https://hackmd.io/PtXbIdS-R52MuXXW6gc9uA?both"target="_blank" rel="noopener">Online Version of POE Notes</a></strong>. +These are only supplementary notes and NOT Lecture Notes. +Some useful resources.</p> +<ul> +<li><strong><a href="https://youtu.be/ucJBO9UTmwo"target="_blank" rel="noopener">ACDC ECON Tutorials</a></strong> by Jacob Cliffords for both Micro and Macro</li> +<li><strong><a href="https://www.khanacademy.org/economics-finance-domain/microeconomics/choices-opp-cost-tutorial/marginal-utility-tutorial/v/marginal-utility"target="_blank" rel="noopener">Khan Academy - Microeconomics</a></strong></li> +</ul> +<h3 id="elasticity-curves-part">Elasticity Curves Part</h3> +<p>Elasticity : % change quantity / % change price +$$\epsilon = \frac{ \% \Delta Q}{\% \Delta P}$$</p> +<p>(Similar to sensitivity)</p> +<ul> +<li> +<p>Inelastic</p> +<ul> +<li>monopoly</li> +<li>necessity</li> +<li>small E = Not much choice</li> +<li>E &lt; 1 ( or slope &gt; 45)</li> +<li>TR decreases for increase in quantity</li> +</ul> +</li> +<li> +<p>Elastic</p> +<ul> +<li>perfectly competetive</li> +<li>large E = plenty choice</li> +<li>E &gt; 1 ( or slope &lt; 45)</li> +<li>TR increases for increase in quantity</li> +</ul> +</li> +</ul> +<h4 id="types-of-elasticity">Types of Elasticity</h4> +<ul> +<li>Cross Price Elasticity <strong>sensitivity of A</strong> has, $\epsilon_{cross\ price} = \frac{ \% \Delta Q\ of\ B}{ \% \Delta P\ of\ A}$</li> +<li>Income Elasticity $\epsilon_{income} = \frac{ \% \Delta Q}{ \% \Delta Income}$</li> +</ul> +<h4 id="other-terms">Other Terms</h4> +<ul> +<li>Consumer Surplus = Buyer&rsquo;s Max - Price (Upper Triangle)</li> +<li>Producer Surplus = Price - Seller&rsquo;s Min (Lower Triangle/Part) +<blockquote> +<p>See CH-13 Monopoly and Antitrust for Graph and Explaination</p> +</blockquote> +</li> +</ul> +<h3 id="6---household-behavior-and-customer-choice">6 - Household behavior and Customer Choice</h3> +<ul> +<li>Household Demand Factors- Price, Income, relative prices preferences</li> +<li>Budget Constraint (Eqn)</li> +</ul> +<ol> +<li> +<p>Utility</p> +<ul> +<li>Rule of Diminishing Marginal Utility, Saturating curve of TU</li> +<li>Utility Maximizing Rule $\frac{MU}{Price}$</li> +<li>Diamond-Water Paradox <em>Water becomes granted so diminishing MU +and downward-sloping (double derivative +ve)</em></li> +</ul> +</li> +<li> +<p>Income and Substitution Effect</p> +<ul> +<li>Income effect is the <strong>change in consumption of a product</strong> due +to the relative change in <strong>price of product</strong> (well-being) +<code>Parallel Shift of Budget Constraint</code></li> +<li>Substitution effect is the <em>relatively cheap</em> as compared to +competitors hence shift in purchasing towards that product (not +substitutes) <code>Angle turn along the Indifference Curve</code></li> +</ul> +<ol> +<li> +<p>Income Effect on Labour Supply Curve +Labour Supply Curve is Backward Sloping Curve</p> +<ul> +<li>Substitution is upward slope part</li> +</ul> +<p><em>you have to work hard coz you earn more now</em></p> +<ul> +<li>Income Effect is reverse slope part<br></li> +</ul> +<p><em>if you become rich, then you wanna party and do play!</em></p> +</li> +</ol> +</li> +<li> +<p>Indifference Curves</p> +<ul> +<li>Curve that yields same total utility</li> +</ul> +<p><em>consumer is indifferent between any points on curve</em></p> +<ul> +<li>Diminishing MRS (law of diminishing utility)</li> +</ul> +<p><em>that&rsquo;s why it slopes asymptoetically</em></p> +<ul> +<li>Chooses highest curve touching budget constraint</li> +</ul> +<p><em>slope of indifference curve = slope of budget line</em></p> +</li> +</ol> +<h3 id="7---production-process-behavior-of-profit-maximizing-firms">7 - Production Process: behavior of Profit-Maximizing Firms</h3> +<p>Analagous to Chapter 6 but slightly different. Production process is in +terms of inputs and outputs. K(capital)-L(labour) is the new +Price-Quantity with MRTS slope</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/costmineq.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/costmineq.jpg" width="auto" height="auto" +alt="Cost Min Eq"/></a></p> +<ol> +<li> +<p>Behavior of Profit Maximizing Firms</p> +<ul> +<li>how much output to supply</li> +<li>how to produce that output</li> +<li>how much of each input demand</li> +</ul> +<ol> +<li> +<p>Profit and Economic Costs</p> +<ul> +<li>Total Revenue, Total Cost, Economic Profit</li> +<li>Most Important factor of production for opportunity cost = +capital</li> +<li>Rate of return : annual net income % of total income +(breaks into shares?) so it&rsquo;s just enough to keep owners happy +(like risk-free bonds)</li> +<li>Normal Rate of Return = zero profit equilibrium point</li> +<li>Input Type +<ul> +<li>Fixed</li> +<li>Variable</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Short Run and Long Run</p> +<ul> +<li>short run : fixed rate of production (no scaling up/down or +no exiting/entering)</li> +<li>long run : firms can choose to expand or contract</li> +</ul> +</li> +<li> +<p>Others-</p> +<blockquote> +<p>See Optimal method of production chart in CH-8 below</p> +</blockquote> +</li> +</ol> +</li> +<li> +<p>Production Process</p> +<p>Total, Average and Normal Product of Labour. See Curves in CH-8</p> +<ul> +<li> +<p>Equivalent-Law of diminishing returns (MP of Labour)</p> +</li> +<li> +<p>3 Stages of TP, AP, MP Curve-</p> +<ol> +<li>MP reaches maximum (double derivative 0)</li> +<li>AP = MP</li> +<li>MP = 0 and thus TP is maximum</li> +</ol> +</li> +</ul> +</li> +<li> +<p>Equivalent behavior (Others)</p> +<table> +<thead> +<tr> +<th>Producer Market</th> +<th>Consumer Market</th> +</tr> +</thead> +<tbody> +<tr> +<td>Isoquant</td> +<td>Indifference Curve</td> +</tr> +<tr> +<td>Isocost</td> +<td>Budget Constraint</td> +</tr> +<tr> +<td>X</td> +<td>Labour(L)</td> +</tr> +<tr> +<td>Y</td> +<td>Capital</td> +</tr> +<tr> +<td>MRTS</td> +<td>MRS</td> +</tr> +<tr> +<td>Cost-Min Eq</td> +<td>Utility-Max Eq</td> +</tr> +</tbody> +</table> +</li> +</ol> +<h3 id="8---short-run-costs-and-output-decisions">8 - Short Run Costs and Output Decisions</h3> +<p>TC (overhead), TFC, TVC, AFC, AVC, MC (=MVC), AP, MP See Curves.</p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/shortruncosts.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/shortruncosts.jpg" width="auto" height="auto" +alt="Table 8.4 Short Run Costs of Firm"/></a></p> +<ol> +<li> +<p>Types of Costs</p> +<p>Main Types Costs</p> +<ul> +<li>Fixed Cost</li> +<li>Variable Cost</li> +</ul> +<p>Analyze costs as</p> +<ul> +<li>Total Cost</li> +<li>Average Cost = $\frac{TC}{Q}$ where Q is quantity at that time</li> +<li>Marginal Cost = increase in TC for production of 1 more unit +output</li> +</ul> +</li> +<li> +<p>Cost Curves</p> +<ul> +<li>Variable costs depends on - +<ul> +<li>techniques of production</li> +<li>prices of inputs required</li> +</ul> +</li> +<li>Plot has <code>x-axis = Output and y-axis = type of cost</code></li> +</ul> +<ol> +<li> +<p>Fixed Cost Curves</p> +<p>Spreading Overhead</p> +<ul> +<li>Fall of total fixed cost by increasing quantity (small cost +per quantity; down asymptoete)</li> +<li>TFC still remains line parallel x-axis(Output)</li> +</ul> +</li> +<li> +<p>Variable Cost Curve</p> +<p>Increases with quantity</p> +</li> +<li> +<p>Marginal Cost Curve</p> +<p><em>slight decrease till max then increase all the way</em></p> +<ul> +<li>Marginal Cost increases with output (since no change in +scale of production</li> +<li>diminshing returns = increasing marginal cost</li> +</ul> +</li> +<li> +<p>Notes on Curves</p> +<ul> +<li>Marginal Costs is slope of TVC</li> +<li>The dip point (minima) of MC is the inflection point of TVC</li> +<li>MC cuts AVC at min of AVC and ATC at min of +ATC</li> +<li><strong><a href="https://www.khanacademy.org/economics-finance-domain/ap-microeconomics/production-cost-and-the-perfect-competition-model-temporary/short-run-production-costs/v/graphical-impact-of-cost-changes-on-marginal-and-average-costs"target="_blank" rel="noopener">Short Run Curves</a></strong></li> +</ul> +</li> +</ol> +<p><em>Where MC crosses is where others stop falling</em></p> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/POE_Curves.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/POE_Curves.jpg" width="auto" height="auto" +alt="Product and Cost Curves"/></a></p> +</li> +<li> +<p>Output Decisions and Summary</p> +<ul> +<li>Marginal Revenue Curve and Demand Curve identical in a +<strong>perfectly competetive market</strong></li> +<li>Profit Maximizing- Take $MR = MC$ +(where Price from Demand Curve cuts MC for competetive)</li> +<li><em>Firms will produce only as long as MR &gt; MC</em></li> +<li><em>Profit Maximizing Rule is the Loss Minimizing Rule</em></li> +</ul> +</li> +<li> +<p>Types of Questions-</p> +<ul> +<li>Table-based question (fill the table of TFC, TVC, AVC, MC&hellip;.)</li> +<li>Equation of TC in Q given</li> +<li>Sketch graphs for different situations</li> +</ul> +</li> +</ol> +<h3 id="9---long-run-costs-and-output-decisions">9 - Long Run Costs and Output Decisions</h3> +<ul> +<li>Terms +<ul> +<li>Shutdown Point TR &lt; TFC (or P &lt; AVC)</li> +<li>Long term contraction if TR &lt; TC (Contracts and then exits)</li> +<li>Operating Profit: TR - TVC (may be losses!)</li> +<li>Economic Profit Vs Accounting Profit at 0-profit point</li> +</ul> +</li> +</ul> +<h5 id="long-run-average-cost-curve">Long Run Average Cost Curve</h5> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/lrac.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/lrac.jpg" width="auto" height="auto" +alt="LRAC"/></a></p> +<p>The graph is split into 3 parts-</p> +<ol> +<li>Economies of Scale (Beginning Drop) : More Cost but More Quantity = Less ATC</li> +<li>Constant Returns (Constant Line at Min) : Same as short run</li> +<li>Diseconomies of Scale (Upward after Dip) : More Cost but not much more Quantity = More ATC</li> +</ol> +<h5 id="long-run-industry-supply-curve">Long Run Industry supply Curve</h5> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/lrisdecreasing.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/lrisdecreasing.jpg" width="auto" height="auto" +alt="LRIS in Decreasing Cost Industry"/></a></p> +<p>Decreasing Cost Industry Above</p> +<p>LRIS Calculation</p> +<ul> +<li>Demands expands to D2</li> +<li>Prices Rise to P1'</li> +<li>New Firms enter and supply shifts to SRS3</li> +<li>Price goes down to P3</li> +<li>Based on decrease in price (Decreasing cost) or increase (Increasing Cost)</li> +<li>Since P3 &lt; P0 so LRAC decreases and Decreasing Cost-Ind</li> +</ul> +<h3 id="10---labour-and-land-markets">10 - Labour and Land Markets</h3> +<ul> +<li>Shifts in Input Demand Curves +<ul> +<li>Demand for Outputs</li> +<li>Quanitity of Complementary and Substitute</li> +<li>Price of other inputs</li> +<li>Technology Change</li> +</ul> +</li> +<li>Profit Maximizing</li> +</ul> +<h5 id="labour-market">Labour Market</h5> +<ul> +<li>Derived Demand: Indirect demand like Labour not Goods and Services</li> +<li>Marginal Product of Labour: Additional Output produced by adding another unit of labour</li> +<li>Marginal Product of Labour Increases then decreases. e.g- +<blockquote> +<p><em>Too many cooks, spoil the broth&hellip;.. too few cooks, can&rsquo;t make the broth?</em></p> +</blockquote> +</li> +<li>Marginal Revenue Product MRP(L): Price of output X MR(L)</li> +<li>Market Labour Supply Curve</li> +<li>Profit-Maximizing (from MR = MC): MRP(L) = Wage(W)</li> +<li>In perfectly competetive firms, combine all MRP(L) have common price of output (see questions)</li> +</ul> +<h5 id="land-market">Land Market</h5> +<ul> +<li>Demand Determinant: Price determined exclusively by its demand. Supply is Fixed (perfectly inelastic). e.g - Land</li> +<li>Pure Rent: Return to factor of production with fixed supply</li> +</ul> +<h3 id="11---capital-market-and-investment-decisions">11 - Capital Market and Investment Decisions</h3> +<h3 id="market-structures-and-151">Market Structures (and 15.1)</h3> +<ul> +<li>Perfect Competition (E = $\infty$)</li> +<li>Monopolistic Competition (Not Monopoly-Like!)</li> +<li>Oligopoly</li> +<li>Monopoly (E = 0)</li> +</ul> +<h4 id="151-monopolistic-competition---industry-characterstics">15.1 Monopolistic Competition - Industry Characterstics</h4> +<ul> +<li>Large no. of firm</li> +<li>No barriers to entry</li> +<li>Product Differentiation</li> +</ul> +<h3 id="13---monopoly-and-antitrust">13 - Monopoly and Antitrust</h3> +<ul> +<li> +<p>Marginal Revenue -</p> +<ul> +<li>For Monopoly, TR is max when MR = 0</li> +<li>For Competetive Firm, MR = price (varied by market)</li> +<li>MR has slope less (more -ve) coz Additional Output =&gt; Lower Price for more demand.</li> +</ul> +</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/monopolycomparison.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/monopolycomparison.png" width="auto" height="auto" +alt="Monopoly Firm Welfare Loss and Prices"/></a></p> +<ul> +<li> +<p>Pricing and Ineffeciencies-</p> +<ul> +<li>Firm produces Q at $MR = MC$ (at Q1) but prices Demand Curve (P1)</li> +<li>Leads to Dead Weight Loss (Allocated Ineffeciency) - unecessarily less customers = A-B-C Triangle</li> +<li>Consumer Surplus - Lost high pricing for rich customers = Triangle P1-A-F</li> +<li>Producer Surplus - Price of good higher than cost-to-manufacture = Area of E-C-P1-A</li> +</ul> +</li> +<li> +<p>Barriers to Entry -</p> +<ul> +<li>Economies of Scale - Very Large (or high advertisement costs) +(Predatory Pricing &hellip;See Oligopoly)</li> +<li>Patents - (Mostly Medicine Companies)</li> +<li>Government Rules - Laws favouring Gov Monopolies or through Lobbying</li> +<li>Ownership of Exclusive Capital - Own Diamond Mines etc.</li> +<li>Network Externalities - Dependant on the popularity of the product</li> +</ul> +</li> +<li> +<p>Social Costs of Monopoly -</p> +<ul> +<li>Deadweight Loss (Depriving Customers of the product)</li> +<li>Rent-Seeking behavior (through lobbying and building Barriers)</li> +</ul> +</li> +</ul> +<h3 id="14---oligopoly">14 - Oligopoly</h3> +<ul> +<li> +<p>Measures for Oligopoly</p> +<ul> +<li>HHI = Sum of Squared-Market-Shares (&gt;1,800 for High)</li> +<li>CR (Conc. Ratio) = % Share of top n companies (&gt;80% for High)</li> +</ul> +</li> +<li> +<p>Types of Oligopoly</p> +<ul> +<li>Non-Collusive +<ul> +<li>Cournot&rsquo;s Duopoly</li> +</ul> +</li> +<li>Collusive (Can be Tacit or Non-Tacit) +<ul> +<li>Price Leadership</li> +<li>Cartels and Collusion</li> +</ul> +</li> +</ul> +</li> +<li> +<p>Price Leadership - Dominant Firm decides market price for smaller firm.</p> +</li> +<li> +<p>Predatory Pricing - Temporarily selling at artificially low price to kill competitors</p> +</li> +<li> +<p>Cartel Duopoly - Use like monopoly with $MR = MC_1 = MC_2$</p> +</li> +</ul> +<h4 id="cournots-model">Cournot&rsquo;s Model</h4> +<ul> +<li>Assumptions- Identical Firms with homogenous products</li> +<li>Response Func = Func of output of a Firm</li> +<li>Inverse Demand Func - price of product</li> +<li>Same Equilibrium for both firms</li> +<li>Steps to solve +<ul> +<li>Equate $MR = MC$ for each firm</li> +<li>Output of each firm as func of other firm (Response Func)</li> +<li>Intersection of Responses (Can be plotted) is the Nash Eq.</li> +</ul> +</li> +</ul> +<h4 id="game-theory">Game Theory</h4> +<ul> +<li>Dominant Strategy - Player has a strategy which is better <strong>irrespective</strong> of the other&rsquo;s solution</li> +<li>Nash Equilibrium - All players play their best strategy (Need not be dominant-dominant!)</li> +<li>Maximin Strategy - Low risk to maximize the min gain (opposed to minmax)</li> +<li>Tit-for-tat Strategy - Response Based Strategy</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/prisonersdilemma.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/prisonersdilemma.png" width="auto" height="auto" +alt="Prisoner&amp;rsquo;s Dilemma"/></a></p> +<ul> +<li>Prisoner&rsquo;s Dilemma (see above) - Dominant-Dominant is not Nash Eq. (or best strategies)</li> +</ul> +<h3 id="20---intro-to-macro">20 - Intro to Macro</h3> +<ul> +<li>Aggregate: To refer to sums only</li> +<li>Recession/Slump or Expansion/Boom</li> +<li>Depression = Long lasting depression</li> +<li>Business Cycle: One cycle of slight recession and expansion</li> +<li>Macroeconomic Concerns +<ul> +<li>Output Growth: Aggregate Output</li> +<li>Unemployment: unemployment rate not too low(business will not have labour) and not too high (jobless people)</li> +<li>Inflation and Deflation: +Mild Inflation rate is required - Hyperinflation: rapid and devaluation (Venzuala, Turkey..) - Deflation: Nobody buys anything = No businesses (Japan)</li> +</ul> +</li> +<li>Circular Flow Diagram between Household, Gov, Firms, World</li> +</ul> +<h4 id="class-notes-terms">Class Notes Terms</h4> +<ol> +<li>Goods and Services Market</li> +<li>Financial Markets - Trading Securities (equities</li> +<li>Money Markets</li> +</ol> +<p>Policies,</p> +<ol> +<li>Fiscal Policy - Tax &amp; Spending policies of Gov</li> +<li>Monetary Policies - +<ul> +<li>CRR: Cash Reserve Ratio (~4%)</li> +<li>SLR: Statutory Liquidity Ratio (~19.4%)</li> +<li>Repo Rate: Repurchase Agreement</li> +<li>Reverse Repo Rate: Reverse Repurchase Agreement</li> +</ul> +</li> +</ol> +<h3 id="21---measure-outputs-and-income-national">21 - Measure Outputs and Income (National)</h3> +<ul> +<li>Domestic Vs National : Region-based Vs Nationality(citizenship) based. +<em>See Honda Plant in Nagpur Example</em></li> +<li>Gross Vs Net: Without Depreciation Vs True with Depreciation</li> +</ul> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/gdpconversion.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/gdpconversion.jpg" width="auto" height="auto" +alt="Conversions for GDP"/></a></p> +<ul> +<li>Note that depreciation is mostly considered only for net domestic-private investments and not others</li> +</ul> +<h5 id="exclusions-to-gdp">Exclusions to GDP</h5> +<ul> +<li>Final Goods and Services only not intermediate</li> +<li>Value added method for calculating GDP</li> +<li>Exclude Used Goods - No new production or revenue generation (except rent)</li> +<li>Exclude Paper Transactions (like stocks and bonds but not broker fees) - No new production and only exchanges.</li> +<li>Only domestically owned production - Only region based and not on citizenship (see GNP).</li> +</ul> +<h5 id="expenditure-approach">Expenditure Approach</h5> +<p>$$GDP = C + I + G +(Ex -Im)$$</p> +<ul> +<li> +<p>Personal Consumption C: Household spending on goods and services</p> +<ul> +<li>Durable: Furniture, cars&hellip;<em>(longer lasting)</em></li> +<li>Nondurable: Food, clothing, gasoline..<em>(short lived)</em></li> +<li>Services: Doctors, Educations&hellip;</li> +</ul> +</li> +<li> +<p>Gross Private Domestic Investment I: Purchase of new capital like</p> +<ul> +<li>Residential: Houses etc.</li> +<li>Non-Residential: Machines, Tools, Plants</li> +<li>Change in Business Inventory: Goods produced for later sale in inventories</li> +</ul> +</li> +<li> +<p>Government Consumption and Gross Investment G: Goods (schools, government programmes, institutions&hellip;) and services (military salaries&hellip;)</p> +<ul> +<li>Central (or Federal)</li> +<li>State</li> +</ul> +</li> +<li> +<p>Net Exports (Ex - Im):</p> +<ul> +<li>Exports by the country shows production</li> +<li>Imports is production from other countries</li> +</ul> +</li> +</ul> +<h5 id="income-approach">Income Approach</h5> +<p>This approach to GDP is from National income which is in decreasing order of magnitude from,</p> +<ol> +<li>Compensation of Employees</li> +<li>Proprietors&rsquo; Income (Uncorporated businesses&rsquo; income)</li> +<li>Rental Income</li> +<li>Corporate Profits</li> +<li>Net Interest (!only interest from businesses)</li> +<li>Indirect Taxes minus subsidies</li> +<li>Net Business Transfers Payments by Businesses</li> +<li>Surplus from Government Institutions (often -ve unlike others)</li> +</ol> +<h6 id="national-income-to-personal-saving">National Income to Personal Saving</h6> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/nationalpersonal.jpg"><img loading="lazy" src="https://cheese-cracker.github.io/plots/nationalpersonal.jpg" width="auto" height="auto" +alt="National Income"/></a></p> +<h5 id="nominal-vs-real-gdp">Nominal Vs Real GDP</h5> +<ul> +<li>Real GDP = Nominal GDP adjusted for price change</li> +<li>Real Vs Nominal Output</li> +<li>Fixed-Weight Procedure: Prices in base year as weights for reference</li> +<li>GDP Deflator Method - Using series of % changes to measure overall price</li> +<li>Problems of fixed-weight procedure</li> +</ul> +<h5 id="limitations">Limitations</h5> +<ul> +<li>GDP does not reflect crime rate, increase in leisure time, pollution, domestic work and social ill.</li> +<li>Informal Economy - illegal transactions and tax evasion</li> +<li>Gross National Income per Capita as measure</li> +</ul> +<h3 id="251-2---money-and-banks">25(.1, .2) - Money and Banks</h3> +<p><strong><a href="https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/banking-and-money"target="_blank" rel="noopener">Khan Academy - Money and Banking</a></strong></p> +<p>Money as,</p> +<ol> +<li>Medium of Exchanges (<em>Not like barter, where we trade goods like cocoa</em>)</li> +<li>Store of value - Asset that can be used to transport purchasing power (<em>you can save for now and still spend later</em>)</li> +<li>Unit of account (<em>compare price of pizza and banana</em>)</li> +</ol> +<ul> +<li> +<p>Commodity Monies - Using cigerretes / Ramen as money in Jails.</p> +</li> +<li> +<p>Fiat Money / Token Money - Money that is intrinsically useless (<em>paper of rupee notes aren&rsquo;t useful</em>)</p> +</li> +<li> +<p>Legal tender - What RBI says can be accepted as &lsquo;money&rsquo; (ONLY currency!) +<em>see 51% torn part of dollar bill is legal tender in US</em></p> +</li> +<li> +<p>Currency Debasement - Hyperinflation of currency value due to too much supply of currency (<em>zimbabwe, post-war Germany, Venzuala&hellip;</em>)</p> +</li> +<li> +<p>Measuring Money Supply? +Money Supply = Currency + Deposits</p> +</li> +<li> +<p>Types of Money</p> +<ul> +<li>M1 = Currency + Demand Deposits + Other Deposits</li> +<li>M2 = M1 + Saving Deposits with Post Office</li> +<li>M3 = M1 + Time Deposits with Bank ( Most Useful )</li> +<li>M4 = M3 + Total Deposits with Post Office Saving Organization (excluding NSC)</li> +</ul> +</li> +</ul> +<h4 id="creation-of-money-by-banks">Creation of Money by Banks</h4> +<p><a target="_blank" rel="noopener noreferrer" +href="https://cheese-cracker.github.io/plots/creationofmoney.png"><img loading="lazy" src="https://cheese-cracker.github.io/plots/creationofmoney.png" width="auto" height="auto" +alt="Creation of Money by Banks"/></a></p> +<p>(<strong>See Table 25.3 of Textbook for better understanding</strong>)</p>Graphs and Networkshttps://cheese-cracker.github.io/posts/graphsnetworks/Sun, 10 Mar 2019 00:00:00 +0000https://cheese-cracker.github.io/posts/graphsnetworks/<h3 id="list-of-algorithms">List of Algorithms</h3> +<ol> +<li> +<p>Minimum Spanning Trees</p> +<ul> +<li>Krusikal&rsquo;s (Any point but min with no cycle)</li> +<li>Prim&rsquo;s (From starting point)</li> +</ul> +</li> +<li> +<p>Graph Traversal Techniques</p> +<ul> +<li>BFS</li> +<li>DFS</li> +<li>Djkstra&rsquo;s Shortest Path</li> +<li>Apply DFS for checking cut vertex</li> +</ul> +</li> +<li> +<p>Eulerian/Hamiltonian Graphs</p> +<ul> +<li>Eulerian Graph even degree</li> +<li>Fleury&rsquo;s Algorithm</li> +<li>Closure of Graph</li> +<li>Sufficient conditions of Hamiltonian Graph (and Restricted +Hamiltonian Algo)</li> +</ul> +</li> +<li> +<p>Travelling Salesman Problem</p> +<ul> +<li>TSP1- From weight matrix, draw tables</li> +<li>TSP2 - Take min span, DFS from leaf node and join all endpoints</li> +</ul> +</li> +<li> +<p>Network Flow Algo - MaxFlow Mincut</p> +</li> +</ol> +<h3 id="resources">Resources</h3> +<ul> +<li><a href="https://github.com/mrpandey/d3graphTheory"target="_blank" rel="noopener">D3 Graph Theory</a></li> +<li>Algebraic Graph Theory Courses by <a href="http://www.cs.yale.edu/homes/spielman/"target="_blank" rel="noopener">Dan Spielman</a> and his <a href="https://youtu.be/CDMQR422LGM"target="_blank" rel="noopener">Miracles video</a></li> +<li><a href="https://www.youtube.com/playlist?list=PLdWX5TZJp5AbxTuiLuNc-wsnbp8Q1ajBy"target="_blank" rel="noopener">Spectral Graph Theory Course</a> and sources from <a href="http://www.cs.yale.edu/homes/spielman/eigs/"target="_blank" rel="noopener">Dan&rsquo;s Course</a></li> +<li><a href="http://www.cs.yale.edu/homes/spielman/eigs2/papers.html"target="_blank" rel="noopener">Recommended Papers for Eigenvalues of Graphs with applications by Dan</a></li> +</ul> +<h3 id="proofquestion-hints">Proof/Question Hints</h3> +<div class="mermaid"> +graph TD +A[Proof Types in Graphs and Networks] --> B[Contradiction] +A --> C[Construction or deletion] +A --> D[Induction] +</div> +<p><em>Induction is by far the most popular. Contradiction is sometimes used with a construction</em></p> +<ul> +<li>Take Longest path in graph (delete or not)</li> +<li>Check type of cycles in graph</li> +<li>Adjacency Matrix, Caylay Matrix, Graph Laplacian and Incidence Matrix based approach</li> +<li>Number of components more or less (cut-edge, hamiltonian&hellip;)</li> +<li>If cycle length 2, Bipartite</li> +<li>Planar = draw planar drawing</li> +<li>Non-planar +<ul> +<li>Euler&rsquo;s Formula or 5-degree or variants(girth-analysis)</li> +<li>Check any Subgraph non-planar</li> +<li>Kuratowski and/or Wagner</li> +</ul> +</li> +<li>If no triangles, then relation between q &amp; r (where q unrestricted)</li> +</ul> +<h3 id="list-of-theorems">List of Theorems</h3> +<ol> +<li>Isomorphic if complement is isomorphic</li> +<li>Every tree (with &gt;= 2 vertices) has &gt;=2 leaves</li> +<li>Simple G with n vert, k components, has atleast n-k edges</li> +<li>Characterstics of Tree</li> +<li>If G has walk, G contains path</li> +<li>Every closed odd walk contains odd cycle</li> +<li><strong>Bipartite iff no odd cycle</strong></li> +<li>Kirchoff&rsquo;s Matrix-Tree Thm</li> +<li>Caylay Thm</li> +<li>Euler even degree (and disjoint cycle) thm</li> +<li>Whitney&rsquo;s Thm</li> +<li>Euler&rsquo;s Planar Graph Formula and Thm</li> +<li>Max Planar Graph thms using Girth Formula</li> +<li>Planarity of Graphs - Kuratowski and Wagner Thms</li> +<li>Graph Coloring +<ul> +<li>Simple graph with K-blocks has max chromatic no. of blocks</li> +<li>For any simple graph, max chromatic no. &lt; max degree + 1</li> +<li>Five Color Theorem (Step towards of 4 Color Thm)</li> +</ul> +</li> +</ol> +<h3 id="week-wise-review">Week Wise Review</h3> +<h4 id="week-1">Week 1</h4> +<ul> +<li>Types of Graphs</li> +<li>Graphical Sequence Algorithm</li> +<li>Degree Sum and Edges relation</li> +<li>Neighbourhood (open/close)</li> +<li>k-regular graphs</li> +<li>Isomorphic or not</li> +<li>Subgraphs and Induced Subgraphs</li> +</ul> +<h5 id="types-of-graphs">Types of Graphs</h5> +<ul> +<li>Null</li> +<li>Complete</li> +<li>Bipartite</li> +<li>Complete Bipartite</li> +<li>Cycle</li> +<li>Path</li> +<li>(Graphs n = 1, 2 vertices)</li> +<li>(self-compliment Graphs)</li> +<li>(planar graphs)</li> +</ul> +<h4 id="week-2">Week 2</h4> +<div class="mermaid"> +graph TD +A[Walk] --> B[Trails] +A --> C[Closed Walk] +B --> D[Paths] +B --> E[Circuits] +C --> E +E --> F[Cycle] +</div> +<p>See Examples for each Case!</p> +<ul> +<li> +<p>walk :: anything from start_vertex to end_vertex</p> +</li> +<li> +<p>trail :: edges distinct</p> +</li> +<li> +<p>path :: vertices distinct</p> +</li> +<li> +<p>closed walk :: start_vertex = end_vertex</p> +</li> +<li> +<p>Connectivity, Components</p> +</li> +<li> +<p>Cut-Edge, Cut-Vertex</p> +</li> +<li> +<p>Contraction of graph, minor of a graph (Contraction)</p> +</li> +<li> +<p>Weakly/Strongly Connected</p> +</li> +</ul> +<h5 id="isomorphic-graphs">Isomorphic Graphs</h5> +<div class="mermaid"> +graph LR +A[Degree Sequence] --> B[Degrees of connection of those vertices] +B --> C[Find Points Mapping] +</div> +<ul> +<li>Odd/Even Cycles and/or biparitite</li> +<li>Compliment Isomorphism</li> +</ul> +<h4 id="week-3">Week 3</h4> +<ul> +<li>Trees, Forests (star, path)</li> +<li>Represent arithematical equations graphically</li> +<li>Every tree has k leaves</li> +<li>G contains atleast $E - V + 1$ cycles</li> +<li>Characterstics of Tree (see proof)</li> +<li>distance: shortest u,v path in tree (don&rsquo;t count start!)</li> +<li>eccentricity: max of distance between all u-v path for u</li> +<li>diameter: max of eccentricites of all vertices (farthest two points)</li> +<li>center: point with min eccentricity</li> +<li>radius: min of eccentricities (or eccentricity of center)</li> +<li>rooted trees, ordered rooted trees, parent, child, ancestor, descendants, siblings</li> +<li>Binary trees, Regular binary trees (deg 3 or less)</li> +</ul> +<h4 id="week-4">Week 4</h4> +<ul> +<li>wiring, spanning trees, spanning forests</li> +<li>Three main types of Matrices +<ul> +<li>Adjacency Matrix: (V, V) based and shows no. of edges between each pair of vertices (1 or 0 only for simple graphs)</li> +<li>Incidence Matrix: which edges are incident for each vertex (V, E)</li> +<li>Graph Laplacian: Degree of vertices along diagonal. -1 wherever edge. 0 wherever no edges. See <a href="https://youtu.be/PFE3VMsR2AU"target="_blank" rel="noopener">graph laplacian video</a></li> +</ul> +</li> +<li>Kirchoff&rsquo;s Matrix-Tree Thm</li> +<li>Minimum Cost Spanning Trees, Weight Func</li> +<li>Krusikal and Prim&rsquo;s Min Spanning Tree finding algo</li> +</ul> +<h4 id="week-5">Week 5</h4> +<ul> +<li>Edge Based +<ul> +<li>eulerian trail( <em>n-2 even 2 odd</em> )</li> +<li>eulerian circuit (<em>all even</em>)</li> +<li>eulerian graph (contains eulerian circuit)</li> +</ul> +</li> +<li>Euler-Path finding algorithm (and proof of even degree)</li> +<li>Fleury&rsquo;s Algo</li> +<li>Hamiltonian path, hamiltonian graph, sufficient conditions for hamiltonian graph</li> +</ul> +<p><em>Hamiltonian Cycle is just another way of saying subgraph Cn!</em></p> +<ul> +<li>Hamiltonian closure and finding hamiltonian graphs</li> +<li>TSP1 and TSP2 graph algos</li> +</ul> +<h4 id="week-6">Week 6</h4> +<ul> +<li>Connectivity, edge cuts, k-edge-connected(returns bool), edge-connectivity (returns int connectivity)</li> +<li>Vertex Connectivity, Vertex-Cut Set, min degree, max degree</li> +<li>Whitney&rsquo;s Thm</li> +</ul> +<h4 id="network-flows-and-related-topics-week-before-midsem">Network Flows and Related Topics (Week before Midsem)</h4> +<ul> +<li>Flow - flow, capacity, source, sink</li> +<li>Maximum Flow Problem :: Ford-Fulkerson Algo, Residual Graph, Augmented Paths</li> +<li>Min Cut Problem :: S-T cut, Cap(A, B), Cut where Residual Graph paths end</li> +<li>Flow value Lemma (same as out of source)</li> +<li>Max-Flow Min-Cut Thm +$$ val(f) = \sum*{out\ of\ a} f(e) - \sum*{in\ to\ a} f(e) = \sum_{out\ of\ a} f(e) = cap(A, B)$$</li> +<li>Disjoint Paths - Ford-Fulkerson with capacities all 1</li> +<li>Menger&rsquo;s Thm - Min no. of vertices required to be removed to disconnect u-v path</li> +<li>k-connected k-vertex disjoint paths</li> +</ul> +<h6 id="blocks-and-block-diagrams">Blocks and Block Diagrams</h6> +<div class="mermaid"> +graph TD +A[Find all cut vertices] --> B[Mark out Blocks such that one not contained in other] +B --> C[Draw Graph with block dots and cut vertex dots] +</div> +<h4 id="week-7">Week 7</h4> +<ul> +<li>Planar Graphs, Planar Embeddings</li> +<li>Planar Drawing</li> +<li>Face, Boundary</li> +<li>Euler&rsquo;s Graph Formula p - q + r = 2</li> +<li>Maximal Planar Graphs and Girth Formula +$$ \frac{g(n-2)}{g-2}$$</li> +<li>Homeomorphic and Subdivisions</li> +<li>Kuratowski and Wagner Thms</li> +<li>Duality / Dual Plane</li> +<li>Crossing Number</li> +</ul> +<h6 id="kuratowskiwagner-thm">Kuratowski/Wagner Thm</h6> +<div class="mermaid"> +graph LR; +A[Indentify partition of vertices] --> B[Delete Edges to trim down to Bipartite]; +</div> +<h4 id="week-8">Week 8</h4> +<ul> +<li>Chromatic Number of Graph, k-colorable</li> +<li>Chromatic No. of Blocks thm and max degree + 1 thms</li> +<li>Booke&rsquo;s Thm Neither Complete nor odd cycle &lt; max degree</li> +<li>5 Color Thm (Towards 4-color)</li> +<li>Edge Chromatic No. and Thm for Bipartite graphs and simple graph</li> +</ul> +<h4 id="graph-numbers-and-their-relations">Graph Numbers and their relations</h4> \ No newline at end of file diff --git a/tags/math/index.xml b/tags/math/index.xml index 0b5920c..cc72a86 100644 --- a/tags/math/index.xml +++ b/tags/math/index.xml @@ -1,4 +1,180 @@ -Math on Futuristic ideashttps://cheese-cracker.github.io/tags/math/Recent content in Math on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Math on Futuristic ideashttps://cheese-cracker.github.io/tags/math/Recent content in Math on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/mentalmodels/index.html b/tags/mentalmodels/index.html index dc7804b..d2cb303 100644 --- a/tags/mentalmodels/index.html +++ b/tags/mentalmodels/index.html @@ -3,5 +3,5 @@ -

Mentalmodels

Mentalmodels

\ No newline at end of file diff --git a/tags/mentalmodels/index.xml b/tags/mentalmodels/index.xml index 872b714..ee61c81 100644 --- a/tags/mentalmodels/index.xml +++ b/tags/mentalmodels/index.xml @@ -1,4 +1,180 @@ -Mentalmodels on Futuristic ideashttps://cheese-cracker.github.io/tags/mentalmodels/Recent content in Mentalmodels on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Mentalmodels on Futuristic ideashttps://cheese-cracker.github.io/tags/mentalmodels/Recent content in Mentalmodels on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerThu, 11 Apr 2024 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/numericalmethods/index.xml b/tags/numericalmethods/index.xml index fdde8ac..019f890 100644 --- a/tags/numericalmethods/index.xml +++ b/tags/numericalmethods/index.xml @@ -1,4 +1,180 @@ -Numericalmethods on Futuristic ideashttps://cheese-cracker.github.io/tags/numericalmethods/Recent content in Numericalmethods on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Numericalmethods on Futuristic ideashttps://cheese-cracker.github.io/tags/numericalmethods/Recent content in Numericalmethods on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center"> diff --git a/tags/signalprocessing/index.xml b/tags/signalprocessing/index.xml index 081c3f2..d8a653d 100644 --- a/tags/signalprocessing/index.xml +++ b/tags/signalprocessing/index.xml @@ -1,4 +1,180 @@ -Signalprocessing on Futuristic ideashttps://cheese-cracker.github.io/tags/signalprocessing/Recent content in Signalprocessing on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> +Signalprocessing on Futuristic ideashttps://cheese-cracker.github.io/tags/signalprocessing/Recent content in Signalprocessing on Futuristic ideasHugo -- gohugo.ioen©2024 cheese-crackerWed, 26 Jan 2022 00:00:00 +0000Money macrohttps://cheese-cracker.github.io/posts/money-macro/Thu, 11 Apr 2024 00:00:00 +0000https://cheese-cracker.github.io/posts/money-macro/<h2 id="what-is-money-">What is Money ?</h2> +<p>An oversimplified view of the economic system goes like the following:</p> +<ul> +<li>When Fed increases the money supply, it means banks can now lend more money so loans are provided at a lower rate of interest to companies and people. A common depiction in pop culture is Powell going brrr with the money printer.</li> +<li>When Fed reduces the money supply through <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Quantitative Tightening</a>, banks find it harder to lend money and thus provide loans at a much higher rate.</li> +</ul> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/money_printer_go_brr.jpg" alt="Money Printer going brrrr during 2020"> </img> +<p><small>Meme: Money printer going brrrr during 2020</small></p> +</div> +<p>With the Fed raising the fed funds rate (AKA interest rate) and selling bonds (or letting bonds expire?), they are kind of deprinting money from the economy.</p> +<p>For a better idea of this, I would request you to watch:</p> +<ul> +<li><a href="https://www.khanacademy.org/economics-finance-domain/ap-macroeconomics/ap-financial-sector/definition-measurement-and-functions-of-money-ap/v/money-supply-m0-m1-and-m2"target="_blank" rel="noopener">Khan Academy: M0, M1, M2, M3 Money Supply</a> and other notes</li> +<li><a href="https://youtu.be/mzoX7zEZ6h4"target="_blank" rel="noopener">Coldfusion - What is money</a></li> +</ul> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=unitedstamonsupm1&v=202401240217V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe> +<br /> +<small><a href='https://tradingeconomics.com/united-states/money-supply-m1'>tradingeconomics.com</a>: Graph showing M1 money supply of dollars. Essentially, the amount of money liquid in the banks. </small> +</div> +<p>Every other central bank in the world, is indirectly linked to the Feds decision of money supply. +This is due to the fact that the dollar is the reserve currency.</p> +<p>How was USD made the reserve currency?</p> +<ol> +<li>1950s: Brenton Woods agreement made most of the major countries at the time use USD for trade.</li> +<li>Dollar was to be backed by gold. This lasted till the 1970s</li> +<li>1970s: Dollar was removed from the gold standard thus causing a bubble and unprecedented growth in the 1980s.</li> +<li>Current: The USD is now indirectly backed by a (Military + Petroleum) alliance, &ldquo;Petrodollar&rdquo; * +which helps prevent the financial bubble from collapsing.</li> +</ol> +<div align="center"> +<img height="600" src="https://cheese-cracker.github.io/plots/money/petrodollar_recycling.png"> </img> +<p><small> <a href="https://medium.com/@harbdulharkeem_34944/bitcoin-and-the-petrodollar-economy-85d7387b30ad"target="_blank" rel="noopener">Medium</a>: An oversimplified example of <a href="https://www.imf.org/en/News/Articles/2015/09/28/04/53/sp032306a"target="_blank" rel="noopener">petrodollar recycling</a></small></p> +</div> +<p>*<em>For obvious reasons, military-oil alliances are not particularly discussed in economic textbooks. However, folks can draw their own inferences by reading <a href="https://en.wikipedia.org/wiki/Petrodollar_recycling#Petrodollar_warfare"target="_blank" rel="noopener">news sources</a> and from the reasons for the US interventions in Libya, Iraq etc.</em></p> +<h2 id="why-is-analyzing-moneyfinancial-instruments-important">Why is analyzing money/financial instruments important?</h2> +<p>Throughout history, innovations in financial instruments and institution have tremendously boosted the growth of countries in the past.</p> +<p>For example, Innovation of the <a href="https://en.wikipedia.org/wiki/Financial_history_of_the_Dutch_Republic#The_Stock_Market"target="_blank" rel="noopener">stock market in Holland</a> lead to the Dutch East India Company. +And the financial crash of the stock market in holland, lead to the boom in the London Stock Exchange at the time. +Subsequently, boosting the Britain which went on to colonize much of the world. +However, the sudden growth with lack of ethical values, meant that the British companies would cause exploitation and harm to the colonies to keep the profits rolling (and to prevent the valuation bubble from collapsing).</p> +<p>Analyzing the major economic bubbles from the past we have:</p> +<ul> +<li>1630s <a href="https://en.wikipedia.org/wiki/Tulip_mania"target="_blank" rel="noopener">Dutch Tulip Mania</a></li> +<li>1700s Mississippi Company and South Sea Company</li> +<li>1930s <a href="https://en.wikipedia.org/wiki/Great_Depression"target="_blank" rel="noopener">Great Depression</a></li> +<li>1987 Black Monday</li> +<li>2000 Dot-com Bubble</li> +<li>2008 <a href="https://en.wikipedia.org/wiki/Subprime_mortgage_crisis"target="_blank" rel="noopener">Subprime Mortgage Crises</a></li> +<li>2022 <a href="https://en.wikipedia.org/wiki/Cryptocurrency_bubble"target="_blank" rel="noopener">Crypto Bubble</a> and <a href="https://en.wikipedia.org/wiki/Chinese_property_sector_crisis_%282020%E2%80%93present%29"target="_blank" rel="noopener">Chinese Property Crises</a></li> +</ul> +<p>Numerous, <a href="https://dariusforoux.com/stock-market-cycles/"target="_blank" rel="noopener">sector-wise stock market bubbles</a> keep forming from time to time.</p> +<p>Financial innovation represents the forefront of enabling new technologies, which is why most countries try to adopt new innovations in the financial system.</p> +<p>Some financial innovations that lead to faster money transfers in the recent past, that are slowly being adopted across countries include:</p> +<ul> +<li>Card-based payment networks: VISA / Mastercard (US), JCB (Japan), Rupay (India), UnionPay (China)</li> +<li>Fund-transfer among Banks: <a href="https://en.wikipedia.org/wiki/Real-time_gross_settlement"target="_blank" rel="noopener">Real-Time Gross Settlement</a>, <a href="https://en.wikipedia.org/wiki/Automated_clearing_house"target="_blank" rel="noopener">Automated Clearing House</a></li> +<li>Crossborder Payment Systems: SWIFT, CIPS (China), SFMS (Russia), SPFS (India), Wise, Visa B2B</li> +<li>Smartphone P2P payments apps: PayTM/PhonePe (UPI), CashApp/ApplePay, WeChat Pay / Alipay</li> +<li><a href="https://en.wikipedia.org/wiki/History_of_CBDCs_by_country"target="_blank" rel="noopener">CBDCs</a>: Digital Yuan, E-rupee</li> +</ul> +<p>Although controversial, the book <a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> provides useful examples of the financial bubbles in the past.</p> +<h2 id="incentive-schemes---why-is-it-needed">Incentive Schemes - Why is it needed?</h2> +<p>Money is a unique and extremely useful incentive scheme since it provides,</p> +<ol> +<li><strong>Store of Value</strong> - Intrinsic value provided by individuals/businesses can be quantitatively rewarded.</li> +<li><strong>Medium of Exchange</strong> - Rewards can be transferred.</li> +</ol> +<p>The likely fall of communism into capitalism in most countries like USSR and China, is perhaps due to the fact that there was no better incentive scheme to replace money. +Communism thus providing immense short-term gain for the first 10-15 years, possible failed to keep up with a robust incentive scheme like capitalism.</p> +<p>An insightful fictional case study is that of <a href="https://www.youtube.com/watch?v=SmBs5d_Ip60"target="_blank" rel="noopener">20th Century Motor Company</a> from the book Atlas Shrugged. It shows how a company could fail by providing incentives that seem morally right at first. Such systems indirectly reward people who exploit the <a href="https://www.investopedia.com/terms/t/tragedy-of-the-commons.asp"target="_blank" rel="noopener">tragedy of the commons</a> at the start, before the entire system slowly crumbles.</p> +<p>Clearly, money/currency is not the best indicator of driving innovation or maximizing overall happiness either.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/lvmh-vs-boeing.jpg" alt="companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing"> </img> +<p><small>companiesmarketcap.com: Luxury Goods Conglomerate LVMH Vs Aircraft Manufacturer Boeing</small></p> +</div> +A luxury goods conglomerate like LVMH which makes Louis Vuitton bags has a higher marketcap than Boeing, an aircraft manufacturer. Even though an aircraft manufacturer like Boeing is likely driving more innovation. In another sense, it could also mean <b>more top talent could be hired for driving sales of luxury handbags instead of designing future aircrafts</b>. +<br/> +So then, how do we well-distribute wealth and supercharge innovation? +<br/> +<h2 id="a-foray-into-ubi">A foray into UBI</h2> +<p>Is giving people free money or a <a href="https://www.investopedia.com/terms/b/basic-income.asp"target="_blank" rel="noopener">universal basic income</a>, a good idea?</p> +<p>Some flaws of this model would be:</p> +<ul> +<li>May ultimately lead to the same economic inequality without providing any public gain like better roads, public transport etc.</li> +<li>Also, all products consumed by the average citizen would go up in price leading directly to inflation in prices.</li> +<li>People who perform better or provide more value won&rsquo;t be adequately rewarded. (So, people may move to other countries/regions)</li> +<li>Lots of the money may be ultimately spent on pursuing short term gains/goods, instead of longer term gains that help the economy.</li> +</ul> +<p>A real life example of this is the COVID stimulus packages in the U.S. which acts sort of like UBI :</p> +<ul> +<li>Run a media campaigns and manipulate plebs to buy into unregulated crypto/NFT assets with the covid stimulus packages</li> +<li>Once pumped up, the rich person sells the crypto positions</li> +</ul> +<p>Increase in prices of daily goods is usually analyzed using the CPI Inflation rate chart.</p> +<div align="center"> +<img height="480" src="https://cheese-cracker.github.io/plots/money/cpi_constitutes.png" alt="Goods and Services under CPI"> </img> +<p><small> Investopedia: Goods and services under the CPI. CPI is usually a weighted average of the price increases in each of these goods and services.</small></p> +</div> +<div align="center"> +<iframe src='https://d3fy651gv2fhd3.cloudfront.net/embed/?s=cpi+yoy&v=202401111349V20230410&w=850&h=400&d1=20140101&d2=20240101&h=360&w=720' height='360' width='720' frameborder='10' scrolling='no'></iframe><br /> +<p><small> <a href='https://tradingeconomics.com/united-states/inflation-cpi'>tradingeconomics.com</a>: US CPI Inflation Rate 2014-2024 </small></p> +</div> +Clearly, the COVID stimulus packages (UBI) caused very high inflation rates. Ultimately, the increase in prices +of daily goods, ends up erasing all the benefits of providing money in the first place. +<p>Other approaches to UBI, like providing food rations and free education may work better in developing society.</p> +<h2 id="analyzing-money-in-a-better-way">Analyzing Money in a Better Way</h2> +<p>Economists would have much better techniques to analyze money but here I attempt to find simpler techniques to analyze money/incentive schemes.</p> +<p>Some ways to analyze money include,</p> +<ul> +<li>Utility Vs Time - Shows how an asset&rsquo;s price would age with time. A car would most likely be a depreciating asset with a sloping curve.</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/utility_vs_time_flight_ticket.png" alt="Utiltiy Time +Curves"> </img> +<p><small>Utility vs Time Curve for a flight ticket.</small></p> +</div> +<ul> +<li><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Rivalrousness Vs Excludability</a> - This article from vitalik&rsquo;s blog goes into much depth about it. +<ul> +<li>Rivalrousness: to what extent does one person enjoying the good reduce another person&rsquo;s ability to enjoy it?</li> +<li>Excludability: how difficult is it to prevent specific individuals, eg. those who do not pay, from enjoying the good?</li> +</ul> +</li> +</ul> +<div align="center"> +<img height="360" src="https://cheese-cracker.github.io/plots/money/vitalik_excludable_rivalrous.png" alt="Rivalrousness Vs +Excludablity Chart"> </img> +<p><small><a href="https://vitalik.eth.limo/general/2022/10/28/revenue_evil.html"target="_blank" rel="noopener">Vitalik&rsquo;s Blog</a>: Rivalrousness Vs Excludability Chart </small></p> +</div> +<ul> +<li>Different concepts of money in the future +<ul> +<li>Future money with expiry dates +<ul> +<li>Inflation already does this to some extent even today</li> +<li>Gift Cards and Vouchers already do this to some extent</li> +</ul> +</li> +<li><a href="https://a16zcrypto.com/posts/article/the-future-of-work-daos-crypto-networks/"target="_blank" rel="noopener">DAOs</a> - Corporations based on group contributions.</li> +</ul> +</li> +</ul> +<p>Broad ways to make money more useful could be by designing it to better, +A future form of money would be more optimal in,</p> +<ul> +<li><strong>Reducing <a href="https://en.wikipedia.org/wiki/Deadweight_loss"target="_blank" rel="noopener">deadweight loss</a></strong> or in simpler terms, preventing any supply-demand mismatch in in products bought using money. (e.g.- Food being wasted since no one to eat it)</li> +<li><strong>Encouraging use of sustainable products/methods</strong>. (Possibly, the original intent of <a href="https://www.blackrock.com/us/financial-professionals/tools/esg-360-methodology"target="_blank" rel="noopener">Blackrock&rsquo;s ESG scores</a> before being corrupted by politics?)</li> +<li><strong>Helping innovative/research companies</strong> receive adequate monetary funding till value can be +provided.</li> +</ul> +<h2 id="further-reading">Further Reading</h2> +<p>In the context of nations, governments tend to focus on other aspects of money like,</p> +<ul> +<li><a href="https://www.investopedia.com/terms/v/velocity.asp#toc-example-of-velocity-of-money"target="_blank" rel="noopener">Velocity of money</a>: How fast money is spent. The more different people it is traded with, the more people it provides value/goods/services to.</li> +<li>How much has prices for necessary items increased for the average person (Consumer Price Index or Inflation)</li> +<li>Numerous other indicators are available on <a href="https://tradingeconomics.com/india/indicators"target="_blank" rel="noopener">trading economics indicators</a></li> +</ul> +<p>Alternatives to Money - Other vague incentive schemes for innovation/work in the modern world:</p> +<ol> +<li>Political power. (President Vs Factory Worker)</li> +<li>Work type (Work in AI/ML Vs Work in Agriculture)</li> +<li>Self-satisfaction (Sports Player Vs Factory Worker)</li> +<li>Idealogy - Crusades could be an example of religious idealogies, open source development could be an example of a utilitarian one.</li> +</ol> +<p>References</p> +<ul> +<li>Political reasons why money flows to where it does: <a href="https://www.youtube.com/watch?v=rStL7niR7gs"target="_blank" rel="noopener"> Rules for Rulers by CGP Grey </a></li> +<li>Simpler Analysis on QT/QE: <a href="https://www.youtube.com/watch?v=KTWVyFFpGXQ"target="_blank" rel="noopener">Plain Bagel - Quantitative Tightening</a></li> +<li>Complicated/Deeper Analaysis on QT/QE (rabbit hole): <a href="https://www.youtube.com/watch?v=qaIgj987Xrs"target="_blank" rel="noopener">FedGuy Joshua Wang on Quantitative Tightening</a> (Also a blog post)</li> +<li><a href="https://en.wikipedia.org/wiki/Econophysics"target="_blank" rel="noopener">Econophysics</a>: Takes various concepts from physics and applies it to economics. (Dampening factors when money echoes through markets etc.?)</li> +<li><a href="https://en.wikipedia.org/wiki/Sapiens:_A_Brief_History_of_Humankind"target="_blank" rel="noopener">Sapiens</a> - Although controversial for its factual inaccuracies, it provides a good overall mental model of development and progress throughout history.</li> +<li><a href="https://en.wikipedia.org/wiki/Atlas_Shrugged"target="_blank" rel="noopener">Atlas Shrugged</a> - Rather lengthy book, but first two parts provide an excellent view of the downsides of a lack of incentive schemes.</li> +<li>Simplified overview of the recessions in the past: <a href="https://www.youtube.com/watch?v=uGx6HatpGPY"target="_blank" rel="noopener">Slidebean - List of past recessions</a></li> +<li>Modelling a DAO: <a href="https://vitalik.eth.limo/general/2022/09/20/daos.html"target="_blank" rel="noopener">Vitalik - DAOs are not corporations</a></li> +</ul>Discrete Vs Continuoushttps://cheese-cracker.github.io/posts/discrete-vs-continuous/Wed, 26 Jan 2022 00:00:00 +0000https://cheese-cracker.github.io/posts/discrete-vs-continuous/<h2 id="introduction">Introduction</h2> <p>In this post, we delve into the <strong>mental model</strong> (or abstract feeling) of things being <strong>continuous Vs discrete</strong>. In the direction of continuous vs discrete ideas, we look into signal processing, numerical methods and random ideas.</p> <div align="center">