[{"id":246958,"date":"2026-04-10T09:29:49","date_gmt":"2026-04-10T14:29:49","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246958"},"modified":"2026-04-10T09:31:23","modified_gmt":"2026-04-10T14:31:23","slug":"fraction-digits","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/10\/fraction-digits\/","title":{"rendered":"Distribution of digits in fractions"},"content":{"rendered":"<p>There&#8217;s a lot of mathematics just off the beaten path. You can spend a career in math and yet not know all there is to know about even the most basic areas of math. For example, this post will demonstrate something you may not have seen about decimal forms of fractions.<\/p>\n<p>Let <em>p<\/em> &gt; 5 be a prime number and 0 &lt; <em>k<\/em> &lt; <em>p<\/em>. Then the digits in <em>k<\/em>\/<em>p<\/em> might be the same for all <em>k<\/em>, varying only by cyclic permutations. This is the case, for example, when <em>p<\/em> = 7 or <em>p<\/em> = 17. More on these kinds of fractions <a href=\"https:\/\/www.johndcook.com\/blog\/2014\/11\/12\/cyclic-fractions\/\">here<\/a>.<\/p>\n<p>The digits in <em>k<\/em>\/<em>p<\/em> repeat for every <em>k<\/em>, but different values of <em>k<\/em> might have sequences of digits that vary by more than cyclic permutations. For example, let&#8217;s look at the values of <em>k<\/em>\/13.<\/p>\n<pre>&gt;&gt;&gt; for i in range(1, 13):\r\n...   print(i\/13)\r\n...\r\n 1 0.0769230769230769\r\n 2 0.1538461538461538\r\n 3 0.2307692307692307\r\n 4 0.3076923076923077\r\n 5 0.3846153846153846\r\n 6 0.4615384615384615\r\n 7 0.5384615384615384\r\n 8 0.6153846153846154\r\n 9 0.6923076923076923\r\n10 0.7692307692307693\r\n11 0.8461538461538461\r\n12 0.9230769230769231\r\n<\/pre>\n<p>One cycle goes through the digits 076923. You&#8217;ll see this when <em>k<\/em> = 1, 3, 4, 9, 10, or 11. The other cycle goes through 153846 for the rest of the values of <em>k<\/em>. The cycles 076923 and 153846 are called the <strong>distinct repeating sets<\/strong> of 13 in [1].<\/p>\n<p>If we look at fractions with denominator 41, thee are six distinct repeating sets.<\/p>\n<pre>02439\r\n04878\r\n07317\r\n09756\r\n12195\r\n14634\r\n26829\r\n36585\r\n<\/pre>\n<p>You could find these by modifying the Python code above. However, in general you&#8217;ll need more than default precision to see the full periods. You might want to shift over to <code>bc<\/code>, for example.<\/p>\n<p>When you look at all the distinct repeating sets of a prime number, all digits appear almost the same number of times. Some digits may appear one more time than others, but that&#8217;s as uneven as you can get. A corollary in [1] states that if <em>p<\/em> = 10<em>q<\/em> + <em>r<\/em>, with 0 &lt; <em>r<\/em> &lt; 10, then 11 \u2212 <em>r<\/em> digits appear <em>q<\/em> times, and <em>r<\/em> \u2212 1 digits appear <em>q<\/em> times.<\/p>\n<p>Looking back at the example with <em>p<\/em> = 13, we have <em>q<\/em> = 1 and <em>r<\/em> = 3. The corollary says we should expect 8 digits to appear once and 2 digits to appear twice. And that&#8217;s what we see: in the sets 076923 and 153846 we have 3 and 6 repeated twice and the remaining 8 digits appear once.<\/p>\n<p>In the example with <em>p<\/em> = 41, we have <em>q<\/em> = 4 and <em>r<\/em> = 1. So we expect all 10 digits to appear 4 times, which is the case.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2014\/11\/12\/cyclic-fractions\/\">Cyclic fractions<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2016\/10\/18\/periods-of-fractions\/\">Periods of fractions<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2018\/05\/30\/calendars-and-continued-fractions\/\">Calendars and continued fractions<\/a><\/li>\n<\/ul>\n<p>[1] James K. Schiller. A Theorem in the Decimal Representation of Rationals. The American Mathematical Monthly<br \/>\nVol. 66, No. 9 (Nov., 1959), pp. 797-798<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a lot of mathematics just off the beaten path. You can spend a career in math and yet not know all there is to know about even the most basic areas of math. For example, this post will demonstrate something you may not have seen about decimal forms of fractions. Let p &gt; 5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[94],"class_list":["post-246958","post","type-post","status-publish","format-standard","hentry","category-math","tag-number-theory"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246958"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246958\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246957,"date":"2026-04-09T12:54:21","date_gmt":"2026-04-09T17:54:21","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246957"},"modified":"2026-04-09T12:54:21","modified_gmt":"2026-04-09T17:54:21","slug":"pyramid-speed-of-light","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/09\/pyramid-speed-of-light\/","title":{"rendered":"The Great Pyramid of Giza and the Speed of Light"},"content":{"rendered":"<p>Saw a <a href=\"https:\/\/x.com\/Andercot\/status\/2042088784255447062?s=20\">post<\/a> on X saying that the latitude of the Pyramid of Giza is the same as the speed of light.<\/p>\n<p>I looked into this, expecting it to be approximately true. It&#8217;s <em>exactly<\/em> true in the sense that the speed of light in vacuum is 299,792,458 m\/s and the line of latitude 29.9792458\u00b0 N passes through the pyramid. The exact center of the pyramid is at 29.97917\u00b0 N, 31.13417\u00b0 E.<\/p>\n<p>Of course this is a coincidence. Even if you believe that somehow the ancient Egyptians knew the speed of light, the meter was defined four millennia after the pyramid was built. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Saw a post on X saying that the latitude of the Pyramid of Giza is the same as the speed of light. I looked into this, expecting it to be approximately true. It&#8217;s exactly true in the sense that the speed of light in vacuum is 299,792,458 m\/s and the line of latitude 29.9792458\u00b0 N [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-246957","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246957"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246957\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246955,"date":"2026-04-09T12:25:08","date_gmt":"2026-04-09T17:25:08","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246955"},"modified":"2026-04-09T12:25:08","modified_gmt":"2026-04-09T17:25:08","slug":"random-hexagon-fractal","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/09\/random-hexagon-fractal\/","title":{"rendered":"Random hexagon fractal"},"content":{"rendered":"<p>I recently ran across a <a href=\"https:\/\/x.com\/LensScientific\/status\/2041951822727016930?s=20\">post<\/a> on X describing a process for creating a random fractal. First, pick a random point <em>c<\/em> inside a hexagon.<\/p>\n<p>Then at each subsequent step, pick a random side of the hexagon and create the triangle formed by that side and\u00a0<em>c<\/em>. Update\u00a0<em>c<\/em> to be the center of the new triangle and plot\u00a0<em>c<\/em>.<\/p>\n<p>Note that you only choose a random <em>point<\/em> inside the hexagon once. After that you randomly choose <em>sides<\/em>.<\/p>\n<p>Now there are <a href=\"https:\/\/faculty.evansville.edu\/ck6\/encyclopedia\/etc.html\">many<\/a> ways to define the center of a triangle. I assumed the original meant barycenter (centroid) when it said &#8220;center&#8221;, and apparently that was correct. I was able to create a similar figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/hex_barycenter.png\" width=\"314\" height=\"355\" \/><\/p>\n<p>But if you define center differently, you get a different image. For example, here&#8217;s what you get when you use the incenter, the center of the largest circle inside the triangle.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/hex_incenter.png\" width=\"314\" height=\"355\" \/><\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href=\"https:\/\/www.johndcook.com\/blog\/2025\/09\/11\/random-inside-triangle\/\">Randomly selecting points in a triangle<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2023\/09\/09\/triangle-subdivision\/'>Subdividing a triangle with various centers<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2025\/08\/16\/randomly-generated-dragon\/'>Randomly generated dragon fractal<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2017\/07\/08\/the-chaos-game-and-the-sierpinski-triangle\/\">The chaos game and the Sierpinski triangle<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I recently ran across a post on X describing a process for creating a random fractal. First, pick a random point c inside a hexagon. Then at each subsequent step, pick a random side of the hexagon and create the triangle formed by that side and\u00a0c. Update\u00a0c to be the center of the new triangle [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[224],"class_list":["post-246955","post","type-post","status-publish","format-standard","hentry","category-math","tag-geometry"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246955"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246955\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246954,"date":"2026-04-08T19:18:57","date_gmt":"2026-04-09T00:18:57","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246954"},"modified":"2026-04-08T19:19:39","modified_gmt":"2026-04-09T00:19:39","slug":"andrica","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/08\/andrica\/","title":{"rendered":"Root prime gap"},"content":{"rendered":"<p>I recently found out about Andrica&#8217;s conjecture: the square roots of consecutive primes are less than 1 apart.<\/p>\n<p>In symbols, Andrica&#8217;s conjecture says that if <em>p<\/em><sub><em>n<\/em><\/sub> and <em>p<\/em><sub><em>n<\/em>+1<\/sub> are consecutive prime numbers, then<\/p>\n<p style=\"padding-left: 40px;\">\u221a<em>p<\/em><sub><em>n<\/em>+1<\/sub> \u2212 \u221a<em>p<\/em><sub><em>n<\/em><\/sub> &lt; 1.<\/p>\n<p>This has been empirically verified for primes up to 2 \u00d7 10<sup>19<\/sup>.<\/p>\n<p>If the conjecture is true, it puts an upper bound on how long you&#8217;d have to search to find the next prime:<\/p>\n<p style=\"padding-left: 40px;\"><em>p<\/em><sub><em>n<\/em>+1<\/sub> &lt; 1 + 2\u221a<em>p<\/em><sub><em>n<\/em><\/sub>\u00a0 + <em>p<\/em><sub><em>n<\/em><\/sub>,<\/p>\n<p>which would be an improvement on the Bertrand-Chebyshev theorem that says<\/p>\n<p style=\"padding-left: 40px;\"><em>p<\/em><sub><em>n<\/em>+1<\/sub> &lt; 2<em>p<\/em><sub><em>n<\/em><\/sub>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently found out about Andrica&#8217;s conjecture: the square roots of consecutive primes are less than 1 apart. In symbols, Andrica&#8217;s conjecture says that if pn and pn+1 are consecutive prime numbers, then \u221apn+1 \u2212 \u221apn &lt; 1. This has been empirically verified for primes up to 2 \u00d7 1019. If the conjecture is true, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[94],"class_list":["post-246954","post","type-post","status-publish","format-standard","hentry","category-math","tag-number-theory"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246954"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246954\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246952,"date":"2026-04-08T18:30:15","date_gmt":"2026-04-08T23:30:15","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246952"},"modified":"2026-04-08T18:30:15","modified_gmt":"2026-04-08T23:30:15","slug":"artemis-1-apollo-12","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/08\/artemis-1-apollo-12\/","title":{"rendered":"A Three- and a Four- Body Problem"},"content":{"rendered":"<p><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/04\/02\/artemis-apollo\/\">Last week<\/a> I wrote about the orbit of Artemis II. The orbit of Artemis I was much more interesting.<\/p>\n<p>Because Artemis I was unmanned, it could spend a lot more time in orbit. The Artemis I mission took 25 days while Artemis II will take 10 days. Artemis I took an unusual path, orbiting the moon the opposite direction of the moon&#8217;s orbit around earth. <a href=\"https:\/\/www.youtube.com\/watch?v=AvVFy3Feb1U&amp;list=WL&amp;index=2\">This video<\/a> by Primal Space demonstrates the orbit both from the perspective of earth and from the perspective of the Moon.<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=vLefsklLkqQ&amp;list=WL&amp;index=1\">Another video<\/a> from Primal Space describes the orbit of the third stage of Apollo 12. This stage was supposed to orbit around the sun in 1971, but an error sent it on a complicated unstable orbit of the earth, moon, and sun. It returned briefly to earth in 2002 and expected to return sometime in the 2040s.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2021\/12\/28\/lagrange-points-l1-and-l2\/'>Finding Lagrange points<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2021\/12\/30\/stable-lagrange-points\/'>When are Lagrange points stable?<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2024\/01\/27\/butterflies-dont-work-that-way\/'>Bad takes on chaos theory<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Last week I wrote about the orbit of Artemis II. The orbit of Artemis I was much more interesting. Because Artemis I was unmanned, it could spend a lot more time in orbit. The Artemis I mission took 25 days while Artemis II will take 10 days. Artemis I took an unusual path, orbiting the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-246952","post","type-post","status-publish","format-standard","hentry","category-science"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246952"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246952\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246950,"date":"2026-04-06T19:33:23","date_gmt":"2026-04-07T00:33:23","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246950"},"modified":"2026-04-07T06:38:57","modified_gmt":"2026-04-07T11:38:57","slug":"tofolli-gates","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/06\/tofolli-gates\/","title":{"rendered":"Toffoli gates are all you need"},"content":{"rendered":"<p>Landauer&#8217;s principle gives a lower bound on the amount of energy it takes to erase one bit of information:<\/p>\n<p style=\"padding-left: 40px;\"><em>E<\/em> \u2265 log(2) <em>k<\/em><sub><em>B<\/em><\/sub> <em>T<\/em><\/p>\n<p>where <em>k<\/em><sub><em>B<\/em><\/sub> is the Boltzmann constant and <em>T<\/em> is the ambient temperature in Kelvin. The lower bound applies no matter how the bit is physically stored. There is no theoretical lower limit on the energy required to carry out a reversible calculation.<\/p>\n<p>In practice the energy required to erase a bit is around a billion times greater than Landauer&#8217;s lower bound. You might reasonably conclude that reversible computing isn&#8217;t practical since we&#8217;re nowhere near the Landauer limit. And yet in practice reversible circuits have been demonstrated to use less energy than conventional circuits. We&#8217;re far from the ultimate physical limit, but reversibility still provides practical efficiency gains today.<\/p>\n<p>A Toffoli gate is a building block of reversible circuits. A Toffoli gate takes three bits as input and returns three bits as output:<\/p>\n<p style=\"padding-left: 40px;\"><em>T<\/em>(<em>a<\/em>,\u00a0<em>b<\/em>,\u00a0<em>c<\/em>) = (<em>a<\/em>,\u00a0<em>b<\/em>,\u00a0<em>c<\/em> XOR (<em>a<\/em> AND\u00a0<em>b<\/em>)).<\/p>\n<p>In words, a Toffoli gate flips its third bit if and only if the first two bits are ones.<\/p>\n<p>A Toffoli gate is its own inverse, and so it is reversible. This is easy to prove. If <em>a<\/em> =\u00a0<em>b<\/em> = 1, then the third bit is flipped. Apply the Toffoli gate again flips the bit back to what it was. If <em>ab<\/em> = 0, i.e. at least one of the first two bits is zero, then the Toffoli gate doesn&#8217;t change anything.<\/p>\n<p>There is a theorem that any Boolean function can be computed by a circuit made of only NAND gates. We&#8217;ll show that you can construct a NAND gate out of Toffoli gates, which shows any Boolean function can be computed by a circuit made of Toffoli gates, which shows any Boolean function can be computed reversibly.<\/p>\n<p>To compute NAND, i.e. \u00ac (<em>a<\/em> \u2227 <em>b<\/em>), send (<em>a<\/em>,\u00a0<em>b<\/em>, 1) to the Toffoli gate. The third bit of the output will contain the NAND of <em>a<\/em> and <em>b<\/em>.<\/p>\n<p style=\"padding-left: 40px;\"><em>T<\/em><em>(a,\u00a0b<\/em>, 1) = (<em>a<\/em>,\u00a0<em>b<\/em>, \u00ac (<em>a<\/em> \u2227 <em>b<\/em>))<\/p>\n<p>A drawback of reversible computing is that you may have to send in more input than you&#8217;d like and get back more output than you&#8217;d like, as we can already see from the example above. NAND takes two input bits and returns one output bit. But the Toffoli gate simulating NAND takes three input bits and returns three output bits.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2021\/05\/03\/self-reproducing-cellular-automata\/\">Fredkin automata<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2025\/07\/31\/machine-learning-by-satisfiability-solving\/\">Machine learning by satisfiability solving<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2020\/11\/19\/minimizing-boolean-expressions\/\">Minimizing Boolean expressions<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Landauer&#8217;s principle gives a lower bound on the amount of energy it takes to erase one bit of information: E \u2265 log(2) kB T where kB is the Boltzmann constant and T is the ambient temperature in Kelvin. The lower bound applies no matter how the bit is physically stored. There is no theoretical lower [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[68],"class_list":["post-246950","post","type-post","status-publish","format-standard","hentry","category-computing","tag-information-theory"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246950"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246950\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246947,"date":"2026-04-05T18:04:46","date_gmt":"2026-04-05T23:04:46","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246947"},"modified":"2026-04-05T18:08:27","modified_gmt":"2026-04-05T23:08:27","slug":"hipaa-compliant-ai","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/05\/hipaa-compliant-ai\/","title":{"rendered":"HIPAA compliant AI"},"content":{"rendered":"<p>The best way to run AI and remain HIPAA compliant is to run it locally on your own hardware, instead of transferring protected health information (PHI) to a remote server by using a cloud-hosted service like ChatGPT or Claude. [1].<\/p>\n<p>There are HIPAA-compliant cloud options, but they&#8217;re both restrictive and expensive. Even enterprise options are not &#8220;HIPAA compliant&#8221; out of the box. Instead, they are &#8220;HIPAA eligible&#8221; or that they &#8220;support HIPAA compliance,&#8221; because you still need the right Business Associate Agreement (BAA), configuration, logging, access controls, and internal process around it, and the end product often ends up far less capable than a frontier model. The least expensive and therefore most accessible services do not even allow this as an option.<\/p>\n<p>Specific examples:<\/p>\n<ul>\n<li style=\"margin-bottom: 20px;\">Only sales-managed ChatGPT Enterprise or Edu customers are eligible for a BAA, and OpenAI explicitly says it does not offer a BAA for ChatGPT Business. The consumer ChatGPT Health product says HIPAA and BAAs do not apply. ChatGPT for Healthcare pricing is based on ChatGPT Enterprise, depends on organization size and deployment needs, and requires contacting sales. Even within Enterprise, OpenAI&#8217;s Regulated Workspace <a href=\"https:\/\/cdn.openai.com\/osa\/chatgpt-regulated-workspace.pdf\">spec<\/a> lists Codex and the multi-step Agent feature as &#8220;Non-Included Functionality,&#8221; i.e. off limits for PHI.<\/li>\n<li style=\"margin-bottom: 20px;\">Google says Gemini can support HIPAA workloads in Workspace, but NotebookLM is not covered by Google&#8217;s BAA, and Gemini in Chrome is automatically blocked for BAA customers. If a work or school account does not have enterprise-grade data protections, chats in the Gemini app may be reviewed by humans and used to improve Google&#8217;s products.<\/li>\n<li style=\"margin-bottom: 20px;\">GitHub Copilot, despite being a Microsoft product, is not under Microsoft&#8217;s BAA. Azure OpenAI Service is, but only for text endpoints. While Microsoft is working on their own models, it is unlikely that they will deviate significantly here.<\/li>\n<li style=\"margin-bottom: 20px;\">Anthropic says its BAA covers only certain &#8220;HIPAA-ready&#8221; services, namely the first-party API and a HIPAA-ready Enterprise plan, and does not cover Claude Free, Pro, Max, Team, Workbench, Console, Cowork, or Claude for Office. The HIPAA-ready Enterprise offering is sales-assisted only. Bundled Claude Code seats are not covered. AWS Bedrock API calls can work, but this requires extensive configuration and carries its own complexities and restrictions.<\/li>\n<\/ul>\n<p>Running AI locally is already practical as of early 2026. Open-weight models that approach the quality of commercial coding assistants run on consumer hardware. A single high-end GPU or a recent Mac with enough unified memory can run a 70B-parameter model at a reasonable token speed.<\/p>\n<p>There&#8217;s an interesting interplay between economies of scale and diseconomies of scale. Cloud providers can run a data center at a lower cost per server than a small company can. That&#8217;s the economies of scale. But running HIPAA-compliant computing in the cloud, particularly with AI providers, incurs a large direct costs and indirect bureaucratic costs. That&#8217;s the diseconomies of scale. Smaller companies may benefit more from local AI than larger companies if they need to be HIPAA-compliant.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/expert-hipaa-deidentification\/'>HIPAA expert determination<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2026\/03\/02\/an-ai-odyssey-part-1-correctness-conundrum\/'>An AI Odyssey<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2022\/01\/15\/queueing-and-scale\/'>Queueing and economies of scale<\/a><\/li>\n<\/ul>\n<p>[1] This post is not legal advice. My clients are often lawyers, but I&#8217;m not a lawyer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The best way to run AI and remain HIPAA compliant is to run it locally on your own hardware, instead of transferring protected health information (PHI) to a remote server by using a cloud-hosted service like ChatGPT or Claude. [1]. There are HIPAA-compliant cloud options, but they&#8217;re both restrictive and expensive. Even enterprise options are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[260],"tags":[202,103],"class_list":["post-246947","post","type-post","status-publish","format-standard","hentry","category-ai","tag-artificial-intelligence","tag-privacy"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246947"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246947\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246946,"date":"2026-04-04T10:00:14","date_gmt":"2026-04-04T15:00:14","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246946"},"modified":"2026-04-04T13:31:00","modified_gmt":"2026-04-04T18:31:00","slug":"kalman-bayes","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/04\/kalman-bayes\/","title":{"rendered":"Kalman and Bayes average grades"},"content":{"rendered":"<p>This post will look at the problem of updating an average grade as a very simple special case of Bayesian statistics and of Kalman filtering.<\/p>\n<p>Suppose you&#8217;re keeping up with your average grade in a class, and you know your average after <em>n<\/em> tests, all weighted equally.<\/p>\n<p style=\"padding-left: 40px;\"><em>m<\/em> = (<em>x<\/em><sub>1<\/sub> + <em>x<\/em><sub>2<\/sub> + <em>x<\/em><sub>3<\/sub> + \u2026 + <em>x<\/em><sub><em>n<\/em><\/sub>) \/ <em>n<\/em>.<\/p>\n<p>Then you get another test grade back and your new average is<\/p>\n<p style=\"padding-left: 40px;\"><em>m<\/em>\u2032 = (<em>x<\/em><sub>1<\/sub> + <em>x<\/em><sub>2<\/sub> + <em>x<\/em><sub>3<\/sub> + \u2026 + <em>x<\/em><sub><em>n<\/em><\/sub> + <em>x<\/em><sub><em>n<\/em>+1<\/sub>) \/ (<em>n<\/em> + 1).<\/p>\n<p>You don&#8217;t need the individual test grades once you&#8217;ve computed the average; you can instead remember the average\u00a0<em>m<\/em> and the number of grades\u00a0<em>n<\/em> [1]. Then you know the sum of the first\u00a0<em>n<\/em> grades is\u00a0<em>nm<\/em> and so<\/p>\n<p style=\"padding-left: 40px;\"><em>m<\/em>\u2032 = (<em>nm<\/em> + <em>x<\/em><sub><em>n<\/em>+1<\/sub>) \/ (<em>n<\/em> + 1).<\/p>\n<p>You could split that into<\/p>\n<p style=\"padding-left: 40px;\"><em>m<\/em>\u2032 = <em>w<\/em><sub>1<\/sub> <em>m<\/em> + <em>w<\/em><sub>2<\/sub> <em>x<\/em><sub><em>n<\/em>+1<\/sub><\/p>\n<p>where <em>w<\/em><sub>1<\/sub> = <em>n<\/em>\/(<em>n<\/em> + 1) and <em>w<\/em><sub>2<\/sub> = 1\/(<em>n<\/em> + 1). In other words, the new mean is the weighted average of the previous mean and the new score.<\/p>\n<p>A <strong>Bayesian<\/strong> perspective would say that your posterior expected grade <em>m<\/em>\u2032 is a compromise between your prior expected grade\u00a0<em>m<\/em> and the new data <em>x<\/em><sub><em>n<\/em>+1<\/sub>. [2]<\/p>\n<p>You could also rewrite the equation above as<\/p>\n<p style=\"padding-left: 40px;\"><em>m<\/em>\u2032 =\u00a0<em>m<\/em> + (<em>x<\/em><sub><em>n<\/em>+1<\/sub> \u2212 <em>m<\/em>)\/(<em>n<\/em> + 1) = <em>m<\/em> + <em>K<\/em>\u0394<\/p>\n<p>where <em>K<\/em> = 1\/(<em>n<\/em> + 1) and \u0394 = <em>x<\/em><sub><em>n<\/em>+1<\/sub> \u2212 <em>m<\/em>. In <strong>Kalman<\/strong> filter terms,\u00a0<em>K<\/em> is the gain, the proportionality constant for how the change in your state is proportional to the difference between what you saw and what you expected.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2011\/09\/27\/bayesian-amazon\/\">A Bayesian view of Amazon Resellers<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2016\/07\/14\/kalman-filters-and-functional-programming\/\">Kalman filters and functional programming<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2016\/05\/24\/kalman-filters-and-bottom-up-learning\/\">Kalman filters and bottom-up learning<\/a><\/li>\n<\/ul>\n<p>[1] In statistical terms, the mean is a <a href=\"https:\/\/www.johndcook.com\/blog\/2016\/09\/12\/insufficient-statistics\/\">sufficient statistic<\/a>.<\/p>\n<p>[2] You could flesh this out by using a normal likelihood and a flat improper prior.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will look at the problem of updating an average grade as a very simple special case of Bayesian statistics and of Kalman filtering. Suppose you&#8217;re keeping up with your average grade in a class, and you know your average after n tests, all weighted equally. m = (x1 + x2 + x3 + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[183],"class_list":["post-246946","post","type-post","status-publish","format-standard","hentry","category-math","tag-kalman-filter"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246946"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246946\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246945,"date":"2026-04-03T11:31:54","date_gmt":"2026-04-03T16:31:54","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246945"},"modified":"2026-04-03T11:33:00","modified_gmt":"2026-04-03T16:33:00","slug":"roman-moon-greek-moon","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/03\/roman-moon-greek-moon\/","title":{"rendered":"Roman moon, Greek moon"},"content":{"rendered":"<p>I used the term <strong>perilune<\/strong> in <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/04\/02\/artemis-apollo\/\">yesterday&#8217;s post<\/a> about the flight path of Artemis II. When Artemis is\u00a0<em>closest<\/em> to the moon it will be <em>furthest<\/em> from earth because its closest approach to the moon, its perilune, is on the side of the moon opposite earth.<\/p>\n<p>Perilune is sometimes called <strong>periselene<\/strong>. The two terms come from two goddesses associated with the moon, the Roman Luna and the Greek Selene. Since the peri- prefix is Greek, perhaps periselene would be preferable. But we&#8217;re far more familiar with words associated with the moon being based on Luna than Selene.<\/p>\n<p>The neutral terms for closest and furthest points in an orbit are <strong>periapsis<\/strong> and <strong>apoapsis<\/strong>. but there are more colorful terms that are specific to orbiting particular celestial objects. The terms <strong>perigee<\/strong> and <strong>apogee<\/strong> for orbiting earth (from the Greek Gaia) are most familiar, and the terms <strong>perihelion<\/strong> and <strong>aphelion<\/strong> (not apohelion) for orbiting the sun (from the Greek Helios) are the next most familiar.<\/p>\n<p>The terms <strong>perijove<\/strong> and <strong>apojove<\/strong> are unfamiliar, but you can imagine what they mean. Others like <strong>periareion<\/strong> and <strong>apoareion<\/strong>, especially the latter, are truly arcane.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used the term perilune in yesterday&#8217;s post about the flight path of Artemis II. When Artemis is\u00a0closest to the moon it will be furthest from earth because its closest approach to the moon, its perilune, is on the side of the moon opposite earth. Perilune is sometimes called periselene. The two terms come from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[213],"class_list":["post-246945","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-orbital-mechanics"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246945"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246945\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":246944,"date":"2026-04-02T20:38:49","date_gmt":"2026-04-03T01:38:49","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=246944"},"modified":"2026-04-02T20:38:49","modified_gmt":"2026-04-03T01:38:49","slug":"hyperbolic-napier-mnemonic","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/04\/02\/hyperbolic-napier-mnemonic\/","title":{"rendered":"Hyperbolic version of Napier&#8217;s mnemonic"},"content":{"rendered":"<p>I was looking through an old geometry book [1] and saw a hyperbolic analog of Napier&#8217;s mnemonic for spherical trigonometry. In hindsight of course there&#8217;s a hyperbolic analog: there&#8217;s a hyperbolic analog of everything. But I was surprised because I&#8217;d never thought of this before. I suppose the spherical version is famous because of its practical use in navigational calculations, while the hyperbolic analog is of more theoretical interest.<\/p>\n<p><a href=\"https:\/\/www.johndcook.com\/blog\/2012\/12\/23\/napiers-mnemonic\/\">Napier&#8217;s mnemonic<\/a> is a clever way to remember 10 equations in spherical trig. See the linked post for the meanings of the variables.<\/p>\n<p style=\"padding-left: 40px;\">sin\u00a0<em>a<\/em>\u00a0= sin\u00a0<em>A<\/em>\u00a0sin\u00a0<em>c<\/em>\u00a0= tan\u00a0<em>b<\/em>\u00a0cot\u00a0<em>B<\/em><br \/>\nsin\u00a0<em>b<\/em>\u00a0= sin\u00a0<em>B<\/em>\u00a0sin\u00a0<em>c<\/em>\u00a0= tan\u00a0<em>a<\/em>\u00a0cot\u00a0<em>A<\/em><br \/>\ncos\u00a0<em>A<\/em>\u00a0= cos\u00a0<em>a<\/em>\u00a0sin B = tan\u00a0<em>b<\/em>\u00a0cot\u00a0<em>c<\/em><br \/>\ncos\u00a0<em>B<\/em>\u00a0= cos\u00a0<em>b<\/em>\u00a0sin A = tan\u00a0<em>a<\/em>\u00a0cot\u00a0<em>c<\/em><br \/>\ncos\u00a0<em>c<\/em>\u00a0= cot\u00a0<em>A<\/em>\u00a0cot\u00a0<em>B<\/em>\u00a0= cos\u00a0<em>a<\/em>\u00a0cos\u00a0<em>b<\/em><\/p>\n<p>The hyperbolic analog replaces every circular function of\u00a0<em>a<\/em>,\u00a0<em>b<\/em>, or\u00a0<em>c<\/em> with its hyperbolic counterpart.<\/p>\n<p style=\"padding-left: 40px;\">sinh <em>a<\/em>\u00a0= sin\u00a0<em>A<\/em> sinh\u00a0<em>c<\/em> = tanh\u00a0<em>b<\/em>\u00a0cot\u00a0<em>B<\/em><br \/>\nsinh <em>b<\/em>\u00a0= sin\u00a0<em>B<\/em> sinh\u00a0<em>c<\/em> = tanh\u00a0<em>a<\/em>\u00a0cot\u00a0<em>A<\/em><br \/>\ncos\u00a0<em>A<\/em> = cosh\u00a0<em>a<\/em> sin B = tanh\u00a0<em>b<\/em> coth\u00a0<em>c<\/em><br \/>\ncos\u00a0<em>B<\/em> = cosh\u00a0<em>b<\/em> sin A = tanh\u00a0<em>a<\/em> coth\u00a0<em>c<\/em><br \/>\ncosh <em>c<\/em>\u00a0= cot\u00a0<em>A<\/em>\u00a0cot\u00a0<em>B<\/em> = cosh\u00a0<em>a<\/em> cosh\u00a0<em>b<\/em><\/p>\n<p>[1] D. M. Y. Sommerville. The Elements of Non-Euclidean Geometry. 1919.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was looking through an old geometry book [1] and saw a hyperbolic analog of Napier&#8217;s mnemonic for spherical trigonometry. In hindsight of course there&#8217;s a hyperbolic analog: there&#8217;s a hyperbolic analog of everything. But I was surprised because I&#8217;d never thought of this before. I suppose the spherical version is famous because of its [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[224,220],"class_list":["post-246944","post","type-post","status-publish","format-standard","hentry","category-math","tag-geometry","tag-memory"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=246944"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/246944\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=246944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=246944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=246944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]