<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://josephbriones.com/feed.xml" rel="self" type="application/atom+xml"/><link href="https://josephbriones.com/" rel="alternate" type="text/html" hreflang="en"/><updated>2026-08-12T19:44:54+00:00</updated><id>https://josephbriones.com/feed.xml</id><title type="html">Joseph Luis Briones</title><subtitle>Joseph Luis Briones is a Data Scientist at Microsoft AI and a PhD Student at Arizona State University, interested in algorithms for science and engineering.</subtitle><author><name>Joseph Luis Briones</name><uri>https://josephbriones.com</uri></author><entry><title type="html">Wall Street Fighting Mathematics #1</title><link href="https://josephbriones.com/blog/2026/Compounding/" rel="alternate" type="text/html" title="Wall Street Fighting Mathematics #1"/><published>2026-04-18T12:00:00+00:00</published><updated>2026-04-18T12:00:00+00:00</updated><id>https://josephbriones.com/blog/2026/Compounding</id><content type="html" xml:base="https://josephbriones.com/blog/2026/Compounding/"><![CDATA[<p>The Rule of 72 is one of the few pieces of financial folklore that survives formal scrutiny. In its familiar form, it states that capital compounding at $r\%$ annually will double in approximately</p> \[T \approx \frac{72}{r}\] <p>years. Its longevity is not accidental. The rule compresses an exact logarithmic relation into a heuristic that is both analytically grounded and computationally efficient.</p> <p>Start with the exact expression. If wealth evolves according to annual compounding, then</p> \[V_t = V_0\left(1+\frac{r}{100}\right)^t.\] <p>Setting $V_t = 2V_0$ gives the exact doubling time:</p> \[T(r)=\frac{\log_{10}2}{\log_{10}(1+r/100)}.\] <p>The choice of logarithmic base is irrelevant; base 10 is simply convenient for exposition. The Rule of 72 is therefore an approximation to the denominator $\log_{10}(1+r/100)$.</p> <p>Let $x=r/100$. Since</p> \[\log_{10}(1+x)=\frac{\ln(1+x)}{\ln 10},\] <p>the Taylor expansion implies</p> \[\log_{10}(1+x) = \frac{1}{\ln 10} \left( x-\frac{x^2}{2}+\frac{x^3}{3}-\cdots \right).\] <p>At first order,</p> \[\log_{10}(1+x)\approx \frac{x}{\ln 10},\] <p>and so</p> \[T(r)\approx \frac{\log_{10}2}{x/\ln 10} = \frac{\ln 2}{x} = \frac{100\ln 2}{r} \approx \frac{69.3147}{r}.\] <p>Thus the asymptotically correct constant is $69.3$, not $72$. That is the first point worth making clearly: the Rule of 72 is not the linear approximation. It is an adjusted approximation.</p> <p>Why, then, does 72 work so well? Because the linearization understates doubling time once rates are no longer infinitesimal. Retaining the quadratic term,</p> \[\ln(1+x)\approx x-\frac{x^2}{2},\] <p>yields</p> \[T(r)\approx \frac{\ln 2}{x(1-x/2)} = \frac{\ln 2}{x}\cdot\frac{1}{1-x/2}.\] <p>Expanding once more,</p> \[\frac{1}{1-x/2}\approx 1+\frac{x}{2},\] <p>gives</p> \[T(r)\approx \frac{100\ln 2}{r}\left(1+\frac{r}{200}\right) = \frac{69.3}{r}+0.3465.\] <p>That is the essential correction. Discrete compounding pushes the effective numerator upward from $69.3$ into the low 70s over economically relevant rates. The Rule of 72 is therefore not exact, but neither is it arbitrary. It is a deliberately upward-biased approximation, and the bias is in the correct direction.</p> <p>A useful way to formalize the point is to define the exact effective numerator</p> \[k(r)=\frac{r\log_{10}2}{\log_{10}(1+r/100)}, \qquad T(r)=\frac{k(r)}{r}.\] <p>The key fact is that $k(r)$ varies slowly with $r$. The Rule of 72 amounts to replacing a slowly varying function with a fixed nearby constant over the range of returns that matter in practice. That is a more accurate description of the rule than calling it a mnemonic.</p> <p>Its persistence has as much to do with arithmetic as with approximation theory. The number $72$ is highly composite: it is divisible by $2,3,4,6,8,9,$ and $12$. That makes inversion easy. One often wants to move quickly between rates and horizons, and 72 is unusually well suited to that task. A constant like $69.3$ is analytically cleaner but operationally inferior.</p> <p>The same structure extends beyond doubling. If initial wealth is $P_0$ and the target is $P^\ast$, the exact horizon under annual compounding is</p> \[t=\frac{\log_{10}(P^\ast/P_0)}{\log_{10}(1+r/100)}.\] <p>Equivalently, define the number of doublings required as</p> \[n=\frac{\log_{10}(P^\ast/P_0)}{\log_{10}2}.\] <p>Then $n$ is simply the target multiple expressed in doubling units, and the Rule of 72 gives the approximation</p> \[t \approx n\cdot\frac{72}{r}.\] <p>This is the natural generalization of the rule. It is not merely a shortcut for “time to double.” It is a way to map arbitrary wealth multiples into an approximate time horizon.</p> <p>Inflation enters in exactly the same way. If nominal wealth grows at rate $r_n$ and the inflation rate is $i$, then the real growth factor per period is</p> \[g=\frac{1+r_n}{1+i}.\] <p>Accordingly, the exact real horizon for reaching a target $P^\ast$ from $P_0$ is</p> \[t_{\text{real}} = \frac{\log_{10}(P^\ast/P_0)}{\log_{10} g}.\] <p>For moderate rates, one often approximates the real return by $r_n-i$, which gives</p> \[t_{\text{real}} \approx \frac{\log_{10}(P^\ast/P_0)}{\log_{10}2}\cdot\frac{72}{r_n-i}.\] <p>This is the form that matters for long-horizon planning. Nominal doubling is rarely the relevant object; real purchasing power is.</p> <p>A different structure appears once one introduces periodic contributions. If an amount $C$ is added at the end of each period, terminal wealth becomes</p> \[V_t = P_0\left(1+\frac{r}{100}\right)^t + C\, \frac{\left(1+\frac{r}{100}\right)^t-1}{r/100}.\] <p>The first term is the compounded initial principal. The second is the future value of an annuity. At that point the process is no longer governed by pure multiplicative scaling, so the Rule of 72 no longer closes the problem by itself.</p> <p>If the target is $P^\ast$, then one solves</p> \[P^\ast = P_0\left(1+\frac{r}{100}\right)^t + C\, \frac{\left(1+\frac{r}{100}\right)^t-1}{r/100}.\] <p>This rearranges to</p> \[\left(1+\frac{r}{100}\right)^t = \frac{P^\ast + C/(r/100)}{P_0 + C/(r/100)},\] <p>and hence</p> \[t = \frac{ \log_{10}\!\left(\dfrac{P^\ast + C/(r/100)}{P_0 + C/(r/100)}\right) }{ \log_{10}(1+r/100) }.\] <p>The inflation-adjusted version is analogous. Using the real growth factor</p> \[g=\frac{1+r_n}{1+i},\] <p>and real end-of-period contributions $C$, the target horizon satisfies</p> \[P^\ast = P_0 g^t + C\frac{g^t-1}{g-1},\] <p>so that</p> \[t = \frac{ \log_{10}\!\left(\dfrac{P^\ast + C/(g-1)}{P_0 + C/(g-1)}\right) }{ \log_{10} g }.\] <p>That distinction matters. The Rule of 72 is a remarkably effective compression of an exponential law, but it is a rule for multiplicative growth. Once periodic contributions enter, the relevant object is no longer a doubling heuristic but the annuity identity.</p> <p>Its domain of validity should also be stated plainly. The rule works best for moderate positive rates under approximately stationary compounding. It becomes less informative at very high rates, near zero, under negative growth, or whenever return volatility makes path dependence economically important. In those settings, the exact logarithmic relation remains available; the heuristic simply ceases to be the right tool.</p> <p>That is the significance of the Rule of 72. It is not exact, and it is not meant to be. It is a calibrated approximation to a logarithmic law, corrected in the right direction by curvature and anchored to a constant chosen as much for divisibility as for fit. Its durability comes from preserving the essential structure of compounding while remaining mentally operable. Few financial heuristics achieve that balance. This one does.</p>]]></content><author><name>Joseph Luis Briones</name><uri>https://josephbriones.com</uri></author><category term="finance"/><category term="mathematics"/><category term="compounding"/><summary type="html"><![CDATA[Why the Rule of 72 works: logarithms, Taylor expansion, inflation adjustment, target wealth horizons, and the limits of the heuristic.]]></summary></entry><entry><title type="html">A Faster Route to Pi</title><link href="https://josephbriones.com/blog/2026/Pi/" rel="alternate" type="text/html" title="A Faster Route to Pi"/><published>2026-03-14T12:00:00+00:00</published><updated>2026-03-14T12:00:00+00:00</updated><id>https://josephbriones.com/blog/2026/Pi</id><content type="html" xml:base="https://josephbriones.com/blog/2026/Pi/"><![CDATA[<p>There is a familiar way to encounter $\pi$: through circles, arcs, and ratios. This $\pi$ post takes a different route. It begins with divisibility, not geometry, and then passes through one of the standard templates in quantum algorithms. The destination is still $\pi$.</p> <h2 id="where-is-pi-hiding">Where is $\pi$ hiding?</h2> <p>Fix a large integer $N$. Among all pairs</p> \[(a,b)\in\{1,2,\dots,N\}^2,\] <p>define</p> \[p_N=\frac{1}{N^2}\#\{(a,b):\gcd(a,b)=1\}.\] <p>Thus $p_N$ is the proportion of pairs up to $N$ that are coprime. Classical number theory shows that (derivation section below)</p> \[p_N \to \frac{6}{\pi^2}\qquad\text{as }N\to\infty.\] <p>So estimating $p_N$ for large $N$ yields an approximation to $\pi$, provided both the finite-$N$ error and the estimation error are controlled:</p> \[\pi \approx \sqrt{\frac{6}{p_N}}.\] <p>The mathematical target is then clear. The computational question is how to estimate $p_N$.</p> <h2 id="classical-vs-quantum-estimating-p_n">Classical vs quantum: estimating $p_N$</h2> <p>A classical algorithm samples random pairs $(a,b)$, tests whether $\gcd(a,b)=1$, and averages the resulting indicators. If $X_i\in{0,1}$ records whether the $i$-th sampled pair is coprime, then</p> \[\hat p=\frac{1}{m}\sum_{i=1}^m X_i\] <p>estimates $p_N$. Since the $X_i$ are independent Bernoulli random variables with mean $p_N$, a standard additive Chernoff-Hoeffding bound gives</p> \[\Pr\!\big(|\hat p-p_N|\ge \varepsilon\big)\le 2e^{-2m\varepsilon^2}.\] <p>Consequently, achieving additive error $\varepsilon$ with constant success probability requires</p> \[m=O\!\left(\frac{1}{\varepsilon^2}\right)\] <p>samples.</p> <p>The quantum version uses the same predicate but a different computational model. One prepares the uniform superposition</p> \[\frac{1}{N}\sum_{a=1}^N\sum_{b=1}^N |a\rangle|b\rangle,\] <p>then implements a reversible circuit for coprimality:</p> \[|a\rangle|b\rangle|0\rangle \mapsto |a\rangle|b\rangle|\mathbf 1_{\gcd(a,b)=1}\rangle.\] <p>This is a reversible implementation of the Euclidean algorithm, followed by uncomputation of auxiliary workspace. The resulting state can be written as</p> \[\sqrt{p_N}\,|\psi_{\mathrm{good}}\rangle|1\rangle + \sqrt{1-p_N}\,|\psi_{\mathrm{bad}}\rangle|0\rangle.\] <p>The quantity of interest has therefore been encoded as an amplitude. More precisely, the coprimality predicate defines a good subspace, and the problem becomes one of estimating the weight of that subspace coherently.</p> <p>This places the problem in the standard setting of amplitude estimation. Rather than learning $p_N$ through repeated independent samples, the algorithm uses coherent access to the predicate and interference between the good and bad subspaces. Up to logarithmic factors and standard success-probability conventions, the resulting complexity is</p> \[O\!\left(\frac{1}{\varepsilon}\right)\] <p>oracle uses for additive error $\varepsilon$, compared with the classical</p> \[O\!\left(\frac{1}{\varepsilon^2}\right).\] <p>That quadratic improvement is the essential quantum contribution.</p> <p>There are, however, two distinct errors to keep separate. The first is the <strong>estimation error</strong></p> \[|\widetilde p_N-p_N|,\] <p>which is controlled by the quantum algorithm. The second is the <strong>limit error</strong></p> \[\left|p_N-\frac{6}{\pi^2}\right|,\] <p>which reflects the fact that the theorem is asymptotic, while the computation is necessarily finite. The final approximation to $\pi$ inherits both, through the transformation</p> \[p\mapsto \sqrt{\frac{6}{p}}.\] <p>This transformation is stable here because $p_N$ stays bounded away from zero for large $N$. In fact, one can quantify the sensitivity by differentiating the map above:</p> \[\frac{d}{dp}\sqrt{\frac{6}{p}}=-\frac{\sqrt6}{2p^{3/2}}.\] <p>So an additive perturbation $\delta p$ induces an error of size</p> \[|\delta\pi|\approx \frac{\sqrt6}{2p^{3/2}}\,|\delta p|.\] <p>Near the limiting value $p=6/\pi^2\approx 0.61$, this factor is about $2.6$, so passing from $p_N$ to $\pi$ amplifies errors only by a constant factor.</p> <h2 id="why-does-frac6pi2-appear">Why does $\frac{6}{\pi^2}$ appear?</h2> <p>The asymptotic value $6/\pi^2$ comes from Euler’s product formula for the Riemann zeta function. For $s&gt;1$,</p> \[\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}.\] <p>Euler’s key observation was that the additive and multiplicative structures of the integers are linked through prime factorization:</p> \[\zeta(s)=\prod_p \frac{1}{1-p^{-s}}.\] <p>This identity follows from unique prime factorization: expanding the product generates each integer exactly once. Taking reciprocals gives</p> \[\frac{1}{\zeta(s)}=\prod_p\left(1-\frac{1}{p^s}\right).\] <p>At $s=2$, Euler’s solution of the Basel problem shows that</p> \[\zeta(2)=\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6},\] <p>and therefore</p> \[\frac{1}{\zeta(2)}=\frac{6}{\pi^2}.\] <p>That is the source of the limit. A pair $(a,b)$ is coprime precisely when no prime divides both. The structure behind that statement is not a heuristic independence argument, but the exact multiplicative framework encoded by unique factorization and Euler’s product. The appearance of $\pi$ is therefore not decorative; it is forced by the exact evaluation of $\zeta(2)$.</p> <p>The overall structure is then precise. Number theory identifies the limiting value of $p_N$. Quantum computing supplies a faster procedure for estimating the finite quantity $p_N$. The final expression</p> \[\widetilde\pi=\sqrt{\frac{6}{\widetilde p_N}}\] <p>translates that estimate into an approximation of $\pi$.</p> <p>What makes this example memorable to me is not that it is a practical method for high-precision computation. It is that the workflow is so indirect and yet so exact. Geometry never enters the circuit. It waits in the limit.</p>]]></content><author><name>Joseph Luis Briones</name><uri>https://josephbriones.com</uri></author><category term="mathematics"/><category term="number theory"/><category term="quantum computing"/><summary type="html"><![CDATA[From coprime integers to quantum algorithms, an indirect but exact route to pi.]]></summary></entry><entry><title type="html">How Far Away Is a Storm?</title><link href="https://josephbriones.com/blog/2025/Thunder/" rel="alternate" type="text/html" title="How Far Away Is a Storm?"/><published>2025-03-15T12:00:00+00:00</published><updated>2025-03-15T12:00:00+00:00</updated><id>https://josephbriones.com/blog/2025/Thunder</id><content type="html" xml:base="https://josephbriones.com/blog/2025/Thunder/"><![CDATA[<p>A lightning discharge gives an observer two signals: a flash and a sound. The flash arrives essentially at once; the thunder does not. That disparity turns the delay between them into a range estimate.</p> <p>The governing idea is simple. Light travels so fast that, over terrestrial distances, its travel time is negligible for ordinary observation. Sound travels much more slowly, so the thunder takes measurable time to arrive. A larger delay therefore means a larger distance. The observable quantity is the time gap between seeing the lightning and hearing the thunder.</p> <p>If the discharge occurs at distance $d$, then the arrival times of the flash and thunder are</p> \[t_{\mathrm{opt}}=\frac{d}{c}, \qquad t_{\mathrm{ac}}=\frac{d}{v_s},\] <p>where $c$ is the speed of light and $v_s$ is the local speed of sound. The observed lag is therefore</p> \[\Delta t=t_{\mathrm{ac}}-t_{\mathrm{opt}} =\frac{d}{v_s}-\frac{d}{c} =d\left(\frac{1}{v_s}-\frac{1}{c}\right).\] <p>This is the key relation: under fixed propagation speeds, the delay is proportional to distance.</p> <p>Solving for $d$ gives the exact inversion formula</p> \[d=\frac{\Delta t}{\frac{1}{v_s}-\frac{1}{c}} =\frac{v_sc}{c-v_s}\,\Delta t.\] <p>Since $c\gg v_s$, this simplifies sharply. Rewriting,</p> \[d=v_s\Delta t\cdot \frac{1}{1-v_s/c}.\] <p>Now $v_s/c$ is extremely small. With $v_s\approx 343\ \mathrm{m\,s^{-1}}$ and $c\approx 3\times 10^8\ \mathrm{m\,s^{-1}}$,</p> \[\frac{v_s}{c}\approx 1.1\times 10^{-6}.\] <p>Hence</p> \[\frac{1}{1-v_s/c} =1+\frac{v_s}{c}+O\!\left(\frac{v_s^2}{c^2}\right),\] <p>so</p> \[d =v_s\Delta t\left(1+\frac{v_s}{c}+O\!\left(\frac{v_s^2}{c^2}\right)\right) \approx v_s\Delta t.\] <p>The optical correction is therefore smaller than the leading term by about one part in a million. For storm-scale distances, it is negligible. To leading order,</p> \[d\approx v_s\Delta t.\] <p>That is the entire method: the flash marks the initial time, the thunder marks the later arrival, and the difference between them converts directly into distance through the sound speed.</p> <p>For practical use, it is convenient to express the estimate in miles. Taking</p> \[v_s\approx 343\ \mathrm{m\,s^{-1}}\approx 0.213\ \mathrm{mi\,s^{-1}},\] <p>one obtains</p> \[d\approx 0.213\,\Delta t \quad \text{miles}.\] <p>Equivalently,</p> \[\frac{1}{0.213}\approx 4.7,\] <p>so sound travels about one mile in 4.7 seconds. For mental arithmetic, this rounds to the field rule</p> \[d\approx \frac{\Delta t}{5}\quad \text{miles}.\] <p>This is the version worth remembering: every 5 seconds of delay is about 1 mile. Thus</p> \[5\ \mathrm{s}\to 1\ \text{mile},\qquad 10\ \mathrm{s}\to 2\ \text{miles},\qquad 15\ \mathrm{s}\to 3\ \text{miles},\qquad 30\ \mathrm{s}\to 6\ \text{miles}.\] <p>The more precise leading-order values are</p> \[5\ \mathrm{s}\quad \mapsto \quad d\approx 0.213(5)=1.07\ \text{mi},\] \[10\ \mathrm{s}\quad \mapsto \quad d\approx 0.213(10)=2.13\ \text{mi},\] \[15\ \mathrm{s}\quad \mapsto \quad d\approx 0.213(15)=3.20\ \text{mi},\] \[30\ \mathrm{s}\quad \mapsto \quad d\approx 0.213(30)=6.39\ \text{mi}.\] <p>The “divide by five” rule is simply a rounded version of these calculations: not exact, but accurate enough for immediate use.</p> <p>A modest refinement comes from temperature dependence. In dry air, near standard conditions, the sound speed may be approximated by</p> \[v_s \approx 331+0.6T_C \quad \mathrm{m\,s^{-1}}.\] <p>Using</p> \[T_C=\frac{5}{9}(T_F-32),\] <p>this becomes</p> \[v_s \approx 320.3+0.333\,T_F \quad \mathrm{m\,s^{-1}}.\] <p>Thus a more refined estimate is</p> \[d\approx \frac{320.3+0.333\,T_F}{1609}\,\Delta t \quad \text{miles}.\] <p>At $68^\circ!F$, this reproduces $v_s\approx 343\ \mathrm{m\,s^{-1}}$, the standard value used above. Across ordinary outdoor temperatures, this correction is modest and does not materially change the field rule.</p> <p>The essential point is that the estimate uses two physical inputs from the same discharge: first the flash, then the thunder. The measurable quantity is their arrival-time difference,</p> \[\Delta t=t_{\mathrm{ac}}-t_{\mathrm{opt}},\] <p>and that difference is, to an excellent approximation, proportional to the distance. See the flash, count the seconds to the thunder, and divide by 5: that is the miles estimate, and the mathematics behind it is precisely the travel-time relation above.</p>]]></content><author><name>Joseph Luis Briones</name><uri>https://josephbriones.com</uri></author><category term="physics"/><category term="weather"/><category term="estimation"/><summary type="html"><![CDATA[Why counting the seconds between lightning and thunder gives a reliable estimate of storm distance.]]></summary></entry></feed>