I hope everyone had a fantastic Pi day. Its always a bit sad when the holiday season is over though. I will miss the pi day carolers and all the pi day treats and lawn decorations.. cant wait till next year!
@math
That time a mathematical proof to an unsolved math problem was just casually posted anonymously to 4chan... Mathematicians found it some time later and realized, remarkably, a long outstanding problem in maths had finally been solved...
Sometimes life is funnier than fiction
## 100 Pots Puzzle
About a year and a half ago I presented the 100-pots puzzle, which is by far my favorite programming/logic/math problem I have ever come across. It took me a while to solve it the first time I heard it (most of the work day which is where I heard it). I also was at an advantage because the solution comes from a field of math I have particular expertise in, so most people will probably have a harder time solving it.
I don't think anyone was able to solve it last time I presented it, and had to give the official answer, I could be wrong, I need to dig up the thread. @Absinthe however did write a simulation for it in python after I had posted the answer.
Anyway here is the problem for anyone who wants to take a stab.
**All answers or hints must be CW'ed**
### No tricks
First off some background. The problem is not a trick question, as much as it may seem like one. There is no play on words, no hidden exception. Everything in this problem is exactly how it is presented and the answer doesn’t rely on any slight of hand. Take this puzzle at face value.
### The Puzzle
There is a room with 100 jars with lids on them all in a row. There is also a stack of papers, 100 papers each labeled 1 to 100. The papers are shuffled and one paper placed into each pot randomly.
You and your assistant are in an a joining room. Your assistant is allowed to enter the room, look in all 100 pots, and if they wish they can pick any 2 pots and switch the paper in them. They can only do this one time, they do not have to do this they can choose to also do nothing. At this point they leave the room, without talking to you.
Next, someone tells you a random number from 1 to 100. Your goal is to enter the room and open a pot that has that number in it. You are allowed to open, at most, 50 of the pots.
Whatever process you use to open those pots must guarantee that by the time you open the 50th pot that the number you were given will be found. Obviously your assistant didn’t know what the number is at any point.
What rules do you give your assistant, and what rules do you follow, to ensure you are successful?
@math #Math #Maths #Mathematics #Puzzle #Puzzles #logic #LogicPuzzles #Programming #algorithm #algorithms
I am way too excited by this novel little discovery of continuous complex fibonacci sequence.. I need to play with this!
I really do love heat map visualizations of data, there is a certain beauty to it when seeing patterns emerge.
The following is a chart from a study that shows how peoples mobility in parks has been affected by covid. Original study can be found here:
https://www.openriskmanagement.com/2021-02-06-visualization-of-a-planet-in-lockdown/
#Science #Data #DataScience #Statistics #math #maths #Mathematics #COVID #COVID19 #Corona #coronavirus
Just added a super-cool mandlebrot explorer as a demo app for Aparapi (so runs on the GPU not CPU). I cant stop playing with it and its only a demo :)
https://git.qoto.org/aparapi/aparapi-examples/-/merge_requests/8
#Aparapi #GPGPU #GPU #HPC #Fractals #mandlebrot #math #maths #mathematics #Java
Threw together a parameter optimization algorithm for my stock trading algorithm last night. Nothing too ground breaking but hell-a useful and cool all the same.
There are about a dozen variables, some of which have some limited dependence on each other. I suspect the search space however is relatively simple based on my expiernce os optimizing it by hand with trial and error.
The challenge is the possible valid range of these variables is huge, most bounded at 0 but with a max that is in the hundreds of thousands.
The other challenge is that each test takes a few minutes to perform (simulated over a years worth of data one minute per data point). So even with some extreme multi-core usage and optimization it is too slow for a naive search algorithm to just do a random walk across the problem space.
So the search pattern had to be an exponential one that pulls back on overshoot in a decaying exponential form as well. Identifies the boundaries and then halves each side of the boundary until the boundaries are narrow enough to find a solution. Then it moves onto the next attribute and repeats, after it optimizes them all it does another run through and another (to account for interdependence) until none of the parameters are significantly adjusted.
All this takes several hours to run at least. Still cool to see its working as it drops the error rate significantly and gets to the point where it makes fairly good predictions about how a stock is likely to change in the near future (the value measuring the error against)... in fact i'm amazed just how powerful an accurate this algorithm is at predicting stocks right now.
#Stocks #Stockmarket #investment #quant #Quantitative #math #Science #MachineLearning #AI #ML @Science
## Math Tip for Coders:
Remember when averaging percentages, unlike plain values,no matter if its a simple mean, a moving average, or a exponential moving average, you always want to use the repeated operator on percentages compared to the one you would use on plain values. I know thats confusing and really only makes sense with an example.
So each of the following operators is the repeated form of the prior: +, *,^ (exponent)
Similarly the following: -, / , roots (like square root)
So for a simple mean with plain values you would average three values by doing:
(a + b + c)/3
However if your doing that for percentages that formula doesnt work instead you do:
(a * b * c) ^ (1/3)
Remember taking something to the power of 1/3 is the same as taking the third root.
Also keep in mind the variables here must be percentages such that they are anywhere from 0 to infinity. If you invested in something and you made no money and lost no money it would be 1, for 100%, if you lost all your money its 0, if you lost half its 0.5 (50%), if you doubled your money its 2.0 (200%) and so on
So if you inveted in three different things, and each time you doubled your money, and you wanted to know what your average percentage of return on investment was you would do: (2 * 2 * 2) ^ (1/3) and that would give you your mean, 2.. If you treated it like normal values and added then divided while it would work in this case it would give you **significantly** incorrect values in other cases.
As I stated this holds true for more complex types of averages too, take exponential moving average as an example. For plain values with EMA you apply each new value to just the previous EMA (and dont need to worry about combining all the values at once).. So if you flipped a coin 100 times and and took the EMA of the first 99 and now want to know know the EMA after the 100th flip (1 being heads and 0 being tails) you do:
(last_value * (1 - alpha) + current_value * alpha)
that gives you your current EMA where alpha is any number from 0 to 1... now to apply that to percentages again you take each operator and make it the next one up so for percentages it is actually:
(last_percentage^(1-alpha) * current_percentage^alpha)
Outlier looks pretty exciting. At first glance it appears to be something like Masterclass but for STEM, plus it counts as actual college credits for anyone in university. basically it is university level courses taught by famous experts in the field.
Also gets some brownie points from me for highlighting Hannah Fry as one of the instructors. She is awesome and has done a lot of great stuff over the years. I got to talk to a her a few times and she helped me out with some problems I was working on once or twice (not through outlier)... so cool they snatched her up.
https://www.outlier.org/ is the link for anyone who wants to check it out.
#Science #Math #Mathematics #learning #elearning @Science @math
A new post I wrote explaining how to write an efficient Exponential Moving average with a finite length.
https://jeffreyfreeman.me/an-efficient-exponential-moving-average-of-finite-length/
#science #math #maths #mathematics #programming #DSP @Science
Early rough draft, haven't proof read it yet. But just wanted to share the math behind creating an efficient Exponential Moving Average with a finite length/cut off. I found this was needed for a project I am working on where the EMA much be determined by random access to various points in a time series and couldn't be calculated for the entire time series in one go.
I needed to modify the EMA for a finite back-length. The standard EMA is only really efficient when calculated sequentially for the entire time series. This implementation is an efficient design that allows for calculation at a point by using finite back-length.
This is an early draft, did not proof read it yet, just whipped it together, though pretty sure the math is close to the final form. I will publish it sometime tomorrow but want to share what I have and welcome and questions or feedback before I publish it.
https://beta.jeffreyfreeman.me/an-efficient-exponential-moving-average-of-finite-length/
#Programming #Math #Maths #Mathematics #algorithms #Science #QOTOJournal
A wonderful visualization of the often unknown Quaternions (a generalization of complex numbers into 4 dimensions).
Can you solve the riddle? My answer is under CW
1) First fill the 5L then pour that into the empty 3L until it is at the rim, now you have 2L of water in the 5L bucket and a full 3L bucket.
2) Pour out the 3 liter bucket leaving you with 2L in the 5L and an empty 5L
3) Pour the 2L from the 5L bucket to the 3L bucket leaving you with an empty 5L bucket and 2L in the 3L bucket
4) Fill the 5L bucket and pour it out into the 3L bucket until it is full. This leaves 4L in the 5L bucket, problem solved.
How the Zodiac Cypher was finally solved after over 50 years:
In case anyone is curious as to how to do some elementary statistics, in this case combinatorics, here is a quick little write up I did to explain the "n choose k" paradigm.
Here is the is the question (from my cousin):
> Math people
Can you help me ??
Let's say
Hypothetically
You have 7 numbers
Between 1-99
The first 6 cant repeat but the 7th can
How many outcomes are possible?
This isnt a riddle or anything I just dont know how to do the math on something I'm trying to figure out
Here is my answer:
For this weeks #FollowFriday I am going to do a groups addition.
* @Electronics - An Electronics Group
* @theamazingweb - A group about interesting and novel things on the internet.
* @vim - A group for everything VIM
* @funny - A group for humour and memes
* @mnmlsm - A group devoted to discussing unix and related topics
* @calligraphy - A group devoted to sharing and discussing calligraphy & handwriting
* @FreeSoftware - A group for discussing Free and Open-source software
* @math - Everything math!
* @dogs - A group for sharing pictures of dogs, for any reason.
* @Science - A group to discuss Science topics.
* @photography - A group for sharing or discussing photograph.
So its been about a month since the QOTO Moderated Groups Server came online at groups.qoto.org. It adds group capability to the fediverse with an owner capable of moderating membership in the group unlike previous group servers which were completely unmoderated and open.
We have had some amazing groups form and overall the server seems to be the most popular on the fediverse, I'm seeing more activity than the open-group servers which is great!
As such I wanted to share a list of a few groups I know of so far in case anyone is looking for a group to follow. Just follow the group as you would a user and you will be in the group and receive group posts in your timeline!
#Electronics #EE #VIM #Funny #Humour #meme #memes #unix #linux #Calligraphy #Handwriting #OpenSource #FreeSoftware #math #maths #mathematics #dog #dogs #doggo #Science #Photography #Pictures #FF
A response I gave to a friend who felt the Quantitative Easing used during the COVID epidemic would ultimately hurt everyone, and that an absolutely free market is the only market. While I do agree with free market sentiments the truth is QE does work when used to avoid massive market crashes and as long as it is reversed at a later point once markets recover then it does far more good than bad. Here I lay out all the math to show why.
In an ideal world I do agree that there should never be market interference. But that only works when you truly live up to that at every level, something that you can't truly have and still have a government.
Consider, the only reason we needed to handle a depression at all is because the government first interfered with the market by using law to force shutdown of businesses or their ability to accept customers inside. If the free market were not tampered with in that regard there would have been no significant depression to deal with in the first place. So we are doing cleanup at this point, so the point is somewhat moot.
That said the assessment that interfering now with QE results in more problems later isnt entirely true, only somewhat. You are correct of course that there will be a downward pressure on the market into the future for sometime, which is what you're referring to. But I think its important to understand the exponential nature of money and while earlier short term gains can far outweigh later long term loss.
Basically the dynamic plays out like this when we see QE going down in times of depression.. 1) ROI on market investments soar many times higher than what would normally be possible in the short term. 2) There is more money in the system so far more people are able to leverage that ROI than they otherwise would in the short term. These two principles combined means people see huge financial gains during a time when we would otherwise have huge losses. This is followed by a longer period of time, on the order of 4x to 6x the length of time where we see a boost where the market is now going to underperform, but at a much lower hit than the gain we saw during QE.
So lets use real world numbers to demonstrate the idea with some solid math. I will pull the numbers from the real world numbers and spitball some figures minimally and try to underestimate so as no to bias it in my favor for numbers we don't actually know but that follows the proposed premise of short term gains followed by long term downward pressure from QE that is higher but distributed over a longer time period... Here are the numbers im going with pulled from real world numbers:
Dow Jones industrial average baseline annual return when QE is not evoked, taken from the 20 year average: 7.03%
First lets look at how things would play out if you invested at the start of QE, which was after the COVID lockdowns and the initial covid drawdown (optimal time to invest):
Short term annualized pressure from QE: 93.79% (1)
Short term annualized P&L based on DJ movement (baseline + QE): 100.72%
Long term loss pressure from QE over following 20 years: -74.19% (2)
Long term annualized QE loss pressure: -6.54% (3)
Long term annualized P&L (expected DJ movement, baseline +/- QE loss): 0.49%
Portfolio P&L on 100K invested at beginning of QE after 2 years: +$290,032.80(4)
Portfolio value on 100K invested at beginning of QE after 2 years: $390,032.80 (4)
Portfolio value after 22 years when starting at 100K with QE: $430,088.72 (4)
Portfolio P&L over 22 years on a 100K investment with QE: +$330,088.72 (4)
Total 22 year percentage P&L with QE: +330.08% (4)
Annualized percentage P&L over 22 years with QE: +6.85% (4)
Time to DJI recovery with QE (actual observed): 275 days (0.75 years)
As you can see the gains are still quite nice even with QE slowing the market down to a crawl for 20 years. Just for comparison lets run the same numbers without QE doing our best to use the real world figures again.
Observed drawdown loss due to covid with QE: -36.77% (5)
Projected drawdown loss due to covid without QE: -85.58% (6)
Historic annualized recovery rate with QE (2009 - 2013): 18.82% (7)
Historic post-QE annualized P&L (2013 - 2018): +12.63% (7)
As you can see, even post QE for the almost 5 years that followed we saw an annualized **increase** in ROI over the baseline of 7.02% and not the decrease you propose or expected.
Time for covid recovery without QE: 10,418 days or 28.5 years (8)
So we can see the time to recover your pre-covid investments without QE is only 275 days compared to without QE we are talking 10,418, or over 28.5 years. Thats huge. So more importantly what would a pre-covid portfolio look like in 22 years with and without QE. Remember the above portfolio numbers were if you invest at the beginning of QE, an optimal point, not pre-covid drawdown, which is the least favorable point.
Loss on pre-drawdown 100K at minima with QE: -$36,770 (9)
Portfolio value on pre-drawdown 100K at minima with QE: $63,230 (10)
Portfolio value on pre-drawdown 100K after 22 years with QE: $271,939.58 (11)
Gain on 100K due to covid drawdown with QE: +$171,939.58 (12)
Now for the numbers without QE
Loss on 100K due to drawdown without QE: -$85,580 (13)
Portfolio value on pre-drawdown 100K at drawdown without QE: $14,420 (14)
Portfolio value on pre-drawdown 100K after 22 years without QE: $62,594.80 (15)
Portfolio P&L on pre-drawdown 100K after 22 years without QE: -$37,405.20 (15)
Portfolio percentage on pre-drawdown 100K after 22 years without QE: 62.59% (16)
Portfolio P&L percentage on pre-drawdown 100K after 22 years without QE: -37.4% (16)
Portfolio P&L on pre-drawdown 100K annualized from 22 years without QE: -2.1% (17)
(see notes at bottom to see how these were calculated from the real world numbers)
As you can see under a QE scheme we recover in a fraction of the time to baseline, only takes us three quarter of a year before we are back to where you started and after 22 years you've still managed to turn your original investment into 4.3x its value in 22 years, and gaining just a little below base rate per year on average at 6.85% gain annualized. By comparison without QE your original investment would actually have lost value over a 22 year period being reduced by almost a half with portfolio investment dropping by -37.4% of its starting value and with an annualized average return over that time of about half at -2.1% loss per year. So clearly QE applied early on before a recession has a chance to fully realize, even with a theoretical economic hit that applies in the 20 years that follows (though we have not observed this historically), is more profitable for everyone than it is to just let the market naturally recover.
This is, in fact, as shown, demonstrated by historic values which agree with currently observed and calculated values here. In fact I was ultra conservative and the real numbers are likely far better. QE tends to cause recoveries proportional to the rate at which the QE occurs followed by an increase in future gains rather than a decrease for at least half a decade out. In fact even when we reversed the QE from 2018 to 2020 there was no noticeable hit to the economy which was still growing in part due to the fact that it was thriving from the effects of earlier QE in past recessions.
This doesn't mean QE works as a general principle outside of extreme circumstances such as a significant recession. It will effectively weaken the dollar when it comes to foreign trade as a direct result, which is reversible through reverse QE. We can see that with the current QE, the effect is relatively quick.
Pre-covid/lockdown the dollar had a value of 0.93 relative to the euro, during the economic crash of covid, but before QE was initiated the dollar crashed from 0.93 down to 0.88 relative to the euro at the point QE was initiated. QE had the initial effect of raising the dollar in the short term from 0.88 to ~0.935 but as WE progressed the dollar ultimately crashed back down from QE to 0.845. As such it went from 0.88 to 0.845 due to QE with only a temporary value boost of a few months. Essentially it reduced the value of the dollar by 4%. This value, as with past QE is realized very shortly after QE ends and stabilizes flat without any further reduction in the dollar due to QE after it ends. So while it does negatively impact the dollar, the impact is not huge. Moreover since it significantly bolsters local economic growth both long term and short term as a result ultimately the QE will/can be reversed at a later date without economic impact and the value of the dollar will gain back that 4% plus whatever value it gained as the result of the boosted economy.
So while its effect on the dollar would cause us to discourage its use in non-recession periods, and it is a tactic that has diminishing returns if used in that way, so not effective. Overall when used during recessions it is an effective tactic that overall reduces the fallout from a recession significantly and boosts economic recovery overall, rather than harming it.
==== Notes if you want the math ====
(1) to calculate the annualized gain from QE is simple. There was a 60.6% rise in the DJ from march 23rd until today, that's 248 days. The following equation will turn that into this year's annualized DJ gain: daily return = 1.606^(1/248), yearly return = (1.606^(1/248))^365. So we have a daily return of 0.19% daily or 100.82% yearly ROI. Now we already know that the baseline ROI is only 7.03%, so we can therefore calculate that at the current rate of annualized gain is 100.82-7.03 = 93.79% **over baseline**
(2) For this we don't know the actual number but we can estimate based on first principles. Let's assume that the negative effect of QE is twice that of the annual positive effect, but spread over 20 years rather than condensed into a short period like positive effects are. In terms of percentage that would be: 1 - 1/(1.937*2) = -0.7419, so basically there is an upward pressure in year one of ~93%, representing a near doubling (100% or 2x), and then a downward pressure of -74.19% the following 20 years which represents a quartering (1/4th or 0.25x) over the 20 years to follow.
(3) to go from the 20 year figure to the annualized figure we have the following equation: 1 - (1/(1.937*2))^(1/20) giving us a annualized loss pressure due to QE of -6.54%
(4) For this we have to determine how long the positive effects of QE last before the proposed negative pressure kicks in. It is hard to say for sure and we would have to do our best guessing based on historical examples of QE. What we know is the returns from QE follow a logistic curve (similar to a logarithm but restricted such that it will have a maximum attainable maximum value before leveling off). As such the initial gains you see will be sharp and appear linear at first and at about half way through you will start to see the gains slowly taper until finally leveling off. Right now we can see from the current DJI market movement we are still in the early part of seeing the GAINS from QE and must not even be half way through. So assuming the gains will last at least 2 or 3 more months before the tapering is noticeable, indicating we are about half way through the gains then a reasonable estimate is we should see these gains for at least a total of 2 years since the start of QE before the gains dissolve and a downward pressure begins to be applied instead.
Therefore assuming we see QE gains at observed rates for only 2 years before transitioning to the negative effects lets calculate what that is. We know annualized gains due to QE during the positive phase is 93.79% above baseline, taking that to a 2 year figure is:
(1.9379)^2 -1 = 2.755 or +275.5%
Add in the baseline rate to arrive at the 2 year gains during the positive period of QE:
2.755 + ((1.0702)^2 - 1) = 2.90032804 or +290.03%
Now to calculate our portfolio value n 100K after 2 years:
(100000 * 3.90032804) = $390,032.80
Subtract 100K to see profit value:
(100000 * 3.90032804) - 100000 = +$290,032.80
Now lets calculate the portfolio value after 20 more years of QE negative pressure, this would result in previously stated annualized P&L for the next 20 years of 0.49%.
390,032.80 * (1.0049^20) = $430,088.72
and subtract initial investment to see what that is in P&L:
390,032.80 * (1.0049^20) - 100000 = $330,088.722
The P&L as a percentage is simple now:
(430088.72/100000) - 1 = 3.3008872 or +330.08%
Lets get that to its annualized value:
4.3008872^(1/22) - 1 = 0.06855798324 or 6.85% annualized return
(5) This is the actual observed drawdown due to COVID before QE was employed, after which the stock market started to rise. Keep in mind QE was applied before covid has completely run its course so in reality we would have likely seen this trend continue throughout the lockdown period at a minimum and probably longer. The loss during max drawdown observed due to covid was from ~february 20th to march 23rd, only a 31 day period!
(6) To project the overall loss we first observe the initial downward spike was linear at a constant rate more or less. We can project that out to what it would look like if allowed to continue into the end of lockdown without intervention to artificially reverse it. Covid restrictions began easing across most states by late may and lockdown was over by late june and into july, though restrictions remain in effect for non-essential employees going back to work still by then. Being conservative so the numbers don't work in favor of my argument let's just assume the projected covid loss would have gone to the end of lockdown then the loss would have abruptly ended with a reversal and recovery. So from February 20th to July 1st which is 131 days would have been the natural drawdown period.
first with take the -36.77% loss over the observed 31 day period and turn that into our daily rate:
1 - (1-0.3677)^(1/31) = 0.01467 or -1.467% daily loss
Then we take our daily loss and apply it to a 131 day period:
1 - (((1-0.3677)^(1/31))^131) = 0.8558748085 or -85.58% total drawdown
(7) Next let's take a look at an example of QE in recent history, we used QE extensively from 2009 to 2013 for our economic recovery from the 2008 recession. This is also the most comparable drawdown to the COVID drawdown we have. The recession began 1st of october 2007 and reached its bottom point on the 2nd of february 2009 with a total drawdown of 49.43% over 490 days. The DJI recovered to the value it was at on oct 1, 2007 for the first time since then on January 15, 2013, or 1443 days.
QE began to be employed only one month prior to bottoming out from 2009 recession and was the reason we began to see recovery at this point. However in this case the QE applied was spread out over a 4 year period very slowly, as such the recovery took much longer and the damage done was much greater. In fact the total quantity of QE due to COVID is almost exactly the same as it was when applied to the 2009 recession except for two important details 1) the QE was applied over a 4 year period instead of a few months 2) Trump spent 2 years prior to 2020 from 2018 to the end of 1029 **reducing** the QE from the Obama era by 22% before employing QE again. This means that overall the total QE is in fact less than the QE used to recover from the 2009 recession but applied over a much shorter period. This is absolutely key to the success, if you are going to take a hit from QE you want the gains to be concentrated as much up front as possible to have the best long term gains. Spreading out the QE ultimately caused a lot of harm.
Still we can ue 2009 QE as a historic example of how QE can be successful, even long term, and we can also use it a bit later as a comparison against the current QE to get a sense of just how much better performance we get out of QE concentrated up front as opposed to being spread out. So lets take a minute to look at what sort of numbers we see from this.
Considering the projected drawdown due to covid is significantly higher than the earlier recession, which is understandable considering it literally halted all business everywhere, we would expect a similarly long recovery, in fact even more so since covid didn't just go away on that date, economies around the world are still crashing. What you notice if you look at the recovery post 2009 is that the market movement went higher than baseline expectations of growth at the usual 8 some percent when not in a recession though after the recovery it went back to about baseline. In fact we never really noticed much of an economic hit long term from the QE at all as you might expect as it was overshadowed by the gains of capital injection. Now covid as I stated would have likely had far more significant long term effects and and the increased rate of recover over baseline from 2009 is from the QE, a natural recession will recover at below baseline for some time before eventually recovering to a baseline recovery rate. But lets see what the historic QE based recovery rate is based on 2009's QE.
First lets calculate the percentage needed for the DJI to recover to baseline once the recession has reaching its minima:
1/(1-0.4943) - 1 = 0.97745699031 or 97.74% needed to recover from -49.43% loss
this was over 1,443 days (3.95 years) so the daily percent return seen during the recovery was:
(1.9774)^(1/1443) - 1 = 0.00047258762 or 0.0472% daily
To annualize that:
((1.0004725)^365) - 1 = 0.18817886404 or 18.82% annualized gains
That is, indeed, quite a bit above the usual 7% - 8% we calculated outside of QE. But was there a long term hit? Well lets look at the growth rate once QE ended which was beginning of april 2013 until 2018, which is when Trump began reversing the QE.
From april 1 2013 to Jan 1 2018 the DJI increased a total of 76.21% over 1,736 days or 4.76 years. We can annualize that figure and get:
(1.7621^(1/4.76)) - 1 = 0.12638560229 or +12.63%
(8) Now let's calculate the projected recovery time from COVID given a natural baseline recovery rate without QE, which we stated earlier was 7.02%. Again remember this is extremely conservative and real numbers are likely to be below baseline during recovery until we recover and only then would baseline growth be realized again. But I want conservative results that are not favorable to my assertion to prove my point.
First let's calculate the total percentage needed to recover from the covid drawdown of -85.58%:
1/(1-0.8558) - 1 = 5.93481276006 or 593.48% (yes it is that huge!)
Now assuming post-covid lockdown we have a baseline recovery rate with an annualized P&L of 7.02% how long would that take in order to compound to the point we would have the needed total percentage of gain to equal the above figure?
First we calculate the daily percentage gain off the 7.02% baseline annualized figure.
1.0702^(1/365) = 1.00018589549 or +0.01858% daily
Now lets take that and use it to figure the number of days needed to recover to pre-covid DJI:
(1.00018589549)^days - 1 = 5.9348
(1.00018589549)^days = 6.9348
log(6.9348) / log(1.00018589549) = 10,418.39 days or a whopping 28.5 years
(9) This is easy as we know the covid draw down of -36.77%
100000 * -0.3677 = -36,770
(10) to get total portfolio value just sum our losses and our starting value
100000 - 36770 = $63,230
(11) We know from earlier that if you had invested at the bottom of the drawdown with QE applied as it is and held for 22 years we would have the earlier stated gain of +330.08%. Therefore now that we know the amount we would have held at that dip if we invested pre-covid we simply apply that to the value to see our portfolio value after 22 years:
63230 * 4.3008 = $271,939.58
(12) for this we just subtract our initial 100K investment:
63230 * 4.3008 - 100000 = +$171,939.58
(13) We already know we have a -85.58% projected drawdown without QE so we get
100000 * -0.8558 = -$85,580
(14) subtract our loss from the last step from our initial investment to see the portfolio value at the bottom of drawdown:
100000 - 85580 = $14,420
(15) Since we know the baseline annualized growth under free market conditions is 7.02% on average, and we know the amount of money we would have on 100K investment at the minima of the drawdown it is trivial to calculate the amount we would have after 22 years.
Since we would hit the minima after 132 days (the length of time of the drawdown) then we subtract this from the number of days in 22 years (8030) and that is the amount of time we spend in the recovery phase.
8030 - 132 = 7898 days or 21.64 years
An annualized return of 7.02% reduced to a daily return is:
1.0702^(1/365) - 1 = 0.00018589549 or +0.0185% daily profit
Apply this across 7898 days:
1.00018589549^7898 - 1 = 3.34083241673 or +334.08%
Now apply this percentage to $14,420 and it will give us our total portfolio value after 22 years
14420 * (1.00018589549^7898) = $62,594.80
The P&L figure is just this value minus initial investment
62594.80 - 100000 = -$37,405.20 (a loss even after 22 years)
(16) As a percentage our 22 year portfolio value is:
62594.80 / 100000 = 0.6259 or 62.59%
Minus 100% to see that figure as a P&L figure: -37.4%
(17) Finally lets turn that into an annualized P&L as a percentage
0.6259^(1/22) - 1 = -0.02107 or -2.1% annually
@General #Science #Economics #UsPol #Math #Maths #Mathematics #QOTOJournal #QE #QuantitativeEasing #Trump #COVID #COVID19
Jeffrey Phillips Freeman
Innovator & Entrepreneur in Machine Learning, Evolutionary Computing & Big Data. Avid SCUBA diver, Open-source developer, HAM radio operator, astrophotographer, and anything nerdy.
Born and raised in Philadelphia, PA, USA, currently living in Utrecht, Netherlands, USA, and Thailand. Was also living in Israel, but left.
Pronouns: Sir / Mister
(Above pronouns are not intended to mock, i will respect any persons pronouns and only wish pronouns to show respect be used with me as well. These are called neopronouns, see an example of the word "frog" used as a neopronoun here: http://tinyurl.com/44hhej89 )
A proud member of the Penobscot Native American tribe, as well as a Mayflower passenger descendant. I sometimes post about my genealogical history.
My stance on various issues:
Education: Free to PhD, tax paid
Abortion: Protected, tax paid, limited time-frame
Welfare: Yes, no one should starve
UBI: No, use welfare
Racism: is real
Guns: Shall not be infringed
LGBT+/minorities: Support
Pronouns: Will respect
Trump: Moron, evil
Biden: Senile, racist
Police: ACAB
Drugs: Fully legal, no prescriptions needed
GPG/PGP Fingerprint: 8B23 64CD 2403 6DCB 7531 01D0 052D DA8E 0506 CBCE