<div dir="ltr"><div>If you are trying to see how many days to 1,000,00 deaths (assuming exponential)</div><div>there is an easier way. </div><div><br></div><div>Using your notation: b is the exponential rate per day. </div><div>And now after 111 days we have 100,000 deaths. </div><div><br></div><div>so </div><div>(*) b^111 = 100,000</div><div><br></div><div>100,000 is 10^5 and 1,000,000 is 10^6 </div><div><br></div><div>Raise both sides of equation (*) to 6/5th power</div><div><br></div><div>b^(111*6/5) = 1,000,000</div><div><br></div><div>111*6/5 = 133.2 </div><div><br></div><div>133 days. So 3 weeks from today (June 18th)</div><div><br></div><div>Thomas</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---------- Forwarded message ----------<br>From: Michael Paoli <<a href="mailto:Michael.Paoli@cal.berkeley.edu" target="_blank">Michael.Paoli@cal.berkeley.edu</a>><br>To: <a href="mailto:conspire@linuxmafia.com" target="_blank">conspire@linuxmafia.com</a><br>Cc: <br>Bcc: <br>Date: Thu, 28 May 2020 00:41:34 -0700<br>Subject: [conspire] 100,000, bc(1), & miscellaneous<br>2020-05-27 100,000 US dead; less than 4 months ago we were at 1 US dead<br>
Rate may not have been consistent (variations in<br>
lockdown/shelter-in-place/reopening/...), and theoretically more<br>
logistic than exponential, but still far from saturation / herd<br>
immunity, so if we approximate using exponential,<br>
and do gross approximation of consistent rate, we have ...<br>
<br>
First US confirmed fatality ...<br>
was earlier thought to be 2020-02-28 in Seattle, WA, but (autopsies)<br>
later confirmed first was:<br>
2020-02-06 in in Santa Clara County, CA<br>
<br>
So ...<br>
$ echo \($(TZ=GMT0 date +%s -d '2020-05-27T12:00:00+00:00') - \<br>
$(TZ=GMT0 date +%s -d '2020-02-06T12:00:00+00:00')\)/3600/24 |<br>
bc -l<br>
111.00000000000000000000<br>
111 days ago - or<br>
111 days from from 2020-02-06 (1) to 2020-05-27 (100,000)<br>
<br>
So, ... we'll make the (gross) approximation of consistent<br>
exponential growth rate throughout.<br>
<br>
So, then what per-day growth rate?<br>
b^111=100,000 = e^(111*ln(b))<br>
b=100,000^(1/111) (or 111th root of 100,000) = e^((1/111)*ln(100,000))<br>
~=<br>
1.10928986489522280772, e.g.: $ echo 'e((1/111)*l(100000))' | bc -l<br>
Remember, exponentials get big/small fast - unless the base is 1.<br>
if the base is >1 they grow, if the base is <1 they get shrink.<br>
So, at ~1.11, we go from 1 to 100,000 in 111 days<br>
<br>
If we presume same exponential, when would we hit 1,000,000?<br>
b^x=1,000,000<br>
x=log-base-b of 1,000,000 = ln(1,000,000)/ln(b) =<br>
ln(1,000,000)/ln(e^((1/111)*ln(100,000))) =<br>
ln(1,000,000)/((1/111)*ln(100,000)) ~=<br>
133.20000000000000014454, e.g.:<br>
$ echo 'l(1000000)/((1/111)*l(100000))' | bc -l<br>
So, 10x growth in ~22 (133-111) days<br>
$ TZ=GMT0 date -I -d '2020-02-06T12:00:00+00:00 + 133 days'<br>
So,<br>
2020-06-18 for 1,000,000 (gross approximation of continuous unchanged<br>
exponential)<br>
<br>
And, when for 10,000,000, and 100,000,000 ...?<br>
The model would break down by/before then, logistic curve would be<br>
much more appropriate fit (and even then, if we do gross approximation<br>
of no factors changing along the way).<br>
Exponential doesn't take into account immune / no longer vulnerable<br>
to infection or any limits on pool available to be infected, whereas<br>
logistic does.<br>
Essentially no longer vulnerable to infection (at least to sufficient<br>
model approximation) happens one of two ways:<br>
o immune (vaccine, infected and recovered ... "immune" not necessarily<br>
permanent immunity, but "long enough" to cover the period under<br>
examination).<br>
o deceased (not the best way to get removed from pool of vulnerable to<br>
infection)<br>
<br>
So, if we've got ~10x growth in ~22 days, and again, our crude gross<br>
approximation exponential modeling (presuming consistent rate of<br>
spread), how many days for, e.g. 2x (doubling), 10x, 100x, 1024x,<br>
...?<br>
Let's call x our multiplier (e.g. for 2x, 10x, etc. growth factor).<br>
Let's use d for number of days.<br>
From our earlier, we have base (call it b) of exponent,<br>
for our daily growth factor (b^1 = our 1 day multiplier)<br>
b=100,000^(1/111) (or 111th root of 100,000) = e^((1/111)*ln(100,000))<br>
~=<br>
1.10928986489522280772, e.g.: $ echo 'e((1/111)*l(100000))' | bc -l<br>
We'll use (relatively) standard notation, and convert to bc(1)<br>
syntax/format:<br>
b=e((1/111)*l(100000))<br>
b^d=x<br>
d=log-base-b of x<br>
d=ln(x)/ln(b)<br>
d=l(x)/l(b)<br>
And, wee bit 'o shell:<br>
b='e((1/111)*l(100000))'<br>
for x in 2 10 100 1024 1048576; do<br>
echo -n "x=$x d="<br>
echo "l($x)/l($b)" | bc -l<br>
done<br>
And we have:<br>
x=2 d=6.68286590374038254157<br>
x=10 d=22.20000000000000002616<br>
x=100 d=44.40000000000000005242<br>
x=1024 d=66.82865903740382541642<br>
x=1048576 d=133.65731807480765083285<br>
<br>
"Of course" ... "reality" ... the base continually changes, and may be<br>
quite region/locality/country/... specific, altered by factors such as:<br>
o physical/social distancing<br>
o shelter-in-place / lockdown / reopenings / social and other<br>
gatherings<br>
o hygiene and other relevant practices, especially as regards<br>
SARS-CoV-2 --> COVID-19 infection/spread pathways<br>
Anyway, the more and longer the base can be pushed and further pushed<br>
below 1, the quicker the infections get to 0. Until then, it<br>
spreads/grows, notwithstanding immunity(/deaths) numbers becoming so<br>
large the model starts to substantially differ from exponential and<br>
better approximates logistic.<br>
<br>
Bit more on bc(1) ... want a handy power (x^y) function in bc(1)?<br>
bc(1) goes relatively minimal in some ways, it give one the basic<br>
necessary functions needed to define most other functions/capabilities<br>
that may be needed. E.g. it has natural logarithm/exponentiation, but<br>
no other bases, as those can be derived from natural base e.<br>
Likewise trig, it has sine and cosine functions, but no tangent<br>
function, as tangent can be calculated from sine and cosine.<br>
So, arbitrary base to arbitrary exponent:<br>
x^y = e^(y*ln(x))<br>
So, we can define a function, call it p (for power) in bc:<br>
define p(x,y){<br>
e(y*l(x))<br>
}<br>
e.g.:<br>
$ bc -lq<br>
define p(x,y){<br>
return e(y*l(x))<br>
}<br>
p(2,10)<br>
1023.99999999999999992594<br>
p(144,1/2)<br>
11.99999999999999999988<br>
quit<br>
$<br>
bc(1) also well handles relatively arbitrary precision, and other<br>
number bases. E.g.:<br>
$ bc -lq<br>
scale=66<br>
4*a(1)<br>
3.141592653589793238462643383279502884197169399375105820974944592304<br>
obase=16<br>
4*a(1)<br>
3.243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA3<br>
ibase=2<br>
110001011001001101101000010110100110000000000001011100000010011100000000<br>
C593685A6001702700<br>
quit<br>
$<br>
<br>
references/excerpts:<br>
<a href="http://linuxmafia.com/pipermail/conspire/2020-May/010792.html" rel="noreferrer" target="_blank">http://linuxmafia.com/pipermail/conspire/2020-May/010792.html</a><br>
<a href="http://linuxmafia.com/pipermail/conspire/2020-March/010315.html" rel="noreferrer" target="_blank">http://linuxmafia.com/pipermail/conspire/2020-March/010315.html</a><br>
bc(1)<br>
sh(1)<br>
<a href="https://www.youtube.com/playlist?list=PLIOESHELJOCnqaaUqq7AzTOGp-k-2KzKY" rel="noreferrer" target="_blank">https://www.youtube.com/playlist?list=PLIOESHELJOCnqaaUqq7AzTOGp-k-2KzKY</a><br>
<br>
And now for slightly cheerier note(s):<br>
France Musique Le Boléro de Ravel par l'Orchestre national de France en<br>
<a href="https://youtu.be/Sj4pE_bgRQI" rel="noreferrer" target="_blank">https://youtu.be/Sj4pE_bgRQI</a><br>
<br>
<br>
<br>
_______________________________________________<br>
conspire mailing list<br>
<a href="mailto:conspire@linuxmafia.com" target="_blank">conspire@linuxmafia.com</a><br>
<a href="http://linuxmafia.com/mailman/listinfo/conspire" rel="noreferrer" target="_blank">http://linuxmafia.com/mailman/listinfo/conspire</a><br>
</blockquote></div></div>