<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John D. Cook</title>
	<atom:link href="http://www.johndcook.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.johndcook.com/blog</link>
	<description>Applied Mathematics Consulting</description>
	<lastBuildDate>Tue, 03 Nov 2026 14:41:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.johndcook.com/wp-content/uploads/2020/01/cropped-favicon_512-32x32.png</url>
	<title>John D. Cook</title>
	<link>https://www.johndcook.com/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Fraction comparison trick revisited</title>
		<link>https://www.johndcook.com/blog/2026/11/03/fraction-comparison-trick-revisited/</link>
					<comments>https://www.johndcook.com/blog/2026/11/03/fraction-comparison-trick-revisited/#respond</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Tue, 03 Nov 2026 14:41:25 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Probability]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248181</guid>

					<description><![CDATA[<p>A few years ago I wrote about a curious result: a/b is usually greater than c/d when a + d is greater than b + c. And &#8220;usually&#8221; means with probability 11/12. As stated in the post, you can make this statement rigorous by choosing integers up to size N at random and taking the limit as N goes to infinity. We can also choose a, b, c, and d uniformly [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/11/03/fraction-comparison-trick-revisited/">Fraction comparison trick revisited</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.johndcook.com/blog/2021/02/25/fraction-comparison-trick/">A few years ago</a> I wrote about a curious result: <em>a</em>/<em>b</em> is usually greater than <em>c</em>/<em>d</em> when <em>a </em>+ <em>d</em> is greater than <em>b </em>+ <em>c</em>. And &#8220;usually&#8221; means with probability 11/12.</p>
<p>As stated in the post, you can make this statement rigorous by choosing integers up to size <em>N</em> at random and taking the limit as <em>N</em> goes to infinity.</p>
<p>We can also choose <em>a</em>, <em>b</em>, <em>c</em>, and <em>d</em> uniformly from [0, 1]. This is similar to choosing four integers up to <em>N</em> and dividing all the integers by <em>N</em>, which doesn&#8217;t change the probabilities.</p>
<p>Now <em>a</em>/<em>b</em> &gt; <em>c</em>/<em>d</em> if and only if <em>ad</em> &gt; <em>bc</em>, so another way to state the theorem is that</p>
<p style="padding-left: 40px;">Prob(<em>ad</em> &gt; <em>bc </em>| <em>a</em> + <em>d</em> &gt; <em>b</em> + <em>c</em>) = 11/12.</p>
<p>Or to state it yet another way, pick two pairs of numbers at random. The probability that the pair with the larger sum also has the larger product is 11/12. That seems more intuitive to me than the original statement.</p>
<p>If <em>a</em> + <em>d</em> is greater than <em>b</em> + <em>c</em>, it&#8217;s likely that <em>a</em>/<em>b</em> is greater than <em>c</em>/<em>d</em>. It seems plausible that if <em>a</em> + <em>d</em> is <em>much</em> greater than <em>b</em> + <em>c</em>, it&#8217;s <em>more</em> likely that <em>a</em>/<em>b</em> is greater than <em>c</em>/<em>d</em>. Or in terms of cross products, the more the sum of one pair is bigger than the sum of the other, the more likely the product of the former is to be greater than the latter. That is</p>
<p style="padding-left: 40px;"><em>f</em>(<em>r</em>) = Prob(<em>ad</em> &gt; <em>bc </em>| (<em>a</em> + <em>d</em>)/(<em>b</em> + <em>c</em>) ≥ <em>r</em>)</p>
<p>should be an increasing function of <em>r</em>. We know the probability above equals 11/12 when <em>r</em> = 1. We expect that the probability should approach 1 as <em>r</em> goes to infinity.</p>
<p>This is indeed the case, as shown in the plot below.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/f_of_r.png" width="480" height="380" /></p>
<p>In particular, <em>f</em>(2) ≈ 0.99 and <em>f</em>(6) ≈ 0.999. So if <em>a</em> + <em>d</em> is two (or six) times bigger than <em>b +</em> c, there is a 0.99 (or 0.999) probability that <em>ad</em> is larger than <em>bc</em>.</p>
<p>You can calculate <em>f</em>(<em>r</em>) analytically or estimate it by simulation. I had Claude do both and they produce comparable results. There is a closed-form expression for <em>f</em>(<em>r</em>) but it&#8217;s really complicated.</p>The post <a href="https://www.johndcook.com/blog/2026/11/03/fraction-comparison-trick-revisited/">Fraction comparison trick revisited</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/11/03/fraction-comparison-trick-revisited/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Euclidean, Spherical, and Projective Geometry</title>
		<link>https://www.johndcook.com/blog/2026/11/03/spherical-and-projective-geometry/</link>
					<comments>https://www.johndcook.com/blog/2026/11/03/spherical-and-projective-geometry/#respond</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Tue, 03 Nov 2026 12:33:10 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248173</guid>

					<description><![CDATA[<p>Spherical geometry is very tangible because we live on a sphere. Projective geometry seems much more exotic, and yet they&#8217;re closely related. To show how they&#8217;re connected, let&#8217;s go back to the origins of non-Euclidean geometry. Euclidean geometry Here are Euclid&#8217;s five postulates, statements about what geometric objects can be constructred. To draw a straight line from [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/11/03/spherical-and-projective-geometry/">Euclidean, Spherical, and Projective Geometry</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>Spherical geometry is very tangible because we live on a sphere. Projective geometry seems much more exotic, and yet they&#8217;re closely related. To show how they&#8217;re connected, let&#8217;s go back to the origins of non-Euclidean geometry.</p>
<h2>Euclidean geometry</h2>
<p>Here are Euclid&#8217;s five postulates, statements about what geometric objects can be constructred.</p>
<ol>
<li>To draw a straight line from any point to any point.</li>
<li>To produce (extend) a finite straight line continuously in a straight line.</li>
<li>To describe a circle with any centre and distance (radius).</li>
<li>That all right angles are equal to one another.</li>
<li>That, if a straight line falling on two straight lines makes the interior angles on the same side less than two right angles, the two straight lines, if produced indefinitely, meet on that side on which the angles are less than two right angles.</li>
</ol>
<p>Clearly there&#8217;s something different about the fifth postulate, the parallel postulate. It&#8217;s much longer and more complicated than the other postulates. There was speculation from ancient times that the parallel postulate might be unnecessary, that it could be derived as a theorem rather than stated as an axiom.</p>
<h2>Non-Euclidean geometry</h2>
<p>Giovanni Girolamo Saccheri (1667–1733) tried to prove the fifth postulate by contradiction, and in the process began the study of non-Euclidean geometry. He wasn&#8217;t the first to try to prove the fifth postulate. Ptolemy, for example, tried to prove the fifth postulate as a theorem in the second century AD. But Saccheri was the first to try a proof by contradiction, or at least the first to extensively explore contradictions to the parallel postulate.</p>
<p>A more modern formulation of the parallel postulate says</p>
<p style="padding-left: 40px;">Given a line <em>ℓ</em> and a point <em>P</em> not on <em>ℓ</em>, there is exactly one line through <em>P</em> parallel to <em>ℓ</em>.</p>
<p>Non-Euclidean geometry replaces this axiom with an alternative, such as saying there are multiple lines parallel to <em>ℓ </em>or that there are no lines parallel to <em>ℓ</em>.</p>
<p>Note that non-Euclidean geometry is not an arbitrary tinkering with the axioms of geometry just to see what happens. It tinkers with one specific axiom for motivated reasons.</p>
<h2>Spherical geometry</h2>
<p>You can create models of non-Euclidean geometry using Euclidean geometry. For example, spherical geometry is constructed by defining a (spherical) point as a (Euclidean) point on a sphere, and defining a (spherical) line to be a great circle, the intersection of a (Euclidean) plane with the sphere. In spherical geometry there are no parallel lines: all lines intersect.</p>
<p>This example shows that non-Euclidean geometry need not be non-physical. If you leave general relativity out of the picture and think of physical space as undeniably Euclidean, it can still be useful to think of different geometries to describe objects in Euclidean space.</p>
<h2>Projective geometry</h2>
<p>In projective geometry, all distinct lines intersect at one point.</p>
<p>In spherical geometry, all distinct lines intersect at two points, on opposite sides of a great circle. If you consider antipodal pairs of points on a sphere to be a single point in the projective plane, now all lines intersect at a single point. Projective geometry is just one step away from spherical geometry.</p>
<p>The recent thread of posts started with a <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">post</a> a couple weeks ago about two versions of the law of cosines on a sphere, one for sides and one for angles. You can go from one to the other by going from a spherical triangle to its polar triangle. That started me going down the rabbit hole of poles and polars, first in spherical geometry, then in plane geometry, then in projective geometry, culminating <a href="https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/">here</a>.</p>
<p>Now we have two ways of producing poles and polars on a sphere: the original construction in terms of spherical geometry, and the projective construction. They are consistent: you can do spherical geometry, then identify antipodal points, or you can identify antipodal points, then do projective geometry. You end up at the same place by either path.</p>
<p>One theme in the last few posts has been that projective geometry is not an arbitrary exercise in abstraction but a framework that can simplify how we think about things. For example, when I defined the polar triangle of a spherical triangle <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">here</a>, I said that the vertices of the polar triangle are the poles of the sides of the original triangle. Imagine the side as the equator of the sphere and take one of the poles; that&#8217;s where the abstract concept of &#8220;pole&#8221; comes from. But which pole do you take? There is a convention for answering this question, but in projective geometry it doesn&#8217;t matter: both (spherical) poles constitute one (projective) point.</p>
<h2>Posts in this series</h2>
<ul>
<li class='link'><a href='https://www.johndcook.com/blog/2026/10/24/polar-triangle/'>Duality in spherical trig</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2026/10/25/poles-and-polars/'>Poles and polars</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2026/10/26/inversion-in-an-ellipse/'>Inversion in an ellipse</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/'>Unified view of poles and polars</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2026/11/02/projective-plane/'>Making peace with the projective plane</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/'>From a hack to a rigorous definition</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/11/03/spherical-and-projective-geometry/">Euclidean, Spherical, and Projective Geometry</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/11/03/spherical-and-projective-geometry/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How a programming might reinvent the projective plane</title>
		<link>https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/</link>
					<comments>https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/#respond</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Tue, 03 Nov 2026 10:45:19 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248174</guid>

					<description><![CDATA[<p>This post will show how a graphic programmer&#8217;s hack could lead to a rigorous definition of the projective plane. As mentioned in the previous post, we start by adding some &#8220;points at infinity&#8221; to Euclidean plane to take care of exceptional situations. For example, instead of saying most pairs of lines intersect at a single [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/">How a programming might reinvent the projective plane</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>This post will show how a graphic programmer&#8217;s hack could lead to a rigorous definition of the projective plane.</p>
<p>As mentioned in the <a href="https://www.johndcook.com/blog/2026/11/02/projective-plane/">previous post</a>, we start by adding some &#8220;points at infinity&#8221; to Euclidean plane to take care of exceptional situations. For example, instead of saying most pairs of lines intersect at a single point but some don&#8217;t intersect at all, you could say all pairs of lines intersect at a point, but for some pairs of lines, namely parallel lines, that intersection point is &#8220;at infinity.&#8221;</p>
<p>Suppose you need to write a program to find the intersection of two lines. The usual way of doing this would be to implement a <a href="https://www.johndcook.com/blog/2021/12/06/partial-functions/">partial function</a> that takes two lines as input, and sometimes returns a point of intersection and sometimes does something else: it crashes, or throws an exception, or hangs. But if we add in points at infinity, our program could always return a point.</p>
<p>But how are you going to represent points at infinity? It&#8217;s not enough to use a floating point infinity, because different lines intersect at different points at infinity. For example, the lines <em>y</em> = 1 and <em>y</em> = 2 intersect at the point at infinity in the horizontal direction, but the lines <em>x</em> = 1 and <em>x</em> = 2 intersect at the point at infinity in the vertical direction. You could say the former lines intersect at (o, inf) and the latter at (inf, 0), but that won&#8217;t work in general.</p>
<p>The lines <em>y</em> = 3<em>x</em> + 1 and <em>y</em> = 3<em>x</em> + 1 intersect at the point at infinity with slope 3, but the lines <em>y</em> = 5<em>x</em> + 1 and <em>y</em> = 5<em>x</em> + 1 intersect at the point at infinity with slope 5. If you say both pairs of lines meet at (inf, inf) you&#8217;ve lost information.</p>
<p>So you come up with a hack. You represent points not as (<em>x</em>, <em>y</em>) pairs but as (<em>x</em>, <em>y</em>, <em>f</em>) where <em>x</em> and <em>y</em> are real numbers but <em>f</em> is a Boolean flag. Now (<em>x</em>, <em>y</em>, true) represents the ordinary point (<em>x</em>, <em>y</em>) and (<em>x</em>, <em>y</em>, false) represents the point at infinity in the direction of the line from the origin to (<em>x</em>, <em>y</em>). Problem solved!</p>
<p>After a while, you realize that this hack can be useful for more than just finding the intersection of lines. You discover that if you use a real number instead of a Boolean for the last coordinate, you can implement translations and rotations using matrix multiplication. So you replace true and false with 1 and 0, do your matrix calculation, then divide by the last coordinate so the result ends in 1 or 0 again. And this works really well.</p>
<p>This last coordinate is starting to act more like the other coordinates. You treat it as a peer when you multiply triples by a matrix, but only temporarily. You immediately normalize at the end to get back to more familiar territory.</p>
<p>Maybe it occurs to you after a while that you&#8217;re doing something analogous the introduction of imaginary numbers. At first the square root of −1 was seen as a hack that produced correct answers. It wasn&#8217;t <em>really</em> a number but something <em>imagined</em> to be a number as an aid to calculation. Over time mathematicians got more comfortable with these imaginary numbers and explored what would happen if they were treated as first class citizens. Maybe you should do the same with this third coordinate that started out as a hack.</p>
<p>This leads you to homogenous coordinates. A point in the extended plane you&#8217;ve created is represented by a triple (<em>x</em>, <em>y</em>, <em>z</em>) with the understanding that given a number λ ≠ 0, (<em>x</em>, <em>y</em>, <em>z</em>) and (λ<em>x</em>, λ<em>y</em>, λ<em>z</em>) represent the same point. This is the natural extension of always dividing by the last coordinate, if it&#8217;s not zero, so that the triple always ends in 1. And you discover after a while that you need to add in the requirement that not all the coordinates can be zero at the same time.</p>
<p>You show this to a mathematician friend and he puts your construction in fancier language. He says you&#8217;re extended plane is ℝ³ minus the origin, modulo non-zero scalar multiplication. In other words, the points in your extended plane are equivalence classes of points in ℝ³.</p>
<p>Now if you think about this geometrically, your equivalence classes are lines through the origin because that&#8217;s what you get when you look at all scalar multiples of a given vector. What started out as the plane with extra points added is now the set of all lines though the origin. That&#8217;s one way to define the projective plane: a point in the projective plane corresponds to a line through the origin in ℝ³. Furthermore, a line in the projective plane corresponds to a plane through the origin in ℝ³.</p>
<p>Lines through the origin are determined by where they cross the unit sphere, so you could think of the projective plane as a sphere with one modification: because a line through the origin crosses the sphere in two antipodal points, we consider those two points in ℝ³ to be a single point in the projective plane.</p>The post <a href="https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/">How a programming might reinvent the projective plane</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Making peace with the projective plane</title>
		<link>https://www.johndcook.com/blog/2026/11/02/projective-plane/</link>
					<comments>https://www.johndcook.com/blog/2026/11/02/projective-plane/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 02 Nov 2026 14:44:02 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Algebraic geometry]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248151</guid>

					<description><![CDATA[<p>In my newsletter I give an introduction to the latest few posts and occasionally give some additional commentary. In my latest newsletter I wrote Projective space and homogeneous coordinates seemed like arbitrary abstractions when I was a student because they were presented without any motivation. Much later I came to realize that they’re natural, almost [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/11/02/projective-plane/">Making peace with the projective plane</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>In my newsletter I give an introduction to the latest few posts and occasionally give some additional commentary. In my latest newsletter I wrote</p>
<blockquote><p>Projective space and homogeneous coordinates seemed like arbitrary abstractions when I was a student because they were presented without any motivation. Much later I came to realize that they’re natural, almost inevitable. Exceptional cases and hand-wavy references to objects “at infinity” go away when moving to projective space.</p></blockquote>
<p>My mathematics education was very top-down: abstractions first, specifics later (if ever). I was OK with that for a while, until I hit my abstraction tolerance sometime in grad school. Now I would advocate more of a bottom-up approach, motivating abstractions first rather than presenting them as a <em>fait accompli</em>.</p>
<p>The first time I saw the projective plane was probably in a topology class where someone said you could construct the plane by starting with a square and gluing opposite edges in a physically impossible way. This seemed like a gimmick, a way to construct a non-orientable manifold but not anything practical. Another construction is to say the projective plane is an ordinary sphere with antipodal points identified. I found that a little more satisfying, but it still unmotivated.</p>
<p>What I would have appreciated was someone saying that the projective plane was invented to make geometry more elegant by eliminating exceptional cases and making rigorous the idea of things &#8220;at infinity.&#8221; For example, geometric calculations often have to treat vertical lines specially, but vertical lines are not special in projective geometry.</p>
<p>You could start by saying we&#8217;re going to represent points in the plane not simply as (<em>x</em>, <em>y</em>) but as (<em>x</em>, <em>y</em>, 1) and use (<em>x</em>, <em>y</em>, 0) for the point at infinity in the direction (<em>x</em>, <em>y</em>). That may seem like a hack, but it&#8217;s certainly motivated. It&#8217;s exactly the sort of thing a graphics programmer would do. In fact, I imagine many programmers have done just that, independently bumping into projective geometry.</p>
<p>After having introduced this extra coordinate, it&#8217;s natural to ask what would it mean if the last coordinate were something other than 0 or 1. You&#8217;ll quickly run into this when you start doing calculations on these extended coordinates. You could have a rule that you always normalize by dividing by the last coordinate, if it&#8217;s not zero, and then you have essentially discovered homogeneous coordinates. (<strong>Update</strong>; I develop this idea in more detail in the <a href="https://www.johndcook.com/blog/2026/11/03/hack-to-rigor/">next post</a>.)</p>
<p>You&#8217;ll see something like the approach above in elliptic curve cryptography. Programmers wanting to implement encryption algorithms are thinking concretely in terms of (<em>x</em>, <em>y</em>) points, until they have to worry about a mysterious &#8220;point at infinity&#8221; and handle it correctly. Then homogenous coordinates appear as a tool for getting out of a bind.</p>
<p style="text-align: center;">***</p>
<p>I thought about titling this post something like &#8220;Dr. Strangelove, or: How I Learned to Stop Worrying and and Love the Projective Plane&#8221; but I wasn&#8217;t sure how well that would go over. I doubt many readers have seen the 1964 movie this is alluding to, but the trope &#8220;How I Learned to Stop Worrying and Love …&#8221; is more widely known than the movie itself.</p>The post <a href="https://www.johndcook.com/blog/2026/11/02/projective-plane/">Making peace with the projective plane</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/11/02/projective-plane/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>A unified view of poles and polars</title>
		<link>https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/</link>
					<comments>https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 01 Nov 2026 20:29:54 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Algebraic geometry]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248142</guid>

					<description><![CDATA[<p>I wrote several posts on poles and polars a few days ago. First, I wrote about the dual of a spherical triangle, called the polar triangle. Then I wrote about poles and polars in plane geometry and briefly mentioned the extension to projective geometry. Poles and polars are a little awkward in the plane because [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/">A unified view of poles and polars</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>I wrote several posts on poles and polars a few days ago. First, I wrote about the dual of a spherical triangle, called the <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">polar triangle</a>. Then I wrote about <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">poles and polars</a> in plane geometry and briefly mentioned the extension to projective geometry.</p>
<p>Poles and polars are a little awkward in the plane because you have to pay attention to special cases. Poles and polars are relative to a conic section, and are defined/computed differently depending on whether you&#8217;re taking the dual with respect to an <a href="https://www.johndcook.com/blog/2026/10/26/inversion-in-an-ellipse/">ellipse</a>, parabola, or hyperbola. Also, the polar of the center of a conic section isn&#8217;t defined.</p>
<h2>Projective space</h2>
<p>If you move from the Euclidean plane to the projective plane, the exceptions go away, though it may not seem so if you&#8217;re talking about points at infinity or lines at infinity. If you fully commit to working in projective space, there aren&#8217;t any hand-wavy points or lines &#8220;at infinity.&#8221; There&#8217;s not even a distinction between ellipses, parabolas, and hyperbolas.</p>
<p>There&#8217;s no such thing as a free lunch, and the cost of this elegant unification is moving to a bigger geometric space with a different coordinate system. Instead of working in the Euclidean spaces <em>R</em>² or <em>R</em><sup><em>n</em></sup>, we work in <em>P</em><sup><em>n</em></sup> over a field <em>F</em> which could be <em>R</em> but doesn&#8217;t need to be [1].</p>
<p>The coordinates on <em>P</em><sup><em>n</em></sup> are homogeneous coordinates, (<em>n</em> + 1)-tuples of field elements, not all equal to zero, with two (<em>n</em> + 1)-tuples representing the same point if they are proportional, i.e. one is a non-zero multiple of the other.</p>
<p>We can embed <em>R</em><sup><em>n</em></sup> in <em>P</em><sup><em>n</em></sup> by adding an extra coordinate on the end, set equal to 1. You could think of this extra coordinate as a <strong>switch</strong>, set to 1 for finite points and set to 0 for infinite points. But this distinction between finite and infinite points is an artifact of the embedding, not a property of <em>P</em><sup><em>n</em></sup>: there are no special points in <em>P</em><sup><em>n</em></sup>. A point that is &#8220;at infinity&#8221; in one embedding of <em>R</em><sup><em>n</em></sup> in <em>P</em><sup><em>n</em></sup> need not be in another embedding.</p>
<h2>Poles and polars</h2>
<p>Once you accept the need to work in homogeneous coordinates, everything becomes simple and consistent.</p>
<p>A quadric (a conic section when <em>n</em> = 2) is the set of points</p>
<p style="padding-left: 40px;">{<em>x</em> : <em>x</em>ᵀ<em>A</em><em>x</em> = 0}</p>
<p>where <em>A</em> is a non-singular (<em>n</em> + 1) by (<em>n</em> + 1) symmetric matrix over <em>F</em>.</p>
<p>The <strong>polar</strong> of a point <em>p</em> is the hyperplane</p>
<p style="padding-left: 40px;">{<em>x</em> : <em>p</em>ᵀ<em>A</em><em>x</em> = 0}</p>
<p>and the <strong>pole</strong> of a hyperplane</p>
<p style="padding-left: 40px;"><em>H</em> = {<em>x</em> : <em>u</em>ᵀ<em>x</em> = 0}</p>
<p>is the point</p>
<p style="padding-left: 40px;"><em>p</em> = <em>A</em><sup>−1</sup> <em>u</em>.</p>
<p>Notice there&#8217;s no mention of &#8220;infinity&#8221; in this section. All the calculations take place in the field <em>F</em> with no points at infinity added.</p>
<p>[1] The only requirement is that the field <em>F</em> cannot have characteristic 2. So <em>F</em> could be the reals, the rationals, the complex numbers, etc. <em>F</em> could even be a finite field as long as the number of elements in <em>F</em> is not a power of 2.</p>The post <a href="https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/">A unified view of poles and polars</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/11/01/projective-poles-and-polars/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>The Unbalanced Group Theorem</title>
		<link>https://www.johndcook.com/blog/2026/10/28/the-unbalanced-group-theorem/</link>
					<comments>https://www.johndcook.com/blog/2026/10/28/the-unbalanced-group-theorem/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 28 Oct 2026 11:51:51 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Group theory]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248136</guid>

					<description><![CDATA[<p>The classification of finite simple groups (CFSG) has been called the biggest theorem in mathematics. It is big, not necessarily in terms of its importance, but in the sense that its proof developed over the course of decades and thousands of pages of journal articles. Two days ago Axiom announced it had formalized the proof [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/28/the-unbalanced-group-theorem/">The Unbalanced Group Theorem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The classification of finite simple groups (CFSG) has been called the biggest theorem in mathematics. It is big, not necessarily in terms of its importance, but in the sense that its proof developed over the course of decades and thousands of pages of journal articles.</p>
<p>Two days ago <a href="https://cfsg.axiommath.ai/">Axiom</a> announced it had formalized the proof of CFSG in 43.1 million lines of Lean. If you click on the link for the accompanying paper, you&#8217;ll find that the title of the paper is <strong>The Unbalanced Group Theorem</strong>, not The Classification of Finite Simple Groups. Why is that?</p>
<p>The unbalanced group theorem (UGT) is a key component of the CFSG. In the course of their effort to formalize CFSG Axiom found counterexamples to an assertion that the 1986 proof of UGT depends on. The UGT, and the CFSG that depends on it, is correct, but the proof was flawed. Axiom formalized the entire CFSG but focused their paper on their new proof of the UGT.</p>
<p style="text-align: center;">***</p>
<p>What exactly does the UGT say? For that matter, what is a finite simple group?</p>
<p>A short post like this can only go into so much detail, but I&#8217;ll see what I can do.</p>
<p>A group represents some kind of symmetry. Groups can be built out of simple groups sorta like the way integers can be built out of primes. See more on the comparison between simple groups and prime numbers <a href="https://www.johndcook.com/blog/2023/09/26/prime-numbers-simple-groups/">here</a>.</p>
<p>The CFSG says that every finite simple group is cyclic, alternating, of Lie type, or sporadic. The UGT is a technical result used in proving that nothing is missing from this list of possibilities.</p>
<p>What does it mean for a group to be &#8220;unbalanced&#8221;? This depends on a few preliminary definitions.</p>
<ul>
<li>Define <em>O</em>(<em>G</em>) to be the largest normal subgroup of <em>G</em> with an odd number of elements.</li>
<li>An element <em>t</em> in <em>G</em> is called an involution if it has order 2: <em>t</em> is not the identity but <em>t</em>² is.</li>
<li>The centralizer of an element <em>t</em> of a group <em>G</em>, written <em>C</em><sub><em>G</em></sub>(<em>t</em>), is the set of elements of G that commute with <em>t</em>.</li>
</ul>
<p>A group <em>G</em> is <strong>unbalanced</strong> if <em>O</em>(<em>C</em><sub><em>G</em></sub>(<em>t</em>)) is a not a subgroup of <em>O</em>(<em>G</em>) for some involution <em>t</em>.</p>
<p>The UGT is a classification theorem for unbalanced groups.</p>
<h2>Related posts</h2>
<ul>
<li class='link'><a href='https://www.johndcook.com/blog/2020/08/27/how-big-is-the-monster/'>How big is the monster?</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2018/09/02/orders-of-finite-simple-groups/'>Orders of finite simple groups</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2018/09/09/duplication-in-cfsg/'>Overlaps in the CFSG</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/10/28/the-unbalanced-group-theorem/">The Unbalanced Group Theorem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/28/the-unbalanced-group-theorem/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>The Exponential Time Hypothesis is False</title>
		<link>https://www.johndcook.com/blog/2026/10/27/eth-false/</link>
					<comments>https://www.johndcook.com/blog/2026/10/27/eth-false/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Tue, 27 Oct 2026 12:13:21 +0000</pubDate>
				<category><![CDATA[Computational Complexity]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[SAT solvers]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248129</guid>

					<description><![CDATA[<p>If you have an expression in n Boolean variables, how long does it take to find out whether some assignment of values to the variables makes the expression true? There is an obvious upper bound: you can find out in 2n steps by exhaustive search, trying all possible ways of setting each variable to true [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/27/eth-false/">The Exponential Time Hypothesis is False</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>If you have an expression in <em>n</em> Boolean variables, how long does it take to find out whether some assignment of values to the variables makes the expression true? There is an obvious upper bound: you can find out in 2<sup><em>n</em></sup> steps by exhaustive search, trying all possible ways of setting each variable to true or false.</p>
<p>You can often do better than exhaustive search for a particular problem, but can you <em>always</em> do better, even in the worst case? The Monien–Speckenmeyer branching algorithm, published in 1985, is more efficient than exhaustive search, but it still takes exponential time.</p>
<h2>3-SAT</h2>
<p>The Boolean satisfiability problem (SAT) asks whether a Boolean expression in conjunctive normal form (<a href="https://www.johndcook.com/blog/seven-normal-forms-in-logic/">CNF</a>) can be satisfied by some assignment of values to the variables. The <em>k</em>-SAT problem is the special case of SAT in which no clause contains more than <em>k</em> variables. The 2-SAT problem can be solved in polynomial time, but the case of the 3-SAT problem is unknown.</p>
<p>The 3-SAT problem is NP-complete, and so if there is a polynomial-time algorithm for solving 3-SAT, every NP problem, including the full SAT problem, can be solved in polynomial time, i.e. P = NP.</p>
<p>The Monien–Speckenmeyer algorithm mentioned above can solve a 3-SAT problem in</p>
<p style="padding-left: 40px;"><em>O</em>( |<em>F</em>| φ<sup><em>n</em></sup> )</p>
<p>time, where |<em>F</em>| is the length of the input formula and φ is the golden ratio. Now φ &lt; 2, and so this is better than exhaustive search, but the run time is still exponential in the number of variables <em>n</em>.</p>
<h2>ETH</h2>
<p>The exponential time hypothesis (ETH) claims that 3-SAT requires exponential time, which would imply P ≠ NP. <a href="https://hexagonmath.org/2610.00577v1">Anthropic</a> and <a href="https://github.com/openai/math/blob/main/preprints/The-Exponential-Time-Hypothesis-is-False-October-25-2026/paper.pdf">OpenAI</a> have both published proofs that ETH is false. The status of P = NP is still unknown: while 3-SAT does not take exponential time, it still takes more than polynomial time as far as anyone knows.</p>
<p>Yesterday Shiva Kintali posted <a href="https://shivakintali.github.io/papers/ETH.pdf">A simplified proof of ETH is false</a>. The abstract of the paper says</p>
<p style="padding-left: 40px;">For every fixed ε &gt; 0, we give a deterministic 3-SAT algorithm on <i>n</i> variables and <i>m</i> clauses using</p>
<p style="padding-left: 80px;"><i>C</i><sub><i>ε</i></sub>(<i>n</i> + <i>m</i> + 1)<sup><i>c</i><sub><i>ε</i></sub></sup> 2<sup><i>εn</i></sup></p>
<p style="padding-left: 40px;">bit operations, refuting ETH. Our simplified exposition of OpenAI’s proof combines sparsification, bounded occurrences, spectral replacement, and rational interpolation.</p>
<h2>Related posts</h2>
<ul>
<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>
<li class="link"><a href="https://www.johndcook.com/blog/2025/05/11/one-hot-sat/">Formulating the eight queens problem as a SAT problem</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2025/03/17/lessons-learned-with-the-z3-sat-smt-solver/">Lessons learned using the Z3 SAT/SMT solver</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/10/27/eth-false/">The Exponential Time Hypothesis is False</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/27/eth-false/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Inversion in an ellipse</title>
		<link>https://www.johndcook.com/blog/2026/10/26/inversion-in-an-ellipse/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 26 Oct 2026 18:39:32 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248125</guid>

					<description><![CDATA[<p>The previous three post have been part of a series on geometric duality. The traditional but somewhat mysterious terminology is the pole of a line and the polar of a point. As explained here, the terminology was first coined in the context of spherical geometry where the term &#8220;pole&#8221; makes sense. It was then extended to the [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/26/inversion-in-an-ellipse/">Inversion in an ellipse</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The previous three post have been part of a series on geometric duality. The traditional but somewhat mysterious terminology is the <em>pole</em> of a line and the <em>polar</em> of a point. As explained <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">here</a>, the terminology was first coined in the context of spherical geometry where the term &#8220;pole&#8221; makes sense. It was then extended to the plane where the meaning is less obvious.</p>
<p>The use of poles and polars is that they preserve certain geometric information, and so they can transform one problem into a dual problem. This was illustrated in the <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">first post</a> in the series. Equations in spherical trigonometry have a buy-one-get-one-free property: applying an identity to the dual of a triangle gives another identity.</p>
<p><a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">This post</a> discussed how to define the pole of a line and the polar of a point with respect to a circle in the plane. The post stated that more generally you can do this in the projective plane. Since there&#8217;s no difference between conic sections in the projective plane, anything you can do for a circle you can do for an ellipse or hyperbola.</p>
<p>Given a point <em>P</em>, we can define its polar line geometrically or algebraically.</p>
<h2>Algebraic approach</h2>
<p>Given an ellipse with equation</p>
<p style="padding-left: 40px;"><em>x</em>²/<em>a</em>² + <em>y</em>²/<em>b</em>² = 1</p>
<p>where <em>a</em> &gt; <em>b</em>, the foci are at ± <em>c</em> where <em>c</em> = √(<em>a</em>² − <em>b</em>²).</p>
<p>For a point <em>P</em> = (<em>x</em><sub>0</sub>, <em>y</em><sub>0</sub>), its polar with respect to the ellipse is the line</p>
<p style="padding-left: 40px;">(<em>x</em><sub>0</sub>/<em>a</em>²) <em>x</em> + (<em>y</em><sub>0</sub>/<em>b</em>²) <em>y</em> = 1.</p>
<h2>Geometric approach</h2>
<p>To find the polar of a point <em>P</em>, we start by inverting <em>P</em> in the ellipse. Draw any line through <em>P</em> that meets the ellipse at two points <em>A</em> and <em>B</em>. On that line there is exactly one point Q that divides <em>AB</em> harmonically with <em>P</em>:</p>
<p style="padding-left: 40px;">QA/QB = PA/PB</p>
<p dir="ltr">with <em>Q</em> on the opposite side of <em>AB</em> from <em>P</em> if <em>P</em> is inside the ellipse, or between <em>A</em> and <em>B</em> if <em>P</em> is outside. The polar is the line through <em>Q</em> parallel to the tangent at <em>R</em>, where <em>R</em> is the point where the ray <em>OP</em> meets the ellipse.</p>
<h2>Focus and directrix</h2>
<p>Plane and projective geometry are very mature and so some of the terminology sounds quaint. One such term is the <em>directrix</em> of a conic section, explained <a href="https://www.johndcook.com/blog/2022/10/20/directrix-of-a-conic/">here</a>. The polar of a focus is a directrix, and the pole of a directrix is a focus.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2026/10/24/computing-polar-triangles/">Polar triangles and linear algebra</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2022/04/25/projective-duality/">Projective duality</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2022/11/21/ellipses-and-elliptic-integrals/">Posts on ellipses</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/10/26/inversion-in-an-ellipse/">Inversion in an ellipse</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Where else to find me</title>
		<link>https://www.johndcook.com/blog/2026/10/26/where-to-find-me/</link>
					<comments>https://www.johndcook.com/blog/2026/10/26/where-to-find-me/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 26 Oct 2026 12:04:54 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248119</guid>

					<description><![CDATA[<p>This blog is the main place I write, but I also use other platforms, either to write new content or to announce blog posts. X (née Twitter) I have a several X accounts, one personal account (@JohnDCook) and several specialized accounts (@CompSciFact, @AlgebraFact, @DataSciFact, etc.). I announce new blog posts on the most relevant account. RSS [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/26/where-to-find-me/">Where else to find me</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>This blog is the main place I write, but I also use other platforms, either to write new content or to announce blog posts.</p>
<h2>X (née Twitter)</h2>
<p>I have a <a href="https://www.johndcook.com/blog/twitter_page/">several X accounts</a>, one personal account (@JohnDCook) and several specialized accounts (@CompSciFact, @AlgebraFact, @DataSciFact, etc.). I announce new blog posts on the most relevant account.</p>
<h2>RSS</h2>
<p>You can subscribe to the blog via <a href="https://www.johndcook.com/blog/rss-feed/">RSS</a> and find out about each post as it&#8217;s published.</p>
<p>RSS was very popular before Google killed its RSS reader, but it still works just fine. I use RSS to subscribe to the blogs I read.</p>
<p>The hard part of using RSS is finding a reader you like. I use Inoreader. I&#8217;m sure an LLM could help you find an RSS reader for your preferences and help you get started using it.</p>
<h2>Mathstodon &amp; Bluesky</h2>
<p>I announce my math-related posts on Mathstodon at <a href="https://mathstodon.xyz/@johndcook">mathstodon.xyz/@johndcook</a>. I also use a service that repeats my Mathstodon posts to Bluesky at <a href="https://bsky.app/profile/johndcook.mathstodon.xyz.ap.brid.gy">johndcook.mathstodon.xyz.ap.brid.gy</a>.</p>
<p>I don&#8217;t know why, but more people have started following me on Mathstodon over the last couple weeks.</p>
<h2>Substack</h2>
<p>Some people like to get email notifications of posts. I used two or three services that sent out such emails and they all stopped working. I tried out Substack and it has worked smoothly ever since.</p>
<p>My Substack <a href="https://www.johndcook.com/blog/newsletter/">newsletter</a> has evolved into a bit more than just blog post announcements. I give a little intro to each post and some additional info such as how a sequence of posts are related or ideas that occurred to me after writing the post.</p>
<h2>LinkedIn</h2>
<p>Once in a while I post something to <a href="https://www.linkedin.com/in/johndcook/">LinkedIn</a>. If you&#8217;d like to know more about my background, you can see my profile there.</p>The post <a href="https://www.johndcook.com/blog/2026/10/26/where-to-find-me/">Where else to find me</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/26/where-to-find-me/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Poles and polars</title>
		<link>https://www.johndcook.com/blog/2026/10/25/poles-and-polars/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 25 Oct 2026 19:45:05 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248115</guid>

					<description><![CDATA[<p>The previous two posts have been about polar triangles. The first used a polar triangle to derive a theorem, and the second showed how to compute polars using linear algebra. But what exactly is a polar triangle and why is it called that? Poles and polars on a sphere Let&#8217;s start with a sphere S and a [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">Poles and polars</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The previous two posts have been about polar triangles. The first <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">used</a> a polar triangle to derive a theorem, and the second showed how to <a href="https://www.johndcook.com/blog/2026/10/24/computing-polar-triangles/">compute</a> polars using linear algebra. But what exactly <em>is</em> a polar triangle and why is it called that?</p>
<h2>Poles and polars on a sphere</h2>
<p>Let&#8217;s start with a sphere <em>S</em> and a great circle <em>G</em>. Then <em>G</em> is the intersection of <em>S</em> with a plane through the center of <em>S</em>. The circle <em>G</em> has two <strong>poles</strong>, two points on opposite sides of <em>S</em> that are as far as possible (i.e. π/2 radians) from <em>G</em>. If you rotate the sphere so that <em>G</em> is the equator, the poles are the north and south pole.</p>
<p>Conversely, if you start with a point <em>P</em> on the sphere <em>S</em>, the <strong>polar</strong> of <em>P</em> is the great circle for which <em>P</em> is a pole. So if you think of <em>P</em> as the north pole, the polar of <em>P</em> is the equator. The term <em>equator</em> would have been more intuitive than <em>polar</em>, but the terminology was established a couple centuries ago.</p>
<p>In my opinion it would be clearer to call poles and polars both <strong>duals</strong>. The dual of a great circle is a point, and the dual of a point is a great circle.</p>
<p>Now let&#8217;s look at a spherical triangle <em>ABC</em> sides <em>a</em>, <em>b</em>, and <em>c</em>. The vertices of the <strong>polar triangle</strong> of <em>ABC</em> are the poles of the sides <em>a</em>, <em>b</em>, and <em>c</em>. This definition is essentially correct, but it needs a little refinement.</p>
<p>The pole <em>A</em>′ of the side <em>a</em> is one of the two poles of the great circle containing <em>a</em>, the one that that lies in the same hemisphere as <em>A</em>. Define <em>B</em>′ and <em>C</em>′ similarly, and the polar triangle is the spherical triangle with vertices <em>A</em>′<em>B</em>′<em>C</em>′.</p>
<h2>Poles and polars in the plane</h2>
<p>The terms <em>pole</em> and <em>polar</em> were coined for spherical geometry, then generalized to plane (projective) geometry. If you think of great circles as the lines of spherical geometry, then you can carry the idea of poles and polars over to plane geometry where the pole (dual) of a line is a point, and the polar (dual) of a point is a line.</p>
<p>However, in the plane you can&#8217;t define the pole of a line without more context. You have to start with a circle (or more generally a conic section) and define the pole of a line <em>with respect to the circle</em> and the define the polar of a point <em>with respect to the same circle</em>.</p>
<p>Given a circle <em>S</em> with center <em>O</em>, to find the polar of a point <em>P</em> ≠ <em>O</em>, let <em>Q</em> be the <a href="https://www.johndcook.com/blog/2022/04/19/inversion-in-a-circle/">inversion</a> of <em>P</em> in <em>S</em>, and let ℓ be the line through <em>Q</em> perpendicular to the line <em>OP</em>.</p>
<p>Conversely, the pole of a line ℓ with respect to a circle <em>S</em> is the inversion of <em>Q</em> in <em>S</em> where <em>Q</em> is the intersection of ℓ with <em>OQ</em>. Here we assume the line ℓ does not pass through the center of the circle <em>O</em> because otherwise <em>O</em> = <em>Q</em> and it doesn&#8217;t make sense to speak of the line <em>OQ</em>.</p>
<h2>Projective geometry</h2>
<p>The definitions above have a couple holes that can be filled in by extending the Euclidean plane to the projective plane.</p>
<p>We defined the pole of a line ℓ except when ℓ passes through the center of the circle. If ℓ passes through <em>O</em> then the pole of ℓ is the point at infinity in the direction of ℓ. Similarly, we defined the polar of all points except <em>O</em>. In projective geometry, we can define the polar of <em>O</em> to the be the line at infinity, the line containing all the points at infinity.</p>The post <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">Poles and polars</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Computing polar triangles with linear algebra</title>
		<link>https://www.johndcook.com/blog/2026/10/24/computing-polar-triangles/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 25 Oct 2026 01:01:55 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geometry]]></category>
		<category><![CDATA[Linear algebra]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248109</guid>

					<description><![CDATA[<p>The previous post defined the polar triangle of a spherical triangle in terms of its sides and angles, but it doesn&#8217;t construct the triangle. It only specifies one of a family of triangles located anywhere on the sphere. How do we know that polar triangles exist? There is a geometric construction that starts with a [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/24/computing-polar-triangles/">Computing polar triangles with linear algebra</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">previous post</a> defined the polar triangle of a spherical triangle in terms of its sides and angles, but it doesn&#8217;t construct the triangle. It only specifies one of a family of triangles located anywhere on the sphere.</p>
<p>How do we know that polar triangles exist? There is a <a href="https://www.johndcook.com/blog/2026/10/25/poles-and-polars/">geometric construction</a> that starts with a spherical triangle and constructs a unique new spherical triangle, and one can show that this new triangle has the angles and sides described in the previous post.</p>
<p>There is also a linear algebraic construction of polar triangles, and that&#8217;s the topic of this post. In a nutshell, take your sphere to be the unit sphere in 3D. Write the coordinates of each vertex as the columns of a matrix. Invert that matrix and normalize each row. Then the rows are the coordinates of the polar vertices.</p>
<p>This process is an involution: the polar of the polar of a triangle is the original triangle.</p>
<p>The following Python code illustrates the process described above. It begins with a triangle on the globe with vertices <em>A</em>, <em>B</em>, and <em>C</em> at Chicago, Quito, and Paris respectively. It computes the polar triangle, then computes the polar of that, and shows that the result is the original triangle.</p>
<pre>import numpy as np

def latlon_to_cartesian(lat_deg, lon_deg):
    lat = np.radians(lat_deg)
    lon = np.radians(lon_deg)
    x = np.cos(lat) * np.cos(lon)
    y = np.cos(lat) * np.sin(lon)
    z = np.sin(lat)
    return np.array([x, y, z])

def cartesian_to_latlon(v):
    v = v / np.linalg.norm(v)
    lat = np.degrees(np.arcsin(np.clip(v[2], -1, 1)))
    lon = np.degrees(np.arctan2(v[1], v[0]))
    return lat, lon

def polar_triangle(M):
    """
    Polar triangle via matrix inversion.
    M: 3×3 matrix with columns = unit vectors of the original vertices.
    Returns 3×3 matrix whose columns are the polar unit vectors.
    """
    Minv = np.linalg.inv(M)
    # Normalize each row of the inverse (rows are parallel to the polar directions)
    polar_rows = Minv / np.linalg.norm(Minv, axis=1, keepdims=True)
    return polar_rows.T          # columns = polar vertices

# Original vertices (Chicago, Quito, Paris)
A = latlon_to_cartesian(41.85003, -87.65005)
B = latlon_to_cartesian(-0.22985, -78.52495)
C = latlon_to_cartesian(48.85341,  2.3488)

M = np.column_stack([A, B, C])
print("M (columns = original vertices):\n", M)
print("det(M) =", np.linalg.det(M))

# Polar triangle
M_prime = polar_triangle(M)
print("\nM' (columns = polar vertices):\n", M_prime)

print("\nPolar geographic coordinates (lat, lon):")
for name, col in zip(["A'", "B'", "C'"], range(3)):
    print(name, cartesian_to_latlon(M_prime[:, col]))

# Polar of the polar
M_double = polar_triangle(M_prime)
print("\nPolar-of-polar matrix:\n", M_double)
print("max |difference from original M| =",
      np.max(np.abs(M_double - M)))
</pre>The post <a href="https://www.johndcook.com/blog/2026/10/24/computing-polar-triangles/">Computing polar triangles with linear algebra</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Duality in spherical trigonometry</title>
		<link>https://www.johndcook.com/blog/2026/10/24/polar-triangle/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 25 Oct 2026 00:28:20 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Differential geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248107</guid>

					<description><![CDATA[<p>I&#8217;ve written before about the law of cosines on a sphere: cos(c) = cos(a) cos(b) + sin(a) sin(b) cos(C). But that&#8217;s just one of two laws of cosines on a sphere. The equation above is the law of cosines for sides. The law of cosines for angles is typographically very similar, just inverting the case of [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">Duality in spherical trigonometry</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve written before about the <a href="https://www.johndcook.com/blog/2022/08/24/law-of-cosines-on-a-sphere/">law of cosines on a sphere</a>:</p>
<p style="padding-left: 40px;">cos(<em>c</em>) = cos(<em>a</em>) cos(<em>b</em>) + sin(<em>a</em>) sin(<em>b</em>) cos(<em>C</em>).</p>
<p>But that&#8217;s just one of two laws of cosines on a sphere. The equation above is the law of cosines <strong>for sides</strong>. The law of cosines <strong>for angles</strong> is typographically very similar, just inverting the case of the letters used as arguments.</p>
<p style="padding-left: 40px;">cos(<em>C</em>) = cos(<em>A</em>) cos(<em>B</em>) + sin(<em>A</em>) sin(<em>B</em>) cos(<em>c</em>).</p>
<p>Incidentally, the law of cosines for sides shows how the sides of a spherical triangle determine the angles. The law of cosines for angles shows how, unlike in the case of plane geometry, angles determine the sides.</p>
<h2>Two kinds of angles</h2>
<p>Let&#8217;s back up and say what the letters refer to. As is conventional in plane geometry, the sides of a triangle are <em>a</em>, <em>b</em>, and <em>c</em>, and the angles are <em>A</em>, <em>B</em>, and <em>C</em>, with <em>a</em> being the side opposite the angle <em>A</em>, and similarly for the other letters.</p>
<p>However, unlike plane geometry, the sides are also angles, but of a different sort. The sides <em>a</em>, <em>b</em>, and <em>c</em> are <strong>central angles</strong>, and the &#8220;angles&#8221; <em>A</em>, <em>B</em>, and <em>C</em> are <strong>dihedral angles</strong>.</p>
<p>The sides are arcs of a great circle. The side <em>a</em>, for example, is a portion of a great circle, running between the vertices at <em>B</em> and <em>C</em> [1]. Think of a plane that contains the center of the sphere <em>O</em> and the vertices <em>B</em> and <em>C</em>. The length of <em>a</em> is the angle at <em>O</em>.</p>
<p>The angles <em>A</em>, <em>B</em>, and <em>C</em> are the angles at which great circles meet. In the formalism of differential geometry, these angles exist in the tangent plane at the vertices. These angles are <strong>intrinsic</strong>, measured along the (tangent plane of) the surface of the sphere. The central angles are <strong>extrinsic</strong>, measured in a plane that cuts through the sphere to its center.</p>
<h2>Polar triangles</h2>
<p>Now because sides are angles and vertices are angles, we can interchange the two kinds of angles to form the <strong>polar triangle</strong> of the original triangle. This is a new triangle whose central angles are the complements of the original dihedral angles, and whose dihedral angles are the complements of the original central angles. In symbols,</p>
<p style="padding-left: 40px;"><em>a</em>′ = π − <em>A</em><br />
<em>b</em>′ = π − <em>B</em><br />
<em>c</em>′ = π − <em>C</em><br />
<em>A</em>′ = π − <em>a</em><br />
<em>B</em>′ = π − <em>b</em><br />
<em>C</em>′ = π − <em>c</em></p>
<p>Now we return to the laws of cosines at the top of the post: the law of cosines for angles is the law of cosines for sides applied to the polar triangle. Every equation in spherical trigonometry has a polar counterpart.</p>
<p>&nbsp;</p>
<p>[1] There&#8217;s some overloaded terminology here, just as in plane geometry. The symbol <em>a</em> is used to denote a side of a triangle and also the length of that side. The symbol <em>A</em> is used to denote both a vertex and the dihedral angle at that vertex.</p>The post <a href="https://www.johndcook.com/blog/2026/10/24/polar-triangle/">Duality in spherical trigonometry</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Working around a strange Python problem</title>
		<link>https://www.johndcook.com/blog/2026/10/22/pep-723/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Thu, 22 Oct 2026 15:12:10 +0000</pubDate>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248104</guid>

					<description><![CDATA[<p>A Python script that worked a few days ago wouldn&#8217;t work today. I suspect it might have something to do with my updating everything I could think of in response to recent security breaches. I got an error message that said error: The script contains multiple PEP 723 metadata blocks I searched on what that [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/22/pep-723/">Working around a strange Python problem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>A Python script that worked a few days ago wouldn&#8217;t work today. I suspect it might have something to do with my updating everything I could think of in response to recent security breaches.</p>
<p>I got an error message that said</p>
<pre>error: The script contains multiple PEP 723 metadata blocks</pre>
<p>I searched on what that means, then took out the blank line in my header</p>
<pre>#!/usr/bin/env -S uv run --script

# /// script
# dependencies = ["pyperclip"]
# ///
</pre>
<p>but I still got the same error message.</p>
<p>The script in question copies miscellaneous snippets of text to the clipboard for me. One of those snippets is the header block that uv requires. The script contains the header block marker <code># ///</code>, and that was the source of the problem.</p>
<p>According to Grok</p>
<blockquote><p>The PEP 723 parser is purely textual (it uses a regex that scans the whole file). It does not understand Python syntax, so the <code># ///</code> sequences inside your triple-quoted string are treated as a second metadata block.</p></blockquote>
<p>It suggested changing my quoted string to use <code># / / /</code> and then take out the extra spaces:</p>
<pre>"""#!/usr/bin/env -S uv run --script
# / / / script
# dependencies = ["numpy", "matplotlib"]
# / / /
import numpy as np
import matplotlib.pyplot as plt
""".replace("# / / /", "# ///")
</pre>
<p>This is a dirty hack, but it works.</p>The post <a href="https://www.johndcook.com/blog/2026/10/22/pep-723/">Working around a strange Python problem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How the eMudrha certificate debacle might have happened</title>
		<link>https://www.johndcook.com/blog/2026/10/22/certificate-debacle/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Thu, 22 Oct 2026 14:01:55 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Cryptography]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248100</guid>

					<description><![CDATA[<p>You may have seen references to a password being the number 4. There are countless allusions to this online, but they don&#8217;t give the context. As I mentioned in an earlier post, eMudrha was using the numbers 4, 56, 115, 155, 156, 230, and 237 as secret keys. I haven&#8217;t seen details of how this [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/22/certificate-debacle/">How the eMudrha certificate debacle might have happened</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>You may have seen references to a password being the number 4. There are countless allusions to this online, but they don&#8217;t give the context.</p>
<p>As I mentioned in an <a href="https://www.johndcook.com/blog/2026/10/21/emudhra/">earlier post</a>, eMudrha was using the numbers 4, 56, 115, 155, 156, 230, and 237 as secret keys. I haven&#8217;t seen details of how this happened, but in this post I&#8217;ll give a plausible account of how it <strong>might</strong> have happened, what someone could have done to produce those results. I&#8217;m not trying to do forensic analysis on this specific incident, just exploring what someone might do.</p>
<p>eMudrha was using the NIST elliptic curve P-384, and a secret key should be a random number chosen between 1 and 2<sup>384</sup>. That upper bound isn&#8217;t exactly correct, but it&#8217;s close. See <a href="https://www.johndcook.com/blog/2026/10/22/the-number-of-points-on-an-elliptic-curve/">this post</a> if you want to know the exact number.</p>
<p>Someone might have chosen numbers up to 384 rather than 2<sup>384</sup> out of ignorance. Or they might done so by a typo. Maybe they generated a random value that might have been larger than 2<sup>384</sup> and then intended to reduce the number mod 2<sup>384</sup>, but instead of typing </p>
<pre>% 2**384</pre>
<p>they typed </p>
<pre>% 384</pre>
<p>It seems more likely, however, that somehow someone took one byte of a random value because all the keys are less than 2<sup>8</sup> = 256.</p>
<p>The probability of choosing seven numbers from 1 to 384 and all being less than or equal to 237 is around 0.034. But the same probability for numbers chosen between 1 and 256 is about 0.60.</p>The post <a href="https://www.johndcook.com/blog/2026/10/22/certificate-debacle/">How the eMudrha certificate debacle might have happened</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The number of points on an elliptic curve</title>
		<link>https://www.johndcook.com/blog/2026/10/22/the-number-of-points-on-an-elliptic-curve/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Thu, 22 Oct 2026 11:08:51 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Elliptic curves]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248094</guid>

					<description><![CDATA[<p>An elliptic curve E over a finite field F consists of the set of points (x, y) satisfying the equation y² = x³ + ax + b with x and y in F. Typically in cryptography the field F is the integers mod p where p is a very large prime number. The number of points on E is roughly the number [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/22/the-number-of-points-on-an-elliptic-curve/">The number of points on an elliptic curve</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>An elliptic curve <em>E</em> over a finite field <em>F</em> consists of the set of points (<em>x</em>, <em>y</em>) satisfying the equation</p>
<p style="padding-left: 40px;"><em>y</em>² = <em>x</em>³ + <em>ax</em> + <em>b</em></p>
<p>with <em>x</em> and <em>y</em> in <em>F</em>. Typically in cryptography the field <em>F</em> is the integers mod <em>p</em> where <em>p</em> is a very large prime number.</p>
<p>The number of points on <em>E</em> is roughly the number of elements in <em>F</em>. So for a curve over the integers mod <em>p</em>, the curve has roughly <em>p</em> points.</p>
<p>The next section will give an intuitive argument for why the number of points on <em>E</em> should be roughly the number of elements in <em>F</em>. Then the next section will give a rigorous bound. Then after that we&#8217;ll work through an example.</p>
<h2>Hand-wavy estimate</h2>
<p>For a prime <em>p</em>, half the non-zero integers mod <em>p</em> have a square root and half do not. The ones that do have a square root have two square roots. For example, look at the integers mod 7. The numbers 1, 2, and 4 have square roots but the numbers 3, 5, and 6 do not. Here&#8217;s a little bit of Python to verify this.</p>
<pre>&gt;&gt;&gt; [x**2 % 7 for x in range(1,7)]
[1, 4, 2, 2, 4, 1]
</pre>
<p>Now if we wanted to count the number of solutions to</p>
<p style="padding-left: 40px;"><em>y</em>² = <em>x</em> (mod <em>p</em>)</p>
<p>we&#8217;d find it equals <em>p</em>. That&#8217;s because (0, 0) is a point on the curve, and for (<em>p</em> − 1)/2 values of <em>x</em> there are two values of <em>y</em>, and for the remaining values of <em>x</em> there are no values of <em>y</em>.</p>
<p>To put it another way, if we pick a value of <em>x</em> at random, it will have two square roots or no square roots with roughly equal probability.</p>
<p>Now suppose we pick an <em>x</em> at random and compute <em>x</em>³ + <em>ax</em> + <em>b</em>. We might guess that this process scatters <em>x</em> values in an unbiased way, being no more likely to produce a square than a non-square. Our guess turns out to be approximately correct, though there may be a small bias in favor of squares or non-squares.</p>
<h2>Precise bound</h2>
<p>Hasse&#8217;s theorem gives a precise bound on the number of points on an elliptic curve <em>E</em>. It says</p>
<p style="padding-left: 40px;">#<em>E</em> = <em>p</em> + 1 − <em>t</em></p>
<p>where</p>
<p style="padding-left: 40px;">|<em>t</em>| ≤ 2√<em>p</em>.</p>
<p>So if <em>p</em> is on the order of 2<sup><em>n</em></sup>, the number of points on <em>E</em> is also on the order of 2<sup><em>n</em></sup> because √<em>p</em> is far smaller than <em>p</em>. That&#8217;s all you need to know at a high level. The rest of this post will look at a particular example in full detail.</p>
<h2>Detailed example</h2>
<p>The NIST curve <a href="https://www.johndcook.com/blog/2019/05/11/elliptic-curve-p-384/">P-384</a> has been <a href="https://www.johndcook.com/blog/2026/10/21/emudhra/">in the news</a> lately. For this curve, the based field is integers modulo a 384-bit prime <em>p</em> and so the number of points on the curve is also 384-bit number. Specifically</p>
<p style="padding-left: 40px;"><em>p</em> = 2<sup>384</sup> − 2<sup>128</sup> − 2<sup>96</sup> + 2<sup>32</sup> − 1,</p>
<p>and so we know <em>a priori</em> that the number of points on the curve equals 2<sup>384</sup> plus or minus a factor less than 2<sup>193</sup>.</p>
<p>The number of points on the elliptic curve P-384 is known to be</p>
<p style="padding-left: 40px;"> <em>n</em> = 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643</p>
<p>See NIST SP 800-186, §3.2.1.4⁠.</p>
<p>We can calculate <em>t</em> at a Python REPL.</p>
<pre>&gt;&gt;&gt; n = 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643
&gt;&gt;&gt;  p = 2**384 - 2**128 - 2**96 + 2**32 - 1
&gt;&gt;&gt; t = p + 1 - n
&gt;&gt;&gt; t
1388124618062372383606759648309780106643088307173319169677</pre>
<p>The fact that <em>t</em> is positive means the number of points <em>n</em> on our curve is slightly less than <em>p</em>. Here &#8220;slightly&#8221; is relative. The value of <em>p</em> − <em>n</em> is a huge number, but it&#8217;s small relative to <em>p</em>.</p>
<p>We can verify that |<em>t</em>| is less than our <em>a priori</em> bound of 2√<em>p</em>.</p>
<pre>&gt;&gt;&gt; from math import sqrt
&gt;&gt;&gt; t/(2*sqrt(p))
0.11057050503394951
</pre>
<p>So the actual value of <em>t</em> is about nine times smaller than its bound.</p>The post <a href="https://www.johndcook.com/blog/2026/10/22/the-number-of-points-on-an-elliptic-curve/">The number of points on an elliptic curve</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Backdoors, Incompetence, and Elliptic Curves</title>
		<link>https://www.johndcook.com/blog/2026/10/21/emudhra/</link>
					<comments>https://www.johndcook.com/blog/2026/10/21/emudhra/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 15:16:51 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Elliptic curves]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248087</guid>

					<description><![CDATA[<p>The NIST elliptic curves have been in the news twice lately. A few days ago Anthropic posted a paper on the NIST curve seeds that I wrote about here. Now the curves are in the news again, this time over broken certificates. My post a few days ago was about the possibility that the NSA [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/21/emudhra/">Backdoors, Incompetence, and Elliptic Curves</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The NIST elliptic curves have been in the news twice lately. A few days ago Anthropic posted a paper on the NIST curve seeds that I wrote about <a href="https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/">here</a>. Now the curves are in the news again, this time over broken certificates.</p>
<p>My post a few days ago was about the possibility that the NSA had added a backdoor to the NIST curves. Anthropic researchers showed that this wasn&#8217;t the case. The NSA had not been able to defend how the curve seeds were chosen because they forgot, but researchers from Anthropic were able to reverse engineer the source of the seeds.</p>
<p>So apparently the NIST curves do not have a backdoor, but as with all encryption, the Achilles heel is human error. eMudrha was using the NIST curve <a href="https://www.johndcook.com/blog/2019/05/11/elliptic-curve-p-384/">P-384</a>  with extremely small keys: 4, 56, 115, 155, 156, 230, and 237. To understand why this is a problem, I&#8217;ll briefly describe how elliptic curve cryptography works.</p>
<p>P-384 is an elliptic curve designed by NIST, with input from the NSA, for use in cryptography. The curve has on the order of 2<sup>384</sup> points because the base field is the integers mod</p>
<p style="padding-left: 40px;"><em>p</em> = 2<sup>384</sup> − 2<sup>128</sup> − 2<sup>96</sup> + 2<sup>32</sup> − 1,</p>
<p>a 384-bit prime number. Given a basepoint <em>b</em> on the curve and an exponent <em>e</em>, it is practically impossible to recover <em>e</em> from <em>b</em><sup><em>e</em></sup>. That&#8217;s the discrete logarithm problem [1], the basis for the security of elliptic curve cryptography. If and when cryptographically relevant quantum computers arrive, the discrete logarithm problem will be solvable and elliptic curve cryptography will be broken.</p>
<p>Until the advent of quantum computing, elliptic curve cryptography is presumably safe, unless someone does something negligent, such as using a tiny value of <em>e</em> like 4.</p>
<p>If <em>e</em> is chosen at random from a group with on the order of 2<sup>384</sup> elements, you cannot recover <em>e</em> from <em>b</em><sup><em>e</em></sup> without brute force. But apparently someone said</p>
<p style="padding-left: 40px;">Let&#8217;s see. Is <em>e</em> = 1? Is it 2? Is it 3? Is it 4? Why yes: <em>e</em> = 4.</p>
<p>Ordinarily this would be hopeless. You can&#8217;t just try 2<sup>384</sup> exponents. But someone thought to test whether the keys were horrifically bad, and they were right.</p>
<p>&nbsp;</p>
<p>[1] The exponentiation here is not over the integers, or over the integers mod <em>p</em>. It&#8217;s over the group structure of the elliptic curve, and that is what makes it hard to compute the discrete logarithm.</p>The post <a href="https://www.johndcook.com/blog/2026/10/21/emudhra/">Backdoors, Incompetence, and Elliptic Curves</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/21/emudhra/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Deliberate imperfection</title>
		<link>https://www.johndcook.com/blog/2026/10/21/deliberate-imperfection/</link>
					<comments>https://www.johndcook.com/blog/2026/10/21/deliberate-imperfection/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 21 Oct 2026 12:04:06 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248082</guid>

					<description><![CDATA[<p>I was watching a video by John Higgins this morning about the poem in Ecclesiastes 3, one of the most famous passages in the Bible. There is a time for everything, and a season for every activity under the heavens: a time to be born and a time to die, a time to plant and [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/21/deliberate-imperfection/">Deliberate imperfection</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>I was watching a <a href="https://www.youtube.com/watch?v=Nlj5P-uJu-k">video</a> by John Higgins this morning about the poem in Ecclesiastes 3, one of the most famous passages in the Bible.</p>
<blockquote><p>There is a time for everything,<br />
and a season for every activity under the heavens:</p>
<p>a time to be born and a time to die,<br />
a time to plant and a time to uproot,<br />
a time to kill and a time to heal,<br />
a time to tear down and a time to build,<br />
a time to weep and a time to laugh,<br />
a time to mourn and a time to dance,<br />
a time to scatter stones and a time to gather them,<br />
a time to embrace and a time to refrain from embracing,<br />
a time to search and a time to give up,<br />
a time to keep and a time to throw away,<br />
a time to tear and a time to mend,<br />
a time to be silent and a time to speak,<br />
a time to love and a time to hate,<br />
a time for war and a time for peace.</p></blockquote>
<p>The poem has a great deal of symmetry, from birth and death to war and peace. It has seven couplets, and the number seven in the Bible is symbolic of perfection. </p>
<p>There is a repeated pattern of groups of four words: a time for X, a time for Y. The rhythm reminds me of Beethoven&#8217;s fifth symphony, especially the third movement [1]. </p>
<p>Higgins points out that there&#8217;s something odd in the middle couplet:</p>
<blockquote><p>a time to scatter stones and a time to gather them,<br />
a time to embrace and a time to refrain from embracing,</p></blockquote>
<p>It breaks the rhythm, at least in English translation, and presumably in the original language. The poem goes from intransitive adjectival infinitives &mdash;to plant, to uproot, etc.&mdash;to transitive&mdash;to gather <em>stones</em>. Also, the two parts of the couplet do not obviously fit together. There&#8217;s a similarity between birth and planting, between killing and tearing down, etc. But what&#8217;s the connection between casting stones and embracing?</p>
<p>Higgins explains that this deliberate symmetry breaking fits the theme of the Ecclesiastes as a whole. There is order to the world, and yet we don&#8217;t have it all figured out. Even when everything mostly makes sense, there&#8217;s something we don&#8217;t understand, like the middle couplet.</p>
<p>[1] This has been called the fate motif. There is an apocryphal story that Beethoven described it as such to his secretary and biographer Anton Schindler. Regardless of whether the story is true, the name stuck. Here&#8217;s the particular part I had in mind.</p>
<p><img decoding="async" src="https://www.johndcook.com/fate_motif_horns.svg" width="506" height="61" alt="Sheet music for Beethoven: Symphony No. 5, Op. 67. Third Movement Horn Theme" class="aligncenter size-medium" /></p>The post <a href="https://www.johndcook.com/blog/2026/10/21/deliberate-imperfection/">Deliberate imperfection</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/21/deliberate-imperfection/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Refactoring factorials</title>
		<link>https://www.johndcook.com/blog/2026/10/19/refactoring-factorials/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 19 Oct 2026 14:55:22 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Number theory]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248079</guid>

					<description><![CDATA[<p>Splitting N! into N factors is trivial. It&#8217;s defined as the product of N integers, the integers 1 through N. Can you still split N! into N factors if you put a minimum size requirement on the factors? You can&#8217;t split 3! into three factors unless one of the factors is 1, but you can split 4! into factors ≥ 2: 4! [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/19/refactoring-factorials/">Refactoring factorials</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>Splitting <em>N</em>! into <em>N</em> factors is trivial. It&#8217;s <em>defined</em> as the product of <em>N</em> integers, the integers 1 through <em>N</em>.</p>
<p>Can you still split <em>N</em>! into <em>N</em> factors if you put a minimum size requirement on the factors?</p>
<p>You can&#8217;t split 3! into three factors unless one of the factors is 1, but you can split 4! into factors ≥ 2:</p>
<p style="padding-left: 40px;">4! = 24 = 2 × 2 × 2 × 3</p>
<p>Define <em>t</em>(<em>N</em>) as the largest number such that <em>N</em>! can be expressed as the product of integers greater than or equal to <em>t</em>(<em>N</em>). So based on the discussion above, <em>t</em>(<em>N</em>) ≥ 1 for all <em>N</em>, <em>t</em>(3) = 1 and <em>t</em>(4) = 2. The <em>t</em>(<em>N</em>) are given in OEIS sequence <a href="https://oeis.org/A034258">A034258</a>.</p>
<p>Last Thursday an <a href="https://pubs.ams.org/MCOM/0000-000-00/S0025-5718-2026-04249-8">article</a> came out proving an asymptotic estimate for <em>t</em>(<em>N</em>). You can find a <a href="https://arxiv.org/abs/2503.20170v4">preprint</a> on arXiv.</p>
<p>An upper bound on <em>t</em>(<em>N</em>) would be the <em>N</em>th root of <em>N</em>! because that would correspond to splitting <em>N</em>! into <em>N</em> factors of equal size. But the <em>N</em>th root of <em>N</em>! will not be an integer for <em>N</em> &gt; 1, so the bound would not be tight.</p>
<p>If we apply Stirling&#8217;s approximation for factorial we get</p>
<p style="padding-left: 40px;"><em>t</em>(<em>N</em>) / <em>N</em> ≤ 1/<em>e</em> + <em>O</em>(log(<em>N</em>) / <em>N</em>).</p>
<p>It was conjectured that for large <em>N</em></p>
<p style="padding-left: 40px;"><em>t</em>(<em>N</em>) / <em>N</em> ∼ 1/<em>e</em> − <em>c</em><sub>0</sub> / log(<em>N</em>)</p>
<p>and the new paper proves</p>
<p style="padding-left: 40px;"><em>t</em>(<em>N</em>) / <em>N</em> ∼ 1/<em>e</em> − <em>c</em><sub>0</sub> / log(<em>N</em>) + <em>O</em>(1 / log<sup>1 + <em>c</em></sup> <em>N</em>).</p>
<p>.</p>The post <a href="https://www.johndcook.com/blog/2026/10/19/refactoring-factorials/">Refactoring factorials</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A frivolous problem with a deeper lesson</title>
		<link>https://www.johndcook.com/blog/2026/10/19/regex-backtracking/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 19 Oct 2026 12:00:43 +0000</pubDate>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Regular expressions]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248073</guid>

					<description><![CDATA[<p>About 14% of English words can be spelled by stringing together chemical symbols. For example, sarcasm can be written S Ar Ca Sm using the symbols for sulfur, argon, calcium, and samarium. How would you write a program to determine whether a word can be written by stringing together chemical element abbreviations ignoring case? Obviously [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/19/regex-backtracking/">A frivolous problem with a deeper lesson</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>About 14% of English words can be spelled by stringing together chemical symbols. For example, <em>sarcasm</em> can be written</p>
<p style="padding-left: 40px;">S Ar Ca Sm</p>
<p>using the symbols for sulfur, argon, calcium, and samarium.</p>
<p>How would you write a program to determine whether a word can be written by stringing together chemical element abbreviations ignoring case? Obviously this isn&#8217;t a practical problem, but it illustrates a practical problem.</p>
<p>You could solve the problem with a regular expression:</p>
<pre>(h|he|li|be|b|c|n|o|f|ne|na|mg|al|si| … |og)+</pre>
<p>This solution could either be very efficient or very inefficient, depending on the inner workings of the software used to match the regular expression.</p>
<p>A DFA (deterministic finite automata) regular expression engine would find a match, or report failure, linear time, i.e. the execution time would be proportional to the length of the string being matched. An engine that uses backtracking (informally called an “NFA engine”) could take exponential time. (The classical Thompson simulation of an NFA itself runs in <em>O</em>(<em>mn</em>) time; the exponential behavior comes from the backtracking search strategy.)</p>
<p>The root of the problem is the ambiguity in dividing words into single letters or pairs of letters.</p>
<p>Many two-letter chemical symbols are made of letters that are themselves chemical symbols. For example, the symbol for cobalt, Co, consists of the symbols for carbon, C, and oxygen, O. A traditional NFA regular expression engine uses backtracking and could take exponentially long to test whether the word</p>
<pre>cococo…j</pre>
<p>matches a regular expression for concatenated chemical symbols. If there are <em>n</em> copies of <code>co</code>, the engine would try all 2<sup><em>n</em></sup> possibilities of treating each pair as either <code>co</code> (cobalt) or <code>c o</code> (carbon oxygen).</p>
<p>A DFA regular expression engine always runs in <em>O</em>(<em>n</em>) time, while a traditional backtracking engine can take exponential time. So why ever use a backtracking engine? Because such an engine can match more advanced patterns such as Perl regular expressions (which are not &#8220;regular&#8221; expressions in the original meaning of the term). Newer engines have added safeguards to eliminate or at least reduce the chance of running into catastrophic backtracking.</p>The post <a href="https://www.johndcook.com/blog/2026/10/19/regex-backtracking/">A frivolous problem with a deeper lesson</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cloud of suspicion lifted from NIST curves</title>
		<link>https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/</link>
					<comments>https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sat, 17 Oct 2026 15:39:06 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Cryptography]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248067</guid>

					<description><![CDATA[<p>NIST published a set of elliptic curves for cryptography in 2000. The seeds for the curves were supplied by the NSA, and cryptographers suspected the agency may have installed backdoors in the curves. And not without reason: the NSA did insert a backdoor in the Dual_EC_DRBG random number generator. Two days ago researchers at Anthropic [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/">Cloud of suspicion lifted from NIST curves</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>NIST published a set of elliptic curves for cryptography in 2000. The seeds for the curves were supplied by the NSA, and cryptographers suspected the agency may have installed backdoors in the curves. And not without reason: the NSA did insert a backdoor in the Dual_EC_DRBG random number generator.</p>
<p>Two days ago researchers at <a href="https://www.anthropic.com/research/ecdsa-curve-origins">Anthropic</a> [1] showed that the NIST curves were not seeded with a backdoor. The rest of this post will give the background necessary to appreciate this result.</p>
<hr />
<p>The security of elliptic curve cryptography depends on the difficult of solving the discrete logarithm problem. In the context of elliptic curve arithmetic, the analog of exponentiation is easy but the analog of taking logarithms is hard.</p>
<p><strong>In general</strong> it&#8217;s not practical to compute discrete logarithms over large elliptic curves. But it could be easy for someone with inside information to compute discrete logarithms if something about the curve was not &#8220;general.&#8221;</p>
<p>Specifically, the NIST curves have the form</p>
<p style="padding-left: 40px;"><em>y</em>² = <em>x</em>³ − 3<em>x</em> + <em>b</em> (mod <em>p</em>)</p>
<p>for various values of <em>p</em> [2], and the suspicion regards the choice of <em>b</em>. For nearly all values of <em>b</em> encryption over the elliptic curve should be secure, as far as we know, but in principle someone could engineer values of <em>b</em> to weaken the encryption.</p>
<p>So where did the <em>b</em>&#8216;s come from? Were they chosen in <a href="https://www.johndcook.com/blog/2019/08/14/good-faith/">good faith</a>?</p>
<p>Concern over the choice of seeds, the <em>b</em>&#8216;s, grew following the Snowden revelations. Daniel J. Bernstein emailed Jerry Solinas of the NSA on September 6, 2014 asking where the seeds had come from. Solinas replied in subsequent emails. He said the seeds were generated by hashing the ASCII representation of a humorous English message, but he could no longer remember the exact message or the precise hashing procedure.</p>
<p>On October 5, 2023 Philippo Valsorda announced a <a href="https://words.filippo.io/seeds-bounty/">bounty</a> for reverse engineering the origin of the NIST elliptic curve seeds. Two days ago researchers from Anthropic claimed the bounty. Valsorda verified the results and awarded the prize. It turns out Solinas found the curve seeds in good faith, but his memory had faded over the years since the curves were published. We now know he used a date, not a phrase, as part of the process of constructing the seeds.</p>
<p>The NIST curves have some nice properties, such as enabling some <a href="https://www.johndcook.com/blog/2019/05/12/nist-primes/">clever tricks</a> for arithmetic in their base fields. But adoption of the curves has been held back over suspicion regarding their origin. Now the curves have been exonerated. As Valdorda notes</p>
<blockquote><p>… this nicely completes the “rehabilitation arc” of NIST elliptic curve cryptography, which I would now personally recommend over Curve25519/Ed25519/X25519. Just in time for them to be retired in favor of post-quantum signatures.</p></blockquote>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2019/02/21/what-is-an-elliptic-curve/">What is an elliptic curve?</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2025/07/27/moneros-elliptic-curve/">Monero&#8217;s elliptic curve</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2025/08/01/jubjub/">Lewis Carroll and zero knowledge proofs</a></li>
</ul>
<p>[1] This does not imply that LLMs are necessarily a threat to encryption. The search for the NIST seeds required a lot of brute force. Some cleverness was required in order to come up with possibilities to check by brute force, but even that is sorta brute force at a higher level of abstraction. There has been speculation that labs are looking for weaknesses in cryptographic primitives and protocols, but that&#8217;s a different matter than searching for seeds.</p>
<p>[2] The curves P-192, P-224, P-256, P-384, and P-521 are built over the field of integers mod <em>p</em>, where the number of bits in <em>p</em> corresponds to the number in the name. The P-192 curve, for example, has as its base field the integers mod 2<sup>192</sup> − 2<sup>64</sup> − 1, a 192-bit prime.</p>The post <a href="https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/">Cloud of suspicion lifted from NIST curves</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/17/nist-curves-exonorated/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Monoliths and Lagrange Points</title>
		<link>https://www.johndcook.com/blog/2026/10/16/monoliths-and-lagrange-points/</link>
					<comments>https://www.johndcook.com/blog/2026/10/16/monoliths-and-lagrange-points/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Fri, 16 Oct 2026 14:37:07 +0000</pubDate>
				<category><![CDATA[Science]]></category>
		<category><![CDATA[Orbital mechanics]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248050</guid>

					<description><![CDATA[<p>This post began as a thread on X last night. I&#8217;ve edited the thread to turn it into a blog post, making some additions and corrections. I&#8217;m watching 2010: The Year We Make Contact. The movie opens saying the monolith is located at the Lagrange point between Jupiter and Io. I got nerd sniped and [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/16/monoliths-and-lagrange-points/">Monoliths and Lagrange Points</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>This post began as a <a href="https://x.com/JohnDCook/status/2110920086449975499?s=20">thread</a> on X last night. I&#8217;ve edited the thread to turn it into a blog post, making some additions and corrections.</p>
<hr />
<p>I&#8217;m watching <em>2010: The Year We Make Contact</em>. The movie opens saying the monolith is located at the Lagrange point between Jupiter and Io. I got nerd sniped and wondered where that was.</p>
<p><img decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/2010.jpeg" alt="MISSION ANALYSIS: COMPOSITION OF SECOND MONOLITY ... UNKNOWN. POSITION OF SECOND MONOLITH ... LA GRANGE POINT BETWEEN JUPITER AND IO. POSSITION OF U.S.S. DISCOVERY ... ORBIT AROUND IO. CONDITION OF U.S.S. DISCOVERY ... UNKNOWN." width="500" height="252" /></p>
<p>There are five Lagrange points, but presumably the movie refers to L1 or L2 because these are near Io. Lagrange points L3, L4, and L5 are essentially in the orbit of Io, but 60, 180, and 300 degrees out of phase, all far from Io. (The book says the monolith is at L1.)</p>
<p>Lagrange points L1 and L2 are unstable. Maybe this is a plot hole in the movie, unless there&#8217;s an explanation coming.</p>
<p>(In general L1, L2, and L3 are unstable. If the ratio of the masses is large enough, L4 and L5 will be stable. More on that <a href="https://www.johndcook.com/blog/2021/12/30/stable-lagrange-points/">here</a>. The Lagrange points L4 and L5 are indeed stable for the Jupiter-Io system. For the Sun-Earth system L1 is moderately stable over a short time span, but L1 is far less stable for the Jupiter-Io system.)</p>
<p>Here&#8217;s a plot of the Lagrange points.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/jupiter_io_lagrange.png" width="1000" height="800" /></p>
<p>Note that L1 and L2 are very close to Io, about 10,000 km from the moon. The L1 and L2 Lagrange points for the Earth-Sun system are not so close to Earth.</p>
<p>(That&#8217;s half true. Yes, Io&#8217;s L1 point is closer to it than Earth&#8217;s L1 point, in absolute distance. But in relative terms, Io&#8217;s L1 point is actually further away. I had been misled by seeing an illustration that exaggerated the distance from Earth to L1.)</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2021/12/28/lagrange-points-l1-and-l2/">Finding L1 and L2</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2021/12/30/stable-lagrange-points/">When do two-body systems have stable Lagrange points?</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/10/16/monoliths-and-lagrange-points/">Monoliths and Lagrange Points</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/16/monoliths-and-lagrange-points/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>LaTeX package for Pascal-like triangles</title>
		<link>https://www.johndcook.com/blog/2026/10/14/latex-package-for-pascal-like-triangles/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 14 Oct 2026 17:58:07 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[LaTeX]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248044</guid>

					<description><![CDATA[<p>When I wrote about the harmonic triangle yesterday, I displayed the triangle left-aligned using fixed-width text because that was easier than producing the format you usually see for Pascal&#8217;s triangle and related triangles. 1 1/2 1/2 1/3 1/6 1/3 1/4 1/12 1/12 1/4 1/5 1/20 1/30 1/20 1/5 … I asked Claude to write a [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/14/latex-package-for-pascal-like-triangles/">LaTeX package for Pascal-like triangles</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>When I wrote about the <a href="https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/">harmonic triangle</a> yesterday, I displayed the triangle left-aligned using fixed-width text because that was easier than producing the format you usually see for Pascal&#8217;s triangle and related triangles.</p>
<pre>    1
    1/2  1/2
    1/3  1/6   1/3
    1/4  1/12  1/12  1/4
    1/5  1/20  1/30  1/20  1/5
    …
</pre>
<p>I asked Claude to write a LaTeX package to make it easier to create Pascal-like triangles and it did a great job, including handy features I didn&#8217;t think to ask for. You can download it here: <a href="https://www.johndcook.com/numtriangle.sty">numtriangle.sty</a>.</p>
<p>I used this package to create the more attractive display below.</p>
<p><img decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/leibniz_harmonic_triangle3.svg" width="250" /></p>
<p>Here&#8217;s the LaTeX code that produced the image above.</p>
<pre>\documentclass[border=4pt]{standalone}
\usepackage{numtriangle}
\NewTriangle{\Leibniz}{start=1, edges=1/\n, rule=\L - \P, fractions,
  format=\displaystyle, xsep=2.8em, ysep=2.8em}
\begin{document}
\Leibniz[rows=5]
\end{document}
</pre>
<p>I then compiled the code to an SVG file with the following.</p>
<pre>pdflatex leibniz.pdf
pdftocairo -svg leibniz.pdf leibniz.svg
</pre>
<p><a href="https://www.johndcook.com/blog/2025/04/16/bell-numbers-2/">Bell&#8217;s triangle</a> is not defined in a way that the LaTeX package supports, but I can produce the triangle by listing the content. I made the triangle left-aligned rather than centered just to show that this can be done.</p>
<p><img decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/bell_triangle.svg" width="200" /></p>
<p>The LaTeX code was the following:</p>
<pre>\ListTriangle[shape=left]{
    1; 1, 2; 2, 3, 5; 5, 7, 10, 15; 15, 20, 27, 37, 52}</pre>
<p>Here&#8217;s a particularly photogenic image, Pascal&#8217;s triangle with odd numbers highlighted, showing the <a href="https://www.johndcook.com/blog/2020/06/28/the-ubiquitous-sierpinski/">Sierpiński triangle</a> pattern.</p>
<p><img decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/penski.svg" width="480" /></p>
<p>The code to produce the image:</p>
<pre>\PascalTriangle[rows=16, mod=2, xsep=1.9em, ysep=1.3em,
  cell style={font=\tiny, minimum size=1.2em},
  highlight style={fill=orange!40}]
</pre>The post <a href="https://www.johndcook.com/blog/2026/10/14/latex-package-for-pascal-like-triangles/">LaTeX package for Pascal-like triangles</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A generalization of the Pythagorean theorem</title>
		<link>https://www.johndcook.com/blog/2026/10/14/pythagorean-variation/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 14 Oct 2026 11:11:11 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geometry]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248041</guid>

					<description><![CDATA[<p>G. D. Chakerian [1] discovered the following generalization of the Pythagorean theorem. Take any triangle and attach squares to each side. From each triangle vertex, extend a line perpendicular to the opposite side and extend the line through the square, as shown in the figure below. Then the areas of the rectangles with the same [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/14/pythagorean-variation/">A generalization of the Pythagorean theorem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>G. D. Chakerian [1] discovered the following generalization of the Pythagorean theorem.</p>
<p>Take any triangle and attach squares to each side. From each triangle vertex, extend a line perpendicular to the opposite side and extend the line through the square, as shown in the figure below. Then the areas of the rectangles with the same labels are equal.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/chakerian1.png" width="400" height="400" /></p>
<p>It&#8217;s not clear at first why this is a generalization of the Pythagorean theorem, but if we make our triangle closer to a right triangle it&#8217;s easier to see the connection.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/chakerian2.png" width="400" height="400" /></p>
<p>As the angle at B becomes closer to a right angle, the area of the orange triangles labeled II goes to zero. In the limit we&#8217;re left a theorem saying that the areas of the blue and green squares add up to the area of the square attached to the hypotenuse.</p>
<p><strong>Update</strong>: Kirill Osenkov made an interactive version of the figure above <a href="http://livegeometry.com/s/6qtyzrqz">here</a>.</p>
<p>The paper [1] caught my eye because it gives a connection between a geometry problem and a circuit problem, much like <a href="https://www.johndcook.com/blog/2023/07/06/lehmans-inequality-circuits-and-latex/">this post</a>. However, I find the theorem itself more interesting than the connection to circuits.</p>
<p>The first diagram is my reproduction of the first figure from the paper, with color added. I then moved the vertex A to make the connection to the Pythagorean theorem easier to see.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2025/11/13/pythagorean-generalizations/">Four generalizations of the Pythagorean theorem</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2025/02/11/binary-triples/">Sparse binary Pythagorean triples</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2022/11/30/napoleons-theorem/">Napoleon’s theorem</a></li>
</ul>
<p>[1] G. D. Chakerian and M. S. Klamkin. A Generalization of the Pythagorean Theorem Seen as a Problem of Equivalent Resistances. Mathematics Magazine, Vol. 59, No. 3 (Jun., 1986), pp. 149–153.</p>
<p>The first line of the paper is &#8220;The following result (observed several years ago by the first author) may be viewed as a generalization of the Pythagorean Theorem.&#8221; The paper also gives two other sources of the theorem. Presumably Chakerian independently discovered a theorem that was already known.</p>The post <a href="https://www.johndcook.com/blog/2026/10/14/pythagorean-variation/">A generalization of the Pythagorean theorem</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Poe, Bessel, and Drones</title>
		<link>https://www.johndcook.com/blog/2026/10/14/poe-bessel-and-drones/</link>
					<comments>https://www.johndcook.com/blog/2026/10/14/poe-bessel-and-drones/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 14 Oct 2026 10:00:22 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Differential equations]]></category>
		<category><![CDATA[Special functions]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248036</guid>

					<description><![CDATA[<p>What&#8217;s a connection between Edgar Allan Poe and Friedrich Wilhelm Bessel? Poe&#8217;s story The Pit and the Pendulum describes a pendulum with a semicircular blade being lowered on a cable. This is an interesting variation on the usual harmonic oscillator because the length L of the pendulum is not constant but rather an increasing function [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/14/poe-bessel-and-drones/">Poe, Bessel, and Drones</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>What&#8217;s a connection between Edgar Allan Poe and Friedrich Wilhelm Bessel?</p>
<p>Poe&#8217;s story The Pit and the Pendulum describes a pendulum with a semicircular blade being lowered on a cable. This is an interesting variation on the usual harmonic oscillator because the length <em>L</em> of the pendulum is not constant but rather an increasing function of time <em>L</em>(<em>t</em>).</p>
<p>Using the <a href="https://www.johndcook.com/blog/2010/07/27/sine-approximation-for-small-x/">small angle</a> approximation sin(θ) ≈ θ, the equation of motion is</p>
<p style="padding-left: 40px;"><em>L</em> θ″ + <em>L</em>′ θ′ + <em>g</em> θ = 0.</p>
<p>If we assume the length is increasing at a constant rate, then with a change of variables described in [1], this differential equation becomes Bessel&#8217;s equation and its solutions are Bessel functions.</p>
<p>The authors of [1] state that their primary interest is whether a pendulum can have the motion that Poe describes. But as they indicate in their opening sentence,</p>
<p style="padding-left: 40px;">The study of the motion of a steadily descending pendulum has practical applications (e.g., to the oscillations of a load being lowered by a crane).</p>
<p>A more recent application would be describing the motion of a package being delivered by a Zipline drone.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2014/07/03/pi-and-the-raven/">Pi and The Raven</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2026/04/25/exact-solution-nonlinear-pendulum/">The nonlinear pendulum equation</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2026/06/06/from-kepler-to-bessel/">From Kepler to Bessel</a></li>
</ul>
<p>[1] Robert L. Borrelli, Courtney S. Coleman, and Dana D. Hobson. Poe&#8217;s Pendulum. Mathematics Magazine, Vol. 58, No. 2 (Mar., 1985), pp. 78–83</p>The post <a href="https://www.johndcook.com/blog/2026/10/14/poe-bessel-and-drones/">Poe, Bessel, and Drones</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/14/poe-bessel-and-drones/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Harmonic triangle</title>
		<link>https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/</link>
					<comments>https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Tue, 13 Oct 2026 13:45:18 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Combinatorics]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248028</guid>

					<description><![CDATA[<p>Pascal&#8217;s triangle is the most famous triangular arrangement of numbers. I&#8217;ve written about other numerical triangles, such as Bell&#8217;s triangle and the trinomial triangle. There&#8217;s another well-known triangle that somehow I never heard of until recently: the harmonic triangle, first explored by Leibniz around 1700. To create the harmonic triangle, start with the harmonic series [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/">Harmonic triangle</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>Pascal&#8217;s triangle is the most famous triangular arrangement of numbers. I&#8217;ve written about other numerical triangles, such as <a href="https://www.johndcook.com/blog/2025/04/16/bell-numbers-2/">Bell&#8217;s triangle</a> and the <a href="https://www.johndcook.com/blog/2025/05/16/trinomial-coefficients-and-kings/">trinomial triangle</a>. There&#8217;s another well-known triangle that somehow I never heard of until recently: the harmonic triangle, first explored by Leibniz around 1700.</p>
<p>To create the harmonic triangle, start with the harmonic series</p>
<p style="padding-left: 40px;">1, 1/2, 1/3, 1/4, 1/5, …</p>
<p>This is the first column of the triangle. Next take the differences of the terms:</p>
<p style="padding-left: 40px;">(1 − 1/2), (1/2 − 1/3), (1/3 − 1/4), … = 1/2, 1/6, 1/12, …</p>
<p>This, shifted down one space, is the second column of the triangle. Taking differences again gives the third column, and so forth. Column <em>c</em> of the triangle consists of the <em>c</em>th differences of the harmonic series.</p>
<pre>    1
    1/2  1/2
    1/3  1/6   1/3
    1/4  1/12  1/12  1/4
    1/5  1/20  1/30  1/20  1/5
    …
</pre>
<p>Each entry is the difference of the entries to its west and northwest. If we let <em>L</em>(<em>r</em>, <em>c</em>) be the element in the <em>r</em>th row and <em>c</em>th column, then</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/liebniz_harmonic_triangle1.svg" alt="L(r,c) = L(r-1, c-1) - L(r, c - 1)" width="316" height="23" /></p>
<p>Every numerator is 1, though it&#8217;s not immediately obvious why this should be the case. And every number is a value of the beta function, the function that gives the normalizing constant for the beta distribution [1].</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/liebniz_harmonic_triangle2.svg" alt="L(r,c) = \frac{1}{r\binom{r-1}{c-1}} = \beta(c, r-c+1)" width="282" height="59" /></p>
<h2>Related posts</h2>
<ul>
<li class='link'><a href='https://www.johndcook.com/blog/2025/05/31/pascals-ellipse/'>The ellipse hidden inside Pascal’s triangle</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2025/07/24/analogs-of-binomial-coefficients/'>Analogs of binomial coefficients</a></li>
<li class='link'><a href='https://www.johndcook.com/blog/2020/02/04/odd-numbers-in-pascals-triangle/'>Odd numbers in Pascal&#8217;s triangle</a></li>
</ul>
<p>[1] Ayoub B. Ayoub. The Harmonic Triangle and the Beta Function. Mathematics Magazine, Vol. 60, No. 4 (Oct., 1987), pp. 223-225</p>The post <a href="https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/">Harmonic triangle</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/13/harmonic-triangle/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Categorical models of logics</title>
		<link>https://www.johndcook.com/blog/2026/10/12/categorical-models-of-logics/</link>
					<comments>https://www.johndcook.com/blog/2026/10/12/categorical-models-of-logics/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Mon, 12 Oct 2026 13:04:09 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Category theory]]></category>
		<category><![CDATA[Logic]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248025</guid>

					<description><![CDATA[<p>A few days ago I wrote about topological models of modal logic. If you find general topology more familiar than modal logic, this correspondence could be helpful. If you think the motivation for general topology is evident but the motivation for modal logic is suspect, the correspondence between the two fields might relieve some of [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/12/categorical-models-of-logics/">Categorical models of logics</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>A few days ago I wrote about <a href="https://www.johndcook.com/blog/2026/10/04/topological-models-of-modal-logic/">topological models of modal logic</a>. If you find general topology more familiar than modal logic, this correspondence could be helpful. If you think the motivation for general topology is evident but the motivation for modal logic is suspect, the correspondence between the two fields might relieve some of your suspicion of the latter.</p>
<p>Topological models, however, are quite limited. You can&#8217;t model <a href="https://www.johndcook.com/blog/2026/10/06/godel-lob/">provability logic</a>, for example, by the usual approach to constructing topological models, though there is an alternative construction.</p>
<p>Categorical models are less limited. You can model a wide variety of logics using categories via the Curry-Howard-Lambek correspondence. This may be cold comfort if you find category theory and logic equally mysterious. Even so, there&#8217;s something intriguing about a correspondence between two things you find mysterious.</p>
<p>Categorical semantics is deep and broad, but I&#8217;ll keep this post brief. The correspondence between logic [1] and categories [2] is summarized in the table below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/curry_howard_lambek.svg" alt="\begin{tabular}{ll} \hline \textbf{Logic} &amp; \textbf{Category theory} \\ \hline Proposition / formula &amp; Object \\ Proof of \(A\) from \(\Gamma\) &amp; Morphism \(\Gamma\to A\) \\ Truth \(\top\) &amp; Terminal object \(1\) \\ Falsehood \(\bot\) &amp; Initial object \(0\) \\ Conjunction \(A\land B\) &amp; Product \(A\times B\) \\ Disjunction \(A\lor B\) &amp; Coproduct \(A+B\) \\ Implication \(A\to B\) &amp; Exponential \(B^A\) \\ Negation \(\neg A\) &amp; Exponential \(0^A\) \\ \hline \end{tabular} " width="355" height="219" /></p>
<p>It&#8217;s interesting how model logic fits into this picture. Axiom K, required by normal modal logics, says</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/axiomk.svg" alt="\Box(A\to B)\;\longrightarrow\;(\Box A\to\Box B)" width="234" height="18" /></p>
<p>In categorial semantics, this says the box operator □ is a functor, mapping objects representing propositions to objects representing propositions, and mapping morphisms representing proofs to mapping morphisms representing proofs.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2026/10/08/privacy-policies-and-modal-logic/">Modeling policies in modal logic</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2026/05/06/category-mythology/">The mythology of category theory</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2023/05/22/category-theory-without-categories/">Category theory without categories</a></li>
</ul>
<p>[1] More precisely, intuitionistic propositional calculus.</p>
<p>[2] More precisely, bicartesian closed categories.</p>The post <a href="https://www.johndcook.com/blog/2026/10/12/categorical-models-of-logics/">Categorical models of logics</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/12/categorical-models-of-logics/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Privacy policies and modal logic</title>
		<link>https://www.johndcook.com/blog/2026/10/08/privacy-policies-and-modal-logic/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Thu, 08 Oct 2026 13:43:02 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Privacy]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248022</guid>

					<description><![CDATA[<p>If you&#8217;ve followed this blog for a while, you may know that I do a lot of work with data privacy and that I have an interest in modal logic. Recently these two worlds collided: I became aware of work that uses modal logic to reason about data privacy. The story begins with Helen Nissenbaum&#8217;s [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/08/privacy-policies-and-modal-logic/">Privacy policies and modal logic</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve followed this blog for a while, you may know that I do a lot of work with data privacy and that I have an interest in modal logic. Recently these two worlds collided: I became aware of work that uses modal logic to reason about data privacy.</p>
<p>The story begins with Helen Nissenbaum&#8217;s paper <em>Privacy as Contextual Integrity</em> [1]. Rather than simply classifying data as public or private, Nissenbaum looks at norms around the context in which data exists and moves.</p>
<blockquote><p>… the benchmark of privacy is contextual integrity; that in any given situation, a complaint that privacy has been violated is sound in the event that one or the other types of the informational norms has been transgressed.</p></blockquote>
<p>A couple years later Nissenbaum coauthored a paper [2] with three Stanford computer scientists using modal logic, specifically <strong>linear temporal logic</strong> (<strong>LTL</strong>), to reason about contextual integrity. The paper uses four modal operators: the usual box and diamond, plus past tense versions with a minus sign across the middle.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium" src="https://www.johndcook.com/ltl_operators.png" alt="box, diamond, box minus, diamond minus" width="270" height="92" /></p>
<p>These four operators can be read as &#8220;henceforth&#8221;, &#8220;eventually&#8221;, &#8220;historically&#8221;, and &#8220;once.&#8221;</p>
<p>Henceforth means something will always be true into the future; historically means something was always true in the past.</p>
<p>Eventually means something will happen at some time in the future; once means something occurred at some time in the past.</p>
<p>You could imagine using these operators to formalize statements such as data sharing in some context is permissible (henceforth) if the data subject has (once) signed a consent form.</p>
<p>Understanding simple stand-alone policies does not require the machinery of formal logic, but analyzing large collections of interacting policies may. It may be, for example, that a collection of policies cannot all be satisfied, though this is not obvious from looking at the individual policies. Formalizing policies in the language modal logic makes their analysis amenable to well established algorithms.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2018/10/30/modal-logic-security/">Temporal logic for cybersecurity</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2022/01/21/modal-logic-and-sf/">Modal logic and science fiction</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/data-privacy/">Data privacy consulting</a></li>
</ul>
<p>[1] H. Nissenbaum. Privacy as contextual integrity. Washington Law Review, 79(1):119–158, 2004.</p>
<p>[2] A. Barth, A. Datta, J. C. Mitchell, and H. Nissenbaum, &#8220;Privacy and contextual integrity: Framework and applications,&#8221; in Proc. 2006 IEEE Symp. Security and Privacy (S&amp;P&#8217;06), Berkeley/Oakland, CA, USA, 2006, pp. 184–198, doi: 10.1109/SP.2006.32.</p>The post <a href="https://www.johndcook.com/blog/2026/10/08/privacy-policies-and-modal-logic/">Privacy policies and modal logic</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Consequences of progress toward the Riemann Hypothesis</title>
		<link>https://www.johndcook.com/blog/2026/10/07/consequences-of-qrh/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 07 Oct 2026 22:29:28 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248019</guid>

					<description><![CDATA[<p>The Riemann Hypothesis (RH) is the conjecture that all the zeros of the Riemann zeta function ζ(s) in the critical strip, i.e. the region of the complex plane with real part between 0 and 1, have real part equal to ½. The Quasi Riemann Hypothesis (QRH) says that there exists a constant θ &#60; 1 [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/07/consequences-of-qrh/">Consequences of progress toward the Riemann Hypothesis</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The Riemann Hypothesis (RH) is the conjecture that all the zeros of the Riemann zeta function ζ(<em>s</em>) in the critical strip, i.e. the region of the complex plane with real part between 0 and 1, have real part equal to ½.</p>
<p>The Quasi Riemann Hypothesis (QRH) says that there exists a constant θ &lt; 1 such that no zeros of ζ(<em>s</em>) have real part greater than θ. <a href="https://github.com/openai/math/blob/main/preprints/The-Quasi-Riemann-Hypothesis-September-30-2026/paper.pdf">OpenAI</a> has published a paper claiming QRH with θ = 7/8.</p>
<p>The RH is so important to number theory that even partial results can have big consequences. This post will focus on one consequence: the error term in the Prime Number Theorem.</p>
<p>The Prime Number Theorem says that π(<em>x</em>), the number of primes less than <em>x</em>, is asymptotically equal to Li(<em>x</em>). We&#8217;d like to know more specifically at what rate π(<em>x</em>) approaches Li(<em>x</em>).</p>
<p>The best known result before the QRH announcement was</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/pnt_pre_qrh.svg" alt="\pi(x) = \operatorname{Li}(x) + {\cal O} \left(x \exp\!\left(-c\,\frac{(\log x)^{3/5}}{(\log\log x)^{1/5}}\right)\right) " width="360" height="50" /></p>
<p>If the QRH holds for some θ, such as OpenAI&#8217;s assertion that θ = 7/8,</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/pnt_qrh.svg" alt="\pi(x) = \operatorname{Li}(x) + {\cal O} \left(x^\theta\,\log x\right). " width="238" height="36" /><br />
If RH holds, θ = ½.</p>
<p>Incidentally, you may have seen the Prime Number Theorem stated with <em>x</em>/log(<em>x</em>) rather than Li(<em>x</em>). These two functions are asymptotically equal, so they give the same theorem, if you&#8217;re not interested in quantifying the rate of convergence. The function Li(<em>x</em>) gives better error bounds.</p>The post <a href="https://www.johndcook.com/blog/2026/10/07/consequences-of-qrh/">Consequences of progress toward the Riemann Hypothesis</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Faster Fourier Transform</title>
		<link>https://www.johndcook.com/blog/2026/10/07/faster-fourier-transform/</link>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 07 Oct 2026 21:41:47 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Fourier analysis]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248015</guid>

					<description><![CDATA[<p>The Fast Fourier Transform (FFT) algorithm can compute the discrete Fourier transform of a sequence of length n in time O(n log n). OpenAI recently posted a paper saying there is an algorithm that could compute the discrete Fourier transform in O(n (log n)1 − ε) time for ε = 10−13. This result is amazing. It seemed that [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/07/faster-fourier-transform/">Faster Fourier Transform</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>The Fast Fourier Transform (FFT) algorithm can compute the discrete Fourier transform of a sequence of length <em>n</em> in time</p>
<p style="padding-left: 40px;"><em>O</em>(<em>n</em> log <em>n</em>).</p>
<p><a href="https://github.com/openai/math/blob/main/preprints/An-explicit-power-saving-for-the-exact-discrete-Fourier-transform-September-25-2026/main.pdf">OpenAI</a> recently posted a paper saying there is an algorithm that could compute the discrete Fourier transform in</p>
<p style="padding-left: 40px;"><em>O</em>(<em>n</em> (log <em>n</em>)<sup>1 − ε</sup>)</p>
<p>time for ε = 10<sup>−13</sup>.</p>
<p>This result is amazing. It seemed that <em>O</em>(<em>n</em> log <em>n</em>) was as good as you could do, which it provably is for sorting algorithms.</p>
<p>The result is also of absolutely no practical value, for now. But since the theorem shows that our assumptions were wrong, however slightly, about what is possible, maybe we&#8217;re in for further surprises. Maybe the ε crack will grow. It wouldn&#8217;t be the first time.</p>
<h2>Related posts</h2>
<ul>
<li class="link"><a href="https://www.johndcook.com/blog/2015/09/08/fft-big-data/">The FFT and big data</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2024/02/03/fft-reciprocity/">FFT and quadratic reciprocity</a></li>
<li class="link"><a href="https://www.johndcook.com/blog/2023/09/03/dft-numpy-mathematica/">DFT conventions</a></li>
</ul>The post <a href="https://www.johndcook.com/blog/2026/10/07/faster-fourier-transform/">Faster Fourier Transform</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Irrationality exponent of π</title>
		<link>https://www.johndcook.com/blog/2026/10/07/irrationality-exponent-of-pi/</link>
					<comments>https://www.johndcook.com/blog/2026/10/07/irrationality-exponent-of-pi/#comments</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Wed, 07 Oct 2026 21:19:20 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>
		<guid isPermaLink="false">https://www.johndcook.com/blog/?p=248013</guid>

					<description><![CDATA[<p>For a real number x, the irrationality index μ(x) is a way of measuring how well x can be approximated by rational numbers. If x is rational, μ(x) = 1. If x is irrational, μ(x) ≥ 2. OpenAI recently published a proof that μ(π) = 2. Almost all real numbers have irrationality exponent 2, so the new result says [&#8230;]</p>
The post <a href="https://www.johndcook.com/blog/2026/10/07/irrationality-exponent-of-pi/">Irrationality exponent of π</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></description>
										<content:encoded><![CDATA[<p>For a real number <em>x</em>, the irrationality index μ(<em>x</em>) is a way of measuring how well <em>x</em> can be approximated by rational numbers. If <em>x</em> is rational, μ(<em>x</em>) = 1. If <em>x</em> is irrational, μ(<em>x</em>) ≥ 2.</p>
<p><a href="https://github.com/openai/math/tree/main/preprints/The-irrationality-exponent-of-pi-is-2-September-24-2026">OpenAI</a> recently published a proof that μ(π) = 2. Almost all real numbers have irrationality exponent 2, so the new result says π is typical in this regard. There are numbers proven to have irrationality index greater than 2 (more on that below), but π isn&#8217;t one of them.</p>
<p>The irrationality exponent μ(<em>x</em>) is defined as the supremum of the set of values ν such that</p>
<p><img loading="lazy" decoding="async" class="aligncenter" style="background-color: white;" src="https://www.johndcook.com/irrational_exponent.svg" alt="0 &lt; \left| x - \frac{p}{q} \right| &lt; \frac{1}{q^\nu}" width="135" height="48" /></p>
<p>for infinitely many coprime integers <em>p</em> and <em>q</em> with <em>q</em> &gt; 0.</p>
<p>This means that the approximation error for approximating π with a rational number <em>p</em>/<em>q</em> is typically on the order of 1/<em>q</em>², just like most irrational numbers.</p>
<p>There are numbers with higher irrationality exponents. For example, Cahen&#8217;s constant <em>C</em> has irrationality exponent 3. This means <em>C</em> is an irrational number that has infinitely many rational approximations <em>p</em>/<em>q</em> with error less than 1/<em>q</em>³.</p>The post <a href="https://www.johndcook.com/blog/2026/10/07/irrationality-exponent-of-pi/">Irrationality exponent of π</a> first appeared on <a href="https://www.johndcook.com/blog">John D. Cook</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.johndcook.com/blog/2026/10/07/irrationality-exponent-of-pi/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
