<?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>And now it’s all this</title>
	<atom:link href="https://leancrew.com/all-this/feed/" rel="self" type="application/rss+xml" />
	<link>https://leancrew.com/all-this/</link>
	<description>I just said what I said and it was wrong. Or was taken wrong.</description>
	<lastBuildDate>Mon, 20 Jul 2026 02:07:47 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
  <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
  <atom:link rel="hub" href="http://aniat.superfeedr.com"/>

<item>
<title>Sum of cubes via difference tables</title>
<link>https://leancrew.com/all-this/2026/07/sum-of-cubes-via-difference-tables/</link>
<pubDate>Mon, 20 Jul 2026 02:07:47 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/sum-of-cubes-via-difference-tables/</guid>
<description>
  <![CDATA[Yesterday I watched the most recent <a href="https://www.youtube.com/watch?v=cOTf_YEmSOU">Numberphile video</a>, in which Ben Sparks explains a few finite series and the equations that simplify the calculation of their sums. He derives the formulas graphically, and it’s all very cleverly done, especially the one for the sum of cubes.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/07/sum-of-cubes-via-difference-tables/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>Yesterday I watched the most recent <a href="https://www.youtube.com/watch?v=cOTf_YEmSOU">Numberphile video</a>, in which Ben Sparks explains a few finite series and the equations that simplify the calculation of their sums. He derives the formulas graphically, and it’s all very cleverly done, especially the one for the sum of cubes.</p>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/cOTf_YEmSOU?si=XoODs027usPCimUH" title="YouTube video player" width="100%"></iframe>
<p>The idea is to get a simple polynomial expression in <em>n</em> for</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>N</mi><mo>=</mo><munderover><mo>∑</mo><mrow><mi>m</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mspace width="0.167em"></mspace><msup><mi>m</mi><mn>3</mn></msup></mrow></math>
<p>As I said, Ben’s graphical method is really clever and easy to understand, and it leads to this expression:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>N</mi><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><msup><mo form="postfix" stretchy="false">)</mo><mn>2</mn></msup></mrow></math>
<p>I wanted to see if I could get that same result using a nongraphical and less clever method. The method that came to mind was to generate a handful of values, put them in a table, and start taking differences.</p>
<p>Here are some values of <em>n</em>, <em>N</em>, and the first four differences:</p>
<table>
<thead>
<tr>
<th align="right">n</th>
<th align="right">N</th>
<th align="right">Δ</th>
<th align="right">Δ²</th>
<th align="right">Δ³</th>
<th align="right">Δ⁴</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">8</td>
<td align="right">19</td>
<td align="right">18</td>
<td align="right">6</td>
</tr>
<tr>
<td align="right">2</td>
<td align="right">9</td>
<td align="right">27</td>
<td align="right">37</td>
<td align="right">24</td>
<td align="right">6</td>
</tr>
<tr>
<td align="right">3</td>
<td align="right">36</td>
<td align="right">64</td>
<td align="right">61</td>
<td align="right">30</td>
<td align="right"></td>
</tr>
<tr>
<td align="right">4</td>
<td align="right">100</td>
<td align="right">125</td>
<td align="right">91</td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr>
<td align="right">5</td>
<td align="right">225</td>
<td align="right">216</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr>
<td align="right">6</td>
<td align="right">441</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<p>The differences are calculated by looking in the preceding column and subtracting the value in the same row from the value in the following row. This sort of thing is fairly easy to do by hand but is <em>really</em> easy to do in a spreadsheet. Here’s a screenshot of the table in Numbers, where I’m displaying the formula for the first difference, Δ:</p>
<p><img alt="Difference table in Numbers" class="ss" src="https://leancrew.com/all-this/images2026/20260719-Difference%20table%20in%20Numbers.png" title="Difference table in Numbers" width="100%"/></p>
<p>That formula can be filled into all the difference cells, which is why it’s so easy. (I included only the first six rows in the table above because I figured you’d trust me that all the values in the fourth difference column, Δ⁴, are the same.)</p>
<p>The constant values in the fourth difference column mean <em>N</em> is a fourth-degree polynomial in <em>n</em>:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>N</mi><mo>=</mo><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mi>n</mi><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><msup><mi>n</mi><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><msup><mi>n</mi><mn>3</mn></msup><mo>+</mo><msub><mi>a</mi><mn>4</mn></msub><msup><mi>n</mi><mn>4</mn></msup></mrow></math>
<p>Because the constant fourth difference is 6, we know that</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>4</mn></msub><mo>=</mo><mfrac><mn>6</mn><mrow><mn>4</mn><mi>!</mi></mrow></mfrac><mo>=</mo><mfrac><mn>6</mn><mn>24</mn></mfrac><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac></mrow></math>
<p>This comes from the fact that differences are analogous to derivatives, and</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mrow><msup><mi>d</mi><mn>4</mn></msup><mi>N</mi></mrow><mrow><mi>d</mi><msup><mi>n</mi><mn>4</mn></msup></mrow></mfrac><mo>=</mo><mn>4</mn><mo>⋅</mo><mn>3</mn><mo>⋅</mo><mn>2</mn><mo>⋅</mo><mn>1</mn><mspace width="0.167em"></mspace><msub><mi>a</mi><mn>4</mn></msub><mo>=</mo> <mn>24</mn></mrow><mspace width="0.167em"></mspace><msub><mi>a</mi><mn>4</mn></msub></math>
<p>Once we know the degree of the polynomial and have <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>4</mn></msub></math>, we can figure out the other coefficients by solving a set of four simultaneous equations for four different values of <em>n</em> and <em>N</em>. For example:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable columnalign="left">
<mtr><mtd>
<mrow><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mo>⋅</mo><mn>1</mn><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><mo>⋅</mo><msup><mn>1</mn><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><mo>⋅</mo><msup><mn>1</mn><mn>3</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo>⋅</mo><msup><mn>1</mn><mn>4</mn></msup><mo>=</mo><mn>1</mn></mrow>
</mtd></mtr>
<mtr><mtd>
<mrow><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mo>⋅</mo><mn>2</mn><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><mo>⋅</mo><msup><mn>2</mn><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><mo>⋅</mo><msup><mn>2</mn><mn>3</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo>⋅</mo><msup><mn>2</mn><mn>4</mn></msup><mo>=</mo><mn>9</mn></mrow>
</mtd></mtr>
<mtr><mtd>
<mrow><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mo>⋅</mo><mn>3</mn><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><mo>⋅</mo><msup><mn>3</mn><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><mo>⋅</mo><msup><mn>3</mn><mn>3</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo>⋅</mo><msup><mn>3</mn><mn>4</mn></msup><mo>=</mo><mn>36</mn></mrow>
</mtd></mtr>
<mtr><mtd>
<mrow><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mo>⋅</mo><mn>4</mn><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><mo>⋅</mo><msup><mn>4</mn><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><mo>⋅</mo><msup><mn>4</mn><mn>3</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo>⋅</mo><msup><mn>4</mn><mn>4</mn></msup><mo>=</mo><mn>100</mn></mrow>
</mtd></mtr>
</mtable>
</math>
<p>We could use any four of the six <em>N</em>s we’ve calculated, but the first four are convenient. Let’s solve them in Python using NumPy and the <a href="https://numpy.org/doc/2.3/reference/generated/numpy.linalg.solve.html"><code>solve</code> function</a> from the <code>linalg</code> submodule. We can do this interactively:</p>
<pre><code>python:
from numpy import np

m = np.array([[1, 1, 1, 1], [1, 2, 4, 8], [1, 3, 9, 27], [1, 4, 16, 64]])
b = np.array([1 - 1**4/4, 9 - 2**4/4, 36 - 3**4/4, 100 - 4**4/4])
np.linalg.solve(m, b)
</code></pre>
<p>The last line returns</p>
<pre><code>python:
array([ 1.77635684e-15, -3.99680289e-15,  2.50000000e-01,  5.00000000e-01])
</code></pre>
<p>Those first two elements of the solution array are at the lower limit of what a floating point number can be. So we can say</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>0</mn></msub><mo>=</mo><mn>0</mn><mspace width="1.0em"></mspace><msub><mi>a</mi><mn>1</mn></msub><mo>=</mo><mn>0</mn><mspace width="1.0em"></mspace><msub><mi>a</mi><mn>2</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="1.0em"></mspace><msub><mi>a</mi><mn>3</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></math>
<p>Therefore,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>N</mi><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>4</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>3</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup></mrow></math>
<p>or, after collecting terms,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>N</mi><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><msup><mo form="postfix" stretchy="false">)</mo><mn>2</mn></msup></mrow></math>
<p>which is the formula Ben got in the video.</p>
<p>Doing basically the same thing in Mathematica is</p>
<pre><code>m = {{1, 1, 1, 1}, {1, 2, 4, 8}, {1, 3, 9, 27}, {1, 4, 16, 64}};
b = {1 - 1^4/4, 9 - 2^4/4, 36 - 3^4/4, 100 - 4^4/4};
LinearSolve[m, b]
</code></pre>
<p>which returns</p>
<pre><code>{0, 0, 1/4, 1/2}
</code></pre>
<p>This is the same as the Python answer but with no need to think about floating point precision.</p>
<p>A third way to solve the simultaneous equations is to do it in a spreadsheet. Here’s how that looks in Numbers:</p>
<p><img alt="Simultaneous equations solution in Numbers" class="ss" src="https://leancrew.com/all-this/images2026/20260719-Simultaneous%20equations%20solution%20in%20Numbers.png" title="Simultaneous equations solution in Numbers" width="100%"/></p>
<p>where</p>
<ul>
<li>the block of yellow cells is the matrix <code>m</code> in the Python and Mathematica solutions;</li>
<li>the block of magenta cells is the inverse of <code>m</code>;</li>
<li>the block of cyan cells is the vector <code>b</code> in the Python and Mathematica solutions; and</li>
<li>the block of gray cells is the solution for <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>0</mn></msub></math> through <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>3</mn></msub></math>, determined by multiplying the magenta matrix by the cyan vector.</li>
</ul>
<p>The spreadsheet uses a combination of <a href="https://support.apple.com/guide/functions/minverse-ffa8a8890aa0/web"><code>MINVERSE</code></a> and <a href="https://support.apple.com/guide/functions/mmult-ffa6eccc9b2e/15.3/web/1.0"><code>MMULT</code></a>, functions that are also in Excel and Google Sheets. As with the Python solution, there are floating point artifacts here. They’re mostly hidden by my choice to show only four decimal places, but that -0.0000 for <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>1</mn></msub></math> is a clue that these are not exact answers.</p>
<p>You might well ask why I’d bother using Python or Mathematica to solve the simultaneous equations if I already had a spreadsheet open to make the difference table. The answer is that I generally prefer working in an environment where my formulas and expressions are always visible. It makes things easier to debug, and I’m always debugging.</p>
<hr/>
<p>There are other ways to determine the coefficients. My favorite is a step-by-step procedure that simplifies the problem one polynomial degree at a time.</p>
<p>Given that we know <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>4</mn></msub><mo>=</mo><mn>1</mn><mi>/</mi><mn>4</mn></mrow></math> from the difference table above, we can make a new table for</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>P</mi><mo>=</mo><mi>N</mi><mo>−</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>4</mn></msup></mrow></math>
<p>and its differences. By subtracting the fourth-degree term from <em>N</em>, we expect <em>P</em> to be a third-degree polynomial. Here are the first five rows of the difference table for <em>P</em>:</p>
<table>
<thead>
<tr>
<th align="right">n</th>
<th align="right">P</th>
<th align="right">Δ</th>
<th align="right">Δ²</th>
<th align="right">Δ³</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td align="right">0.75</td>
<td align="right">4.25</td>
<td align="right">6.50</td>
<td align="right">3.00</td>
</tr>
<tr>
<td align="right">2</td>
<td align="right">5.00</td>
<td align="right">10.75</td>
<td align="right">9.50</td>
<td align="right">3.00</td>
</tr>
<tr>
<td align="right">3</td>
<td align="right">15.75</td>
<td align="right">20.25</td>
<td align="right">12.50</td>
<td align="right"></td>
</tr>
<tr>
<td align="right">4</td>
<td align="right">36.00</td>
<td align="right">32.75</td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr>
<td align="right">5</td>
<td align="right">68.75</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<p>As expected, they become constant at the third difference. Using the same technique we used to get <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>4</mn></msub></math>, we can say</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>3</mn></msub><mo>=</mo><mfrac><mn>3</mn><mrow><mn>3</mn><mi>!</mi></mrow></mfrac><mo>=</mo><mfrac><mn>3</mn><mn>6</mn></mfrac><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></math>
<p>Moving on, we make a table for</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>Q</mi><mo>=</mo><mi>P</mi><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>3</mn></msup></mrow></math>
<p>and its differences. Here are the first four rows of that table:</p>
<table>
<thead>
<tr>
<th align="right">n</th>
<th align="right">Q</th>
<th align="right">Δ</th>
<th align="right">Δ²</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td align="right">0.25</td>
<td align="right">0.75</td>
<td align="right">0.50</td>
</tr>
<tr>
<td align="right">2</td>
<td align="right">1.00</td>
<td align="right">1.25</td>
<td align="right">0.50</td>
</tr>
<tr>
<td align="right">3</td>
<td align="right">2.25</td>
<td align="right">1.75</td>
<td align="right"></td>
</tr>
<tr>
<td align="right">4</td>
<td align="right">4.00</td>
<td align="right"></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<p>These become constant at the second difference, and we can say</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>2</mn></msub><mo>=</mo><mfrac><mrow><mn>1</mn><mi>/</mi><mn>2</mn></mrow><mrow><mn>2</mn><mi>!</mi></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac></mrow></math>
<p>Finally, we make a table for</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>R</mi><mo>=</mo><mi>Q</mi><mo>−</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup></mrow></math>
<p>which is this:</p>
<table>
<thead>
<tr>
<th align="right">n</th>
<th align="right">R</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td align="right">0.00</td>
</tr>
<tr>
<td align="right">2</td>
<td align="right">0.00</td>
</tr>
<tr>
<td align="right">3</td>
<td align="right">0.00</td>
</tr>
<tr>
<td align="right">4</td>
<td align="right">0.00</td>
</tr>
</tbody>
</table>
<p>Since all the <em>R</em> values are zero, the rest of the coefficients, <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>1</mn></msub></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>0</mn></msub></math>, must be zero, and we’re done.</p>
<p>If it’s not obvious why <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>1</mn></msub><mo>=</mo><msub><mi>a</mi><mn>0</mn></msub><mo>=</mo><mn>0</mn></mrow></math>, consider this:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable columnalign="left">
<mtr>
<mtd><mi>R</mi><mspace height="1em"></mspace></mtd>
<mtd><mo>=</mo></mtd>
<mtd><mi>N</mi><mo>−</mo><msub><mi>a</mi><mn>4</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>4</mn></msup><mo>−</mo><msub><mi>a</mi><mn>3</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>3</mn></msup><mo>−</mo><msub><mi>a</mi><mn>2</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup></mtd>
</mtr>
<mtr>
<mtd><mspace height="1em"></mspace></mtd>
<mtd><mo>=</mo></mtd>
<mtd><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mspace width="0.167em"></mspace><mi>n</mi><mo>+</mo><msub><mi>a</mi><mn>2</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup><mo>+</mo><msub><mi>a</mi><mn>3</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>3</mn></msup><mo>+</mo><msub><mi>a</mi><mn>4</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>4</mn></msup><mo>−</mo><msub><mi>a</mi><mn>4</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>4</mn></msup><mo>−</mo><msub><mi>a</mi><mn>3</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>3</mn></msup><mo>−</mo><msub><mi>a</mi><mn>2</mn></msub><mspace width="0.167em"></mspace><msup><mi>n</mi><mn>2</mn></msup>
</mtd>
</mtr>
<mtr>
<mtd><mspace height="1em"></mspace></mtd>
<mtd><mo>=</mo>
</mtd>
<mtd><msub><mi>a</mi><mn>0</mn></msub><mo>+</mo><msub><mi>a</mi><mn>1</mn></msub><mspace width="0.167em"></mspace><mi>n</mi>
</mtd>
</mtr>
</mtable></math>
<p>The only way for <em>R</em> to be zero for all values of <em>n</em> is if <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>a</mi><mn>1</mn></msub><mo>=</mo><msub><mi>a</mi><mn>0</mn></msub><mo>=</mo><mn>0</mn></mrow></math>.</p>
<p>Building these tables is fairly easy, but it’s not as fast as building and solving the simultaneous equations. Still, there’s some satisfaction in marching to the answer this way. It’s basically a recursive solution, where we’re simplifying the problem with each step.</p>
<hr/>
<p>Using difference tables to work out the formula for the sum of cubes isn’t as slick as the graphical method shown in the video, but it does have the advantage of not requiring any ingenuity. I’m not opposed to ingenuity, but sometimes you want to just set the problem up, turn the mathematical crank, and get the answer.</p>
  ]]>
</content:encoded>
</item>

<item>
<title>Permanent Daylight Saving Time</title>
<link>https://leancrew.com/all-this/2026/07/permanent-daylight-saving-time/</link>
<pubDate>Fri, 17 Jul 2026 17:48:42 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/permanent-daylight-saving-time/</guid>
<description>
  <![CDATA[A couple of days ago, Casey Liss took a break from arguing about temperature scales to <a href="https://mastodon.social/@caseyliss/116924926813064237">tweak me</a> about the <a href="https://apnews.com/article/daylight-saving-time-house-passes-bill-53e7ffd1c3e9beddb9ab1601a8482ad5">recent passage</a> of the <a href="https://www.congress.gov/bill/119th-congress/house-bill/139">Sunshine Protection Act</a> by the House. The Act would make Daylight Saving Time permanent, something Casey knows <a href="https://leancrew.com/all-this/2013/03/why-i-like-dst/">I disapprove of</a>. A <a href="https://www.congress.gov/bill/117th-congress/senate-bill/623">similar bill</a> passed the Senate a few years ago, and Donald Trump has said he will sign this one, so there’s a decent chance it’ll become law. Let’s see what will happen if it does.]]>
</description>
<content:encoded>
  <![CDATA[<p>A couple of days ago, Casey Liss took a break from arguing about temperature scales to <a href="https://mastodon.social/@caseyliss/116924926813064237">tweak me</a> about the <a href="https://apnews.com/article/daylight-saving-time-house-passes-bill-53e7ffd1c3e9beddb9ab1601a8482ad5">recent passage</a> of the <a href="https://www.congress.gov/bill/119th-congress/house-bill/139">Sunshine Protection Act</a> by the House. The Act would make Daylight Saving Time permanent, something Casey knows <a href="https://leancrew.com/all-this/2013/03/why-i-like-dst/">I disapprove of</a>. A <a href="https://www.congress.gov/bill/117th-congress/senate-bill/623">similar bill</a> passed the Senate a few years ago, and Donald Trump has said he will sign this one, so there’s a decent chance it’ll become law. Let’s see what will happen if it does.</p>
<p>First, of course, there will be a lot of cheering from the people who moan about changing their clocks twice a year. Well, some of the moaners will cheer—the ones who wanted to eliminate DST and stay on Standard Time all year will grumble, but they’ll probably still be pleased to be released from that terrible burden.</p>
<p>I’m more interested in the consequences of permanent DST. You may recall <a href="https://leancrew.com/all-this/2023/11/more-general-sunrise-sunset-plots/">my sunrise/sunset plots</a>. Here’s one for Chicago in 2026:</p>
<p><img alt="Sunrise-sunset in Chicago" class="ss" src="https://leancrew.com/all-this/images2026/20260717-Sunrise-sunset%20in%20Chicago.png" title="Sunrise-sunset in Chicago" width="100%"/></p>
<p>The dirty yellow zones cover the DST period, which currently runs from the second Sunday in March to the first Sunday in November. A small change to the <code>sunplot</code> code extends that zone to the entire year:</p>
<p><img alt="Sunrise-sunset in Chicago with permanent DST" class="ss" src="https://leancrew.com/all-this/images2026/20260717-Sunrise-sunset%20in%20Chicago%20with%20permanent%20DST.png" title="Sunrise-sunset in Chicago with permanent DST" width="100%"/></p>
<p>I left the Standard Time lines in place for comparison, even though there won’t be any Standard Time if the Act becomes law.</p>
<p>As you can see, there will be a long stretch—more than two months—for which sunrise will be after 8:00.<sup id="fnref:2026"><a href="#fn:2026" rel="footnote">1</a></sup> I’m sure this won’t bother many of you who don’t do anything before 8:00, but there are lots of people it will bother. And I bet we’ll hear from them, even though a good chunk of them will be from the current cohort of clock-change moaners.</p>
<p>People living near the western edge of a time zone will have even more morning darkness. You may recall <a href="https://leancrew.com/all-this/2026/07/indiana-jewel-box-bank/">my visit</a> to a Louis Sullivan bank in West Lafayette, Indiana, a couple of weeks ago. My photos showed the sun shining on the north side of the bank, which happened because the sun rises late in West Lafayette. (By “late” I mean in local clock time. You could make an argument that the Sun, <a href="https://www.youtube.com/watch?v=HvWCnqY-GWQ">like Gandalf</a>, is never late. Nor is it early. It rises precisely when it means to.)</p>
<p>Let’s see the sunrise/sunset times in West Lafayette under permanent DST:</p>
<p><img alt="Sunrise-sunset in West Lafayette with permanent DST" class="ss" src="https://leancrew.com/all-this/images2026/20260717-Sunrise-sunset%20in%20West%20Lafayette%20with%20permanent%20DST.png" title="Sunrise-sunset in West Lafayette with permanent DST" width="100%"/></p>
<p>Basically five months for which the sun never rises before 8:00. And about seven weeks for which it doesn’t rise before 9:00. No one deserves that—not even Boilermakers.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:2026">
<p>Yes, the graph is just for 2026, but sunrise times don’t change all that much from year to year. <a href="#fnref:2026" rev="footnote">↩</a></p>
</li>
</ol>
</div>]]>
</content:encoded>
</item>

<item>
<title>Floating Saturn calculations</title>
<link>https://leancrew.com/all-this/2026/07/floating-saturn-calculations/</link>
<pubDate>Fri, 17 Jul 2026 02:14:08 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/floating-saturn-calculations/</guid>
<description>
  <![CDATA[You’ve probably seen somewhere that the density of Saturn is less than that of water. If there were a bathtub big enough to hold it, Saturn would float. I think I first read this in one of Isaac Asimov’s collections of science essays. If you do an image search, you can easily find <a href="https://www.google.com/search?hs=qZbV&amp;sca_esv=dd11972937bd8ee9&amp;udm=2&amp;fbs=ABfTbFVyMZGZf1hfvX9uKjN_-G8c4u0nXx4bEIpwm1lnNH832SMIiTl3t-JZ4hGJOxPbHYSIu8Q64jU5EwQ-803VaKbd8XGNh2EAGT96nVa30badWeLcMOEWQcU9WGmTgQb8mz6mPncLV6BMXrUfQD5ftu4HKiVJOOiqhNYT8Keh_15lhVLohIhM8kHnw_tixWHDpdAHWCTimc1GO2znH-0EdfLD74c9fw&amp;q=saturn+floating+in+water&amp;sa=X&amp;ved=2ahUKEwjGueL9vNiVAxXjqysGHThVNzEQtKgLegQIGhAB&amp;biw=1106&amp;bih=835&amp;dpr=2">many illustrations</a> of Saturn floating in water. Most of these show no more than half of Saturn under the water. Could that be right?]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/07/floating-saturn-calculations/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>You’ve probably seen somewhere that the density of Saturn is less than that of water. If there were a bathtub big enough to hold it, Saturn would float. I think I first read this in one of Isaac Asimov’s collections of science essays. If you do an image search, you can easily find <a href="https://www.google.com/search?hs=qZbV&amp;sca_esv=dd11972937bd8ee9&amp;udm=2&amp;fbs=ABfTbFVyMZGZf1hfvX9uKjN_-G8c4u0nXx4bEIpwm1lnNH832SMIiTl3t-JZ4hGJOxPbHYSIu8Q64jU5EwQ-803VaKbd8XGNh2EAGT96nVa30badWeLcMOEWQcU9WGmTgQb8mz6mPncLV6BMXrUfQD5ftu4HKiVJOOiqhNYT8Keh_15lhVLohIhM8kHnw_tixWHDpdAHWCTimc1GO2znH-0EdfLD74c9fw&amp;q=saturn+floating+in+water&amp;sa=X&amp;ved=2ahUKEwjGueL9vNiVAxXjqysGHThVNzEQtKgLegQIGhAB&amp;biw=1106&amp;bih=835&amp;dpr=2">many illustrations</a> of Saturn floating in water. Most of these show no more than half of Saturn under the water. Could that be right?</p>
<p>Because there were several things I should have been doing this afternoon, I decided to work out how much of Saturn should be underwater in these images. Even better, I’d do the more general problem: how much of any sphere would be submerged in a liquid if the density of the sphere is less than that of the liquid?</p>
<p>Here’s a cross-section of the problem:</p>
<p><img alt="Floating sphere" class="ss" src="https://leancrew.com/all-this/images2026/20260716-Floating%20sphere.png" title="Floating sphere" width="75%"/></p>
<p>We’ll say the sphere has a radius <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math>, a diameter <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>d</mi><mo>=</mo><mn>2</mn><mi>r</mi></mrow></math>, and a uniform density of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>ρ</mi><mi>s</mi></msub></math>. The density of the liquid is <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>ρ</mi><mi>ℓ</mi></msub></math>. Because the sphere floats, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>ρ</mi><mi>s</mi></msub><mo>&lt;</mo><msub><mi>ρ</mi><mi>ℓ</mi></msub></mrow></math>. The distance <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math> is how far the bottom of the sphere is below the liquid surface.</p>
<p>The mechanics of the system is simple: the mass of liquid displaced by the submerged portion of the sphere is equal to the entire mass of the sphere. That is,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>ρ</mi><mi>ℓ</mi></msub><mspace width="0.167em"></mspace><msub><mi>V</mi><mi>b</mi></msub><mo>=</mo><msub><mi>ρ</mi><mi>s</mi></msub><mspace width="0.167em"></mspace><msub><mi>V</mi><mi>s</mi></msub></mrow></math>
<p>where</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>V</mi><mi>b</mi></msub><mo>=</mo><mfrac><mrow><mi>π</mi><msup><mi>b</mi><mn>2</mn></msup></mrow><mn>3</mn></mfrac><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mn>3</mn><mi>r</mi><mo>−</mo><mi>b</mi><mo form="postfix" stretchy="false">)</mo></mrow></math>
<p>is the volume of the submerged portion of the sphere and</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>V</mi><mi>s</mi></msub><mo>=</mo><mfrac><mn>4</mn><mn>3</mn></mfrac><mi>π</mi><msup><mi>r</mi><mn>3</mn></msup></mrow></math>
<p>is the volume of the entire sphere. These expressions are usually given in terms of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math>, as I’ve shown here, but eventually I want to work out the value of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math> as a fraction of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>d</mi></math>.</p>
<p>In fact, since I want to make a plot, which requires pure numbers, let’s nondimensionalize our variables by saying</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>β</mi><mo>=</mo><mfrac><mi>b</mi><mi>r</mi></mfrac><mspace width="1.0em"></mspace><mrow><mi mathvariant="normal">a</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">d</mi></mrow><mspace width="1.0em"></mspace><mi>ρ</mi><mo>=</mo><mfrac><msub><mi>ρ</mi><mi>s</mi></msub><msub><mi>ρ</mi><mi>ℓ</mi></msub></mfrac></mrow></math>
<p>Putting all this together and doing a little algebra, we get</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>r</mi><msub><mi>ρ</mi><mi>ℓ</mi></msub><mo form="prefix" stretchy="false">(</mo><msup><mi>β</mi><mn>3</mn></msup><mo>−</mo><mn>3</mn><msup><mi>β</mi><mn>2</mn></msup><mo>+</mo><mn>4</mn><mi>ρ</mi><mo form="postfix" stretchy="false">)</mo><mo>=</mo><mn>0</mn></mrow></math>
<p>Since neither <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math> nor <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>ρ</mi><mi>ℓ</mi></msub></math> is zero, the expression in the parentheses must be. In other words,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>ρ</mi><mo>=</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo form="prefix" stretchy="false">(</mo><mn>3</mn><msup><mi>β</mi><mn>2</mn></msup><mo>−</mo><msup><mi>β</mi><mn>3</mn></msup><mo form="postfix" stretchy="false">)</mo></mrow></math>
<p>Since <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>0</mn><mo>&lt;</mo><mi>β</mi><mo>≤</mo><mn>2</mn></mrow></math>, the right-hand side of the equation must be greater than zero, so we don’t have to worry about negative densities.</p>
<p>Typically, we’d want to calculate <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>β</mi></math> for a given value of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>ρ</mi></math>, so this equation isn’t in the most useful form. But it’s easy to plot values using this equation, even if we do want <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>ρ</mi></math> to be plotted on the horizontal axis.</p>
<p>I mentioned earlier that I prefer to show the depth <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math> as a fraction of the diameter, not the radius, i.e.,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mi>b</mi><mi>d</mi></mfrac><mo>=</mo><mfrac><mi>b</mi><mrow><mn>2</mn><mi>r</mi></mrow></mfrac><mo>=</mo><mfrac><mi>β</mi><mn>2</mn></mfrac></mrow></math>
<p>Here’s that plot, which comes out in a sigmoidal shape:</p>
<p><img alt="Floating sphere plot" class="ss" src="https://leancrew.com/all-this/images2026/20260716-Floating%20sphere%20plot.png" title="Floating sphere plot" width="100%"/></p>
<p>To figure out how much of Saturn would be under the water, we need Saturn’s density, which we can find on NASA’s old <a href="https://web.archive.org/web/20250821165423/https://nssdc.gsfc.nasa.gov/planetary/factsheet/saturnfact.html">Saturn Fact Sheet</a>, as archived on the Wayback Machine. It’s <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>687</mn><mspace width="0.278em"></mspace><mrow><mi mathvariant="normal">k</mi><mi mathvariant="normal">g</mi><mi mathvariant="normal">/</mi><msup><mi mathvariant="normal">m</mi><mn mathvariant="normal">3</mn></msup></mrow></mrow></math>, which means our density ratio is 0.687. Looking that up in the plot, we see that the submerged portion of Saturn is between 60% and 65% of its diameter. A quick numerical solution gives us 62.7% of the diameter. Only 37.3% would be high and dry.</p>
<p>So those many illustrations showing more than half of Saturn’s diameter sticking out above the water are all wet.<sup id="fnref:yes"><a href="#fn:yes" rel="footnote">1</a></sup> Of course, just seeing that Saturn’s specific gravity was over 0.5 is enough to know that most of it is underwater, but now we can put a number on it.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:yes">
<p>Yes, I went there. <a href="#fnref:yes" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

<item>
<title>Plotting of and by students</title>
<link>https://leancrew.com/all-this/2026/07/plotting-of-and-by-students/</link>
<pubDate>Fri, 10 Jul 2026 02:54:30 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/plotting-of-and-by-students/</guid>
<description>
  <![CDATA[I saw <a href="https://www.insidehighered.com/news/faculty/learning-assessment/2026/07/08/brown-professor-suspects-most-his-class-used-ai-cheat">this article</a> at <em>Inside Higher Ed</em> this morning, guided by a <a href="https://fosstodon.org/@Techmeme@techhub.social/116888374760055001">Mastodon post</a> from Techmeme. The title of the article is “Brown Professor Suspects Majority of His Class Used AI to Cheat,” so if you’re sick to death of reading about AI—pro, con, or caveated—don’t feel obligated to follow the link. I’m interested in a plot included in the article more than the article itself.]]>
</description>
<content:encoded>
  <![CDATA[<p>I saw <a href="https://www.insidehighered.com/news/faculty/learning-assessment/2026/07/08/brown-professor-suspects-most-his-class-used-ai-cheat">this article</a> at <em>Inside Higher Ed</em> this morning, guided by a <a href="https://fosstodon.org/@Techmeme@techhub.social/116888374760055001">Mastodon post</a> from Techmeme. The title of the article is “Brown Professor Suspects Majority of His Class Used AI to Cheat,” so if you’re sick to death of reading about AI—pro, con, or caveated—don’t feel obligated to follow the link. I’m interested in a plot included in the article more than the article itself.</p>
<p>An economics professor gave his class a take-home midterm, and the grades on it were much higher than usual. He suspected the high marks came from the students using LLMs to answer the questions, so the final exam was done in class and the marks were generally much lower. Here’s the plot given in the article:</p>
<p><img alt="Test grades by student from IHE" class="ss" src="https://leancrew.com/all-this/images2026/20260709-Test%20grades%20by%20student%20from%20IHE.png" title="Test grades by student from IHE" width="80%"/></p>
<p class="caption">Image from <a href="https://www.insidehighered.com/news/faculty/learning-assessment/2026/07/08/brown-professor-suspects-most-his-class-used-ai-cheat"><em>Inside Higher Ed</em></a>.</p>
<p>Let me start by saying I have no criticisms of the plot, just some comments about things that struck me.</p>
<p>First, the upper portion of the chart made me think the students, S1 through S59, were ordered according to their score on the final exam (the gray dots and figures). But as you go down the list, you soon see that that isn’t the case. After reading past the chart, I saw that the professor decided to throw out the results of the midterm and use the final exam as 80% of the course grade. Presumably, the students were sorted by their course grade.</p>
<p>More important, though, was the chart’s layout. When plotting a pair of scores for every student, the usual convention would be to have the students (the categories) laid out along the horizontal axis and their scores (the values) plotted on the vertical axis. This does it the other way around. There’s nothing wrong with doing it that way; it’s just unusual. Sort of like seeing a time series chart in which time is on the vertical axis. There can be good reasons to do it, but usually people don’t.</p>
<p>I first read the article on my phone, so I wondered if the layout was driven by the aspect ratio of most phones in portrait mode. In fact, since the chart is not actually an image but some sort of JavaScript thingy from <a href="https://www.datawrapper.de/">Datawrapper</a>. At least I think that’s what it is—I couldn’t select the chart as an image, and when I looked at the page’s HTML, I saw it was in an <code>&lt;iframe&gt;</code> element.</p>
<p>This made me wonder if the chart would flip to a more conventional layout if the aspect ratio of the browser were different. Turning my phone to landscape mode didn’t flip the axes, nor did opening the page on my MacBook Pro with a wide Safari window. Clearly the author of the article, Emma Whitford, thought it was best to have the students running down the vertical axis.</p>
<p>I decided to see what a more conventional layout would look like. I used the link on the page to download the plot’s data as a CSV file—a very thoughtful addition to the article and something I wish more authors did—and whipped out a quick plot in <a href="https://matplotlib.org/">Matplotlib</a>. Here it is:</p>
<p><a href="https://leancrew.com/all-this/images2026/20260709-Midterm%20and%20final%20exam%20results.png"><img alt="Midterm and final exam results" class="ss" src="https://leancrew.com/all-this/images2026/20260709-Midterm%20and%20final%20exam%20results.png" title="Midterm and final exam results" width="100%"/></a></p>
<p>Even in a wide browser window, it’s pretty tightly constrained, mainly because I have a width limit on the content portion of ANIAT (that’s to keep lines of text of reasonable length). If you click on the chart, it’ll open to the full width of your browser window, which will make it easier to peruse.</p>
<p>Here’s the code that produced the chart:</p>
<pre><code>python:
 1:  #!/usr/bin/env python3
 2:  
 3:  import pandas as pd
 4:  import numpy as np
 5:  import matplotlib.pyplot as plt
 6:  from matplotlib.ticker import MultipleLocator, AutoMinorLocator
 7:  
 8:  # Read in the exam scores
 9:  df = pd.read_csv('scores.csv')
10:  
11:  # Create the plot with a given size in inches
12:  fig, ax = plt.subplots(figsize=(12, 6))
13:  
14:  # Bar colors are based on whether midterm was higher than final
15:  colors = ['#0571b0']*59
16:  for i in range(59):
17:    if df.Final[i] &gt; df.Midterm[i]:
18:      colors[i] = '#ca0020'
19:  
20:  # Plot the scores as columns between the final and midterm scores
21:  ax.bar(df.Student, df.Midterm-df.Final, bottom=df.Final, width=.5, color=colors, zorder=10)
22:  
23:  # Set the limits
24:  plt.xlim(xmin=0, xmax=60)
25:  plt.ylim(ymin=0, ymax=100)
26:  
27:  # Set the major and minor ticks and add a grid
28:  ax.xaxis.set_major_locator(MultipleLocator(5))
29:  ax.xaxis.set_minor_locator(AutoMinorLocator(5))
30:  ax.yaxis.set_major_locator(MultipleLocator(20))
31:  ax.yaxis.set_minor_locator(AutoMinorLocator(2))
32:  ax.grid(linewidth=.5, axis='x', which='both', color='#dddddd', linestyle='-', zorder=0)
33:  ax.grid(linewidth=.5, axis='y', which='both', color='#dddddd', linestyle='-', zorder=0)
34:  
35:  # Title and axis labels
36:  plt.title('Final to midterm exam result ranges')
37:  plt.xlabel('Student ID')
38:  plt.ylabel('Score')
39:  
40:  # Make the border and tick marks 0.5 points wide
41:  [ i.set_linewidth(0.5) for i in ax.spines.values() ]
42:  ax.tick_params(which='both', width=.5)
43:  
44:  # Add a note
45:  ax.text(5, 25, 'Midterms were higher than finals except for Student 22', va='center')
46:  
47:  # Save as PDF
48:  plt.savefig('20260709-Midterm and final exam results.png', format='png', bbox_inches='tight', dpi=150)
</code></pre>
<p>A few comments on this:</p>
<ul>
<li>I didn’t put dots where the midterm and final scores were. The ends of the columns do the job (but see below).</li>
<li>I didn’t include the test scores in the chart. Although that can be helpful in situations in which a data file isn’t provided, my tendency is to let tables be tables and charts be charts. A chart should give you a feel for the data without including the numbers themselves. I don’t always follow this principle, and it doesn’t bother me when others don’t—as long as the numbers don’t detract from the plot.</li>
<li>I didn’t label every student. It makes the horizontal axis too busy and doesn’t help the reader.</li>
<li>I changed the color of the column for the one student who got a higher score on the final than the midterm and also added an explanatory note. This may be too cute. Colored dots for the two scores, as in the IHE chart, are certainly more obvious, even though they make the chart more cluttered.</li>
<li>I got the two column colors, <code>#0571b0</code> and <code>#ca0020</code>, from <a href="https://colorbrewer2.org/#type=sequential&amp;scheme=BuGn&amp;n=3">ColorBrewer</a>.</li>
<li>If you run the code yourself, you’ll find ticks and labels for nonexistent students 0 and 60. Rather than adding a bunch of Matplotlib code to get rid of those ticks and labels, I opened the PNG file in <a href="https://flyingmeat.com/acorn/">Acorn</a> and erased them. I don’t consider this cheating.</li>
</ul>
<p>Overall, I think my chart works, and I had fun thinking about how to make it. But it’s not better than the original.</p>
<div class="update">
<p><strong>Update 10 Jul 2026 5:07 AM</strong><br/>
Sometimes I just want to be done with a post, and I publish it before I should. That’s what happened last night. While it’s true that categories are usually laid out horizontally, I shouldn’t have left the impression that it’s tremendously rare for them to be laid out vertically. There are plenty of good vertical examples.</p>
<p>A clear reason for a vertical layout is a large number of categories, and while 59 categories isn’t especially large, it’s definitely heading in that direction. I made my chart mainly to see if a horizontal layout can work with 59 categories, and I think it can—at least if you can give your plot enough horizontal space.</p>
<p>(Another good reason for a vertical layout is that it works better typographically. Sometimes the categories have long names, and they fit better in a column than in a row. That isn’t the case here, but it happens.)</p>
<p>Thanks to <a href="https://fosstodon.org/@jannem/116893573652317907">Janne Moren</a> for making me realize that this post was too blunt as originally written.</p>
</div>]]>
</content:encoded>
</item>

<item>
<title>Old icons</title>
<link>https://leancrew.com/all-this/2026/07/old-icons/</link>
<pubDate>Wed, 08 Jul 2026 02:30:46 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/old-icons/</guid>
<description>
  <![CDATA[There’s been a lot of talk lately about Mac application icons and “squircle jail.” Inspired by <a href="https://weblog.rogueamoeba.com/2026/06/26/free-the-icons/">this post</a> from Paul Kafasis on the Rogue Amoeba blog,<sup id="fnref:tsunami"><a href="#fn:tsunami" rel="footnote">1</a></sup> many Mac-adjacent people have taken up his cause to “Free the Icons.”]]>
</description>
<content:encoded>
  <![CDATA[<p>There’s been a lot of talk lately about Mac application icons and “squircle jail.” Inspired by <a href="https://weblog.rogueamoeba.com/2026/06/26/free-the-icons/">this post</a> from Paul Kafasis on the Rogue Amoeba blog,<sup id="fnref:tsunami"><a href="#fn:tsunami" rel="footnote">1</a></sup> many Mac-adjacent people have taken up his cause to “Free the Icons.”</p>
<p>I agree, but Apple’s 50th anniversary has gotten me thinking a lot lately about the early days of the Mac, so it’s only natural that my mind shifted to the highly constrained icons Mac applications had back then.</p>
<p>In those days, icons were 32×32 pixel images, and every pixel was either black or white. The classic original Mac application icons were the ones for MacWrite and MacPaint.<sup id="fnref:infinite"><a href="#fn:infinite" rel="footnote">2</a></sup></p>
<p><img alt="MacWrite and MacPaint" class="ss" src="https://leancrew.com/all-this/images2026/20260707-MacWrite%20and%20MacPaint.png" title="MacWrite and MacPaint" width="350px"/></p>
<p>You can see that Apple liked the idea of app icons being a tilted rectangle with some image inside the rectangle to indicate what the app did. The hand was Apple’s way of telling you that this icon was for doing things, and the rectangle was tilted to match the orientation of the hand. (If you were left-handed, this was just another injustice inflicted on you by a cruel right-handed world.)</p>
<p>Document icons were typically upright rectangles with dog-eared corners and similar designs inside the rectangle—no hands because documents don’t do anything. But we’re not here to talk about document icons.</p>
<p>Other Apple app icons that fit this pattern were the ones for MacDraw and HyperCard:</p>
<p><img alt="MacDraw and HyperCard" class="ss" src="https://leancrew.com/all-this/images2026/20260707-MacDraw%20and%20HyperCard.png" title="MacDraw and HyperCard" width="350px"/></p>
<p>The HyperCard icon was a bit of a departure, in that it had a stack of rectangles, but the idea was the same. There was no image on the top card of the stack, probably because there wasn’t enough room.</p>
<p>Many of the complaints about squircle jail are about the loss of icon elements that “stick out” from the rest of the design. As you can see, this idea was there from the very start; the hands stick out from the tilted rectangles.</p>
<p>Most other software publishers followed Apple’s lead. Here are the icons for Aldus PageMaker and QuarkXPress:</p>
<p><img alt="PageMaker and Quark XPress" class="ss" src="https://leancrew.com/all-this/images2026/20260707-PageMaker%20and%20Quark%20XPress.png" title="PageMaker and Quark XPress" width="350px"/></p>
<p>Aldus had a slightly different idea for what the hand should look like.</p>
<p>It’s important to recall that the Mac didn’t have a Dock back then. You launched an app by finding its icon on your disk and double-clicking.<sup id="fnref:document"><a href="#fn:document" rel="footnote">3</a></sup> The icon always had the name of the app underneath it, which was good. If you had both PageMaker and XPress, I imagine it would be easy to confuse such similar icons in a Dock.</p>
<p>The folks at THINK took a slightly different approach for their Pascal editor/compiler. They kept the idea of hands, but because nobody programs with a pencil, they put two hands on a keyboard and showed them generating a flowchart:</p>
<p><img alt="THINK Pascal" class="ss" src="https://leancrew.com/all-this/images2026/20260707-THINK%20Pascal.png" title="THINK Pascal" width="128px"/></p>
<p>Other publishers abandoned either the hands or the tilted rectangle or both. As people got more used to working with Macs, these clues for what’s an app and what isn’t became unnecessary, and icon design became less constrained. Even Apple gave up on them for utilities like Disk First Aid and Font/DA Mover:</p>
<p><img alt="Disk First Aid and FontDA Mover" class="ss" src="https://leancrew.com/all-this/images2026/20260707-Disk%20First%20Aid%20and%20FontDA%20Mover.png" title="Disk First Aid and FontDA Mover" width="350px"/></p>
<p>And there was, of course, my favorite Apple icon of this era, the one for ResEdit:</p>
<p><img alt="ResEdit" class="ss" src="https://leancrew.com/all-this/images2026/20260707-ResEdit.png" title="ResEdit" width="128px"/></p>
<p>This is what old-timers mean when they talk about Apple and whimsy.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:tsunami">
<p>As opposed to his wonderful personal blog, <a href="https://onefoottsunami.com/"><em>One Foot Tsunami</em></a>. <a href="#fnref:tsunami" rev="footnote">↩</a></p>
</li>
<li id="fn:infinite">
<p>All of the icon images in this post are screenshots taken from an <a href="https://infinitemac.org/">Infinite Mac</a> session. <a href="#fnref:infinite" rev="footnote">↩</a></p>
</li>
<li id="fn:document">
<p>Yes, you could also launch an app by double-clicking on the icon of one of its documents. But I told you we’re not here to talk about document icons. <a href="#fnref:document" rev="footnote">↩</a></p>
</li>
</ol>
</div>]]>
</content:encoded>
</item>

<item>
<title>Indiana jewel box bank</title>
<link>https://leancrew.com/all-this/2026/07/indiana-jewel-box-bank/</link>
<pubDate>Fri, 03 Jul 2026 00:50:26 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/indiana-jewel-box-bank/</guid>
<description>
  <![CDATA[I visited my eighth and final Louis Sullivan jewel box bank yesterday morning. The <a href="https://en.wikipedia.org/wiki/Purdue_State_Bank">Purdue State Bank</a> (now a Chase branch) is in West Lafayette, Indiana. As a graduate of the University of Illinois, I have thoughts about Purdue University and its substandard engineering program, but I will keep those thoughts to myself and focus on the bank.]]>
</description>
<content:encoded>
  <![CDATA[<p>I visited my eighth and final Louis Sullivan jewel box bank yesterday morning. The <a href="https://en.wikipedia.org/wiki/Purdue_State_Bank">Purdue State Bank</a> (now a Chase branch) is in West Lafayette, Indiana. As a graduate of the University of Illinois, I have thoughts about Purdue University and its substandard engineering program, but I will keep those thoughts to myself and focus on the bank.</p>
<p><img alt="North side of building with addition" class="ss" src="https://leancrew.com/all-this/images2026/20260702-North%20side%20of%20building%20with%20addition.jpg" title="North side of building with addition" width="100%"/></p>
<p>This is the north side of the bank. The thoroughly incompatible stone addition to the building was (according to Wikipedia) built in the 50s, but I must say the original brick and terra cotta portion of the building is in excellent shape. I don’t know when Chase took over, but they’ve done a great job with the old exterior.</p>
<p>A fun thing about the bank is that it’s wedge-shaped. Here’s an aerial view I pulled from Apple Maps:</p>
<p><img alt="Apple Maps aerial view" class="ss" src="https://leancrew.com/all-this/images2026/20260702-Apple%20Maps%20aerial%20view.jpg" title="Apple Maps aerial view" width="80%"/></p>
<p>The narrow west side of the building used to be the entrance, but it’s now an ATM.</p>
<p><img alt="West side and former entrance" class="ss" src="https://leancrew.com/all-this/images2026/20260702-West%20side%20and%20former%20entrance.jpg" title="West side and former entrance" width="80%"/></p>
<p>You may be surprised to learn that I don’t find this sacrilegious. It’s a reasonable reuse of a part of the building that wouldn’t make sense as an entrance anymore, and they’ve preserved the glazed terra cotta around it. The signage, though, is awful. Maybe Chase felt the big empty space above the old entrance—which presumably had “Purdue State Bank” removed long ago—didn’t look right without its branding. Wrong.</p>
<p>There are some very nice details around and above the windows. Here’s a closer look at the north side:</p>
<p><img alt="North facade details" class="ss" src="https://leancrew.com/all-this/images2026/20260702-North%20facade%20details.jpg" title="North facade details" width="100%"/></p>
<p>And here are essentially the same details on the south side, where the sun didn’t create such harsh shadows:</p>
<p><img alt="South side details 1" class="ss" src="https://leancrew.com/all-this/images2026/20260702-South%20side%20details%201.jpg" title="South side details 1" width="100%"/></p>
<p><img alt="South side details 2" class="ss" src="https://leancrew.com/all-this/images2026/20260702-South%20side%20details%202.jpg" title="South side details 2" width="100%"/></p>
<p><img alt="South side details 3" class="ss" src="https://leancrew.com/all-this/images2026/20260702-South%20side%20details%203.jpg" title="South side details 3" width="100%"/></p>
<p>The shade on the south side also allowed a decent view of the sides of the pillars between the windows.</p>
<p><img alt="South side of building" class="ss" src="https://leancrew.com/all-this/images2026/20260702-South%20side%20of%20building.jpg" title="South side of building" width="80%"/></p>
<p>I have no photos of the interior because it was terribly disappointing. I knew the east half of the building would be generic, but I thought they might have preserved something of the original in the west half. But as I turned right after going through the doors, I saw that wasn’t the case. The entire interior is just white painted drywall and LED lighting. The only thing that sets it apart from any other Chase branch is that the offices in the west half are noticeably squeezed together.</p>
<p>Given the care taken to preserve the exterior, I suspect the interior had been defiled before Chase took over, and there was nothing left in there to care for. That’s a shame, and it was an unfortunate way to end my visits. But the exterior was really nice and certainly worth the trip.</p>
<hr/>
<p>One last thing: Are you surprised to see the Sun hitting the north side of the building? I confess I was. But after thinking about it, it made sense. First, my visit was on July 1, less than two weeks after the summer solstice, which means the Sun rises pretty far north of due east. Second, we’re in Daylight Saving Time, which means the bank’s opening time of 9:00 AM is closer to sunrise than it would be if we were on Standard Time. Finally, West Lafayette is just east of the boundary between the Eastern and Central time zones, and I live just west of the boundary. I’m used to sunrise happening nearly an hour earlier (in local time) than it happens in West Lafayette.</p>
<p>Of course I couldn’t leave it at that. I fired up Mathematica and used its <a href="https://reference.wolfram.com/language/ref/SunPosition.html"><code>SunPosition</code> function</a> to figure out where the Sun was in the sky when I took that photo (9:22 AM EDT) of the north side of the bank:</p>
<iframe height="300" src="https://www.wolframcloud.com/obj/mark80/Published/west-lafayette-sun.nb?_embed=iframe" width="100%"></iframe>
<p>As you can see, the Sun’s azimuth, the first item of the result, was about 85°, making it slightly north of east. The same calculation (with the same result) can be made on the web using the <a href="https://gml.noaa.gov/grad/solcalc/">NOAA Solar Calculator</a>.</p>]]>
</content:encoded>
</item>

<item>
<title>Ohio jewel box bank 2</title>
<link>https://leancrew.com/all-this/2026/07/ohio-jewel-box-bank-2/</link>
<pubDate>Wed, 01 Jul 2026 22:01:49 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/07/ohio-jewel-box-bank-2/</guid>
<description>
  <![CDATA[Yesterday I visited the <a href="https://en.wikipedia.org/wiki/Home_Building_Association_Bank">Home Building Association Bank</a> in Newark, Ohio, a Louis Sullivan jewel box bank built in 1914. It’s currently owned by the <a href="https://explorelc.squarespace.com/louis-sullivan">Licking County Foundation</a> (oh, grow up), which restored it at considerable cost over several years and reopened it to the public last fall.]]>
</description>
<content:encoded>
  <![CDATA[<p>Yesterday I visited the <a href="https://en.wikipedia.org/wiki/Home_Building_Association_Bank">Home Building Association Bank</a> in Newark, Ohio, a Louis Sullivan jewel box bank built in 1914. It’s currently owned by the <a href="https://explorelc.squarespace.com/louis-sullivan">Licking County Foundation</a> (oh, grow up), which restored it at considerable cost over several years and reopened it to the public last fall.</p>
<p><img alt="South and east façades" class="ss" src="https://leancrew.com/all-this/images2026/20260701-South%20and%20east%20facades.jpg" title="South and east façades" width="100%"/></p>
<p>As you can see from the photo above, the Old Home differs from the other jewel box banks in that its exterior is clad entirely in terra cotta—it’s not mostly brick with terra cotta accents. But the accents still manage to stand out.</p>
<p><img alt="Detail of east façade" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Detail%20of%20east%20facade.jpg" title="Detail of east façade" width="100%"/></p>
<p><img alt="South façade banner detail" class="ss" src="https://leancrew.com/all-this/images2026/20260701-South%20facade%20banner%20detail.jpg" title="South façade banner detail" width="100%"/></p>
<p><img alt="Southwest lower detail" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Southwest%20lower%20detail.jpg" title="Southwest lower detail" width="100%"/></p>
<p><img alt="Southwest upper corner detail" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Southwest%20upper%20corner%20detail.jpg" title="Southwest upper corner detail" width="80%"/></p>
<p>Let’s not forget the lions, which we’ve seen before. Like the <a href="https://leancrew.com/all-this/2026/06/ohio-jewel-box-bank-1/">Sidney</a> and <a href="https://leancrew.com/all-this/2025/09/iowa-jewel-box-bank-2/">Grinnell</a> banks, this one has a protective lion with wings and a shield.</p>
<p><img alt="Lion on south side" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Lion%20on%20south%20side.jpg" title="Lion on south side" width="80%"/></p>
<p>And like the <a href="https://leancrew.com/all-this/2026/06/ohio-jewel-box-bank-1/">Sidney</a> bank, it has a couple of lion heads with pipes in their mouths to drain rainwater.</p>
<p><img alt="Lion head drain" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Lion%20head%20drain.jpg" title="Lion head drain" width="80%"/></p>
<p>The pipes could be a little more subtle.</p>
<p>This is a pretty small building, so when you walk in the door on the east side, you’re put in a fairly narrow space.</p>
<p><img alt="Looking west from the doorway" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Looking%20west%20from%20the%20doorway.jpg" title="Looking west from the doorway" width="80%"/></p>
<p>Not as narrow as it used to be for visitors to the bank. Near the entrance is this photo from the early days, showing how the teller areas took up the northern half of the space:</p>
<p><img alt="Early photo of interior" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Early%20photo%20of%20interior.jpg" title="Early photo of interior" width="80%"/></p>
<p>The serpentine flooring that runs east-west along the south half of the building is original, which you can see if you compare the vein patterns in my photo and the old one.</p>
<p>The stenciling on the ceiling and walls is mostly original, as evidenced by the discoloration and missing paint in some areas.</p>
<p><img alt="Ceiling stencils and lighting" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Ceiling%20stencils%20and%20lighting.jpg" title="Ceiling stencils and lighting" width="80%"/></p>
<p><img alt="North wall stencils" class="ss" src="https://leancrew.com/all-this/images2026/20260701-North%20wall%20stencils.jpg" title="North wall stencils" width="100%"/></p>
<p>The colored window panels on the south wall are original, as are the mechanisms that used to open them. The panels don’t open now because we have air conditioning, and it’s better to keep them sealed.</p>
<p><img alt="South windows" class="ss" src="https://leancrew.com/all-this/images2026/20260701-South%20windows.jpg" title="South windows" width="100%"/></p>
<p>The benches and check-writing desks along the south wall are original and were found in the building’s basement.</p>
<p><img alt="Bench and check-writing desk" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Bench%20and%20check-writing%20desk.jpg" title="Bench and check-writing desk" width="100%"/></p>
<p>I find the detail on the post highly reminiscent of Frank Lloyd Wright:</p>
<p><img alt="Detail from check-writing desk" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Detail%20from%20check-writing%20desk.jpg" title="Detail from check-writing desk" width="100%"/></p>
<p>Wright worked for Sullivan early in his career but had been gone for over twenty years by the time the Old Home was designed. I don’t know if this was a typical Sullivan detail or whether he was being influenced by his former apprentice.</p>
<p>The basement currently has a handful of old building artifacts: pieces of broken terra cotta, original lighting fixtures, doorknobs, alarm bells, teller cage grills, and safe deposit boxes.</p>
<p><img alt="Artifacts 1" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Artifacts%201.jpg" title="Artifacts 1" width="100%"/></p>
<p><img alt="Artifacts 2" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Artifacts%202.jpg" title="Artifacts 2" width="80%"/></p>
<p><img alt="Artifacts 3" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Artifacts%203.jpg" title="Artifacts 3" width="100%"/></p>
<p>There’s also an odd panel with wiring (at the bottom of the second photo) that looks a lot like a printed circuit board.</p>
<p>Finally, in the Foundation’s office space on the second floor is this gorgeous Sullivan drawing of the building’s south elevation:</p>
<p><img alt="South elevation drawing" class="ss" src="https://leancrew.com/all-this/images2026/20260701-South%20elevation%20drawing.jpg" title="South elevation drawing" width="100%"/></p>
<p>Fun fact: the original boiler room was just outside the footprint of the building, under the sidewalk that ran along the east side. Second fun fact: the locker doors shown in the Women’s Room at the west end of the basement are still in the basement but currently decorating a wall.</p>
<p><img alt="Locker doors mounted on wall" class="ss" src="https://leancrew.com/all-this/images2026/20260701-Locker%20doors%20mounted%20on%20wall.jpg" title="Locker doors mounted on wall" width="100%"/></p>
<p>The building’s drawings are at the <a href="https://www.artic.edu/research-center/discover-our-collections/library">Ryerson and Burnham Library</a> at the Art Institute. They’re <a href="https://artic.contentdm.oclc.org/digital/collection/mqc/id/64883/rec/149">digitized</a> and available to download, but at a pretty low resolution. Too bad.</p>]]>
</content:encoded>
</item>

<item>
<title>Ohio jewel box bank 1</title>
<link>https://leancrew.com/all-this/2026/06/ohio-jewel-box-bank-1/</link>
<pubDate>Tue, 30 Jun 2026 02:42:51 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/06/ohio-jewel-box-bank-1/</guid>
<description>
  <![CDATA[Last year, around Labor Day, I visited five of <a href="https://scholarworks.uni.edu/sullivanjewel_images/">Louis Sullivan’s jewel box banks</a>:]]>
</description>
<content:encoded>
  <![CDATA[<p>Last year, around Labor Day, I visited five of <a href="https://scholarworks.uni.edu/sullivanjewel_images/">Louis Sullivan’s jewel box banks</a>:</p>
<ul>
<li><a href="https://leancrew.com/all-this/2025/08/wisconsin-jewel-box-bank/">Farmers and Merchants Union Bank</a> in Columbus, Wisconsin</li>
<li><a href="https://leancrew.com/all-this/2025/08/minnesota-jewel-box-bank/">National Farmers’ Bank</a> in Owatonna, Minnesota</li>
<li><a href="https://leancrew.com/all-this/2025/09/iowa-jewel-box-bank-1/">Henry Adams Building</a> in Algona, Iowa</li>
<li><a href="https://leancrew.com/all-this/2025/09/iowa-jewel-box-bank-2/">Merchant’s National Bank</a> in Grinnell, Iowa</li>
<li><a href="https://leancrew.com/all-this/2025/09/iowa-jewel-box-bank-3/">People’s Savings Bank</a> in Cedar Rapids, Iowa</li>
</ul>
<p>These all fit in with a little driving circuit that included visiting my daughter and my younger son. This year, I headed east to pick up the last three.</p>
<p>This morning’s bank was the <a href="https://en.wikipedia.org/wiki/People%27s_Federal_Savings_and_Loan_Association">People’s Federal Savings and Loan Association</a> in Sidney, Ohio. Despite what that Wikipedia page says, it’s now operated by <a href="https://www.fm.bank/">F&amp;M Bank</a>, which bought out People’s in 2022. You can sort of tell by the large but tasteful “F&amp;M Bank” lettering on the front (north) façade.</p>
<p><img alt="North facade" class="ss" src="https://leancrew.com/all-this/images2026/20260629-North%20facade.jpg" title="North facade" width="100%"/></p>
<p>F&amp;M could have used a font in which their <em>F</em> was a better match to the <em>F</em> in the original THRIFT lettering, but you can’t expect bank executives to notice things like that. At least they didn’t go with the sans serif font they use in their logo. The horizontal line of slightly damaged bricks is where the old name of the bank used to be.</p>
<p>The bank was built in 1917, which puts it second to last in the sequence, younger than all the other jewel boxes except the <a href="https://leancrew.com/all-this/2025/08/wisconsin-jewel-box-bank/">Farmers and Merchants Bank</a>. The date of construction is prominent on the west façade.</p>
<p><img alt="West facade" class="ss" src="https://leancrew.com/all-this/images2026/20260629-West%20facade.jpg" title="West facade" width="100%"/></p>
<p>You’ll probably need to zoom in to see the date; it’s not only small, but I was shooting into the sun, so the contrast isn’t great. The 1886 date you see at the left end is when People’s Federal Savings and Loan was founded.</p>
<p>While we’re on the west side, let’s check out some of the details.</p>
<p><img alt="West window details" class="ss" src="https://leancrew.com/all-this/images2026/20260629-West%20window%20details.jpg" title="West window details" width="80%"/></p>
<p><img alt="West end decoration" class="ss" src="https://leancrew.com/all-this/images2026/20260629-West%20end%20decoration.jpg" title="West end decoration" width="100%"/></p>
<p><img alt="Block above west window" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Block%20above%20west%20window.jpg" title="Block above west window" width="100%"/></p>
<p><img alt="Southwest corner lion" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Southwest%20corner%20lion.jpg" title="Southwest corner lion" width="80%"/></p>
<p>The lion with the shield on top of a pilaster is at the southwest corner of the building, off the right edge of my west façade photo. You may recognize him—he’s basically the same as the entranceway lions at the <a href="https://leancrew.com/all-this/2025/09/iowa-jewel-box-bank-2/">Merchant’s National Bank</a>.</p>
<p>Each of the lion heads that appear along the bottom of the windows has a copper pipe in its open mouth. Clearly this is to drain rainwater that collects on the sills, although I don’t know if the pipes are still working. Sullivan undoubtedly considered this a “form follows function” thing.</p>
<p>Most of the decorative elements on this building are organic, but there are geometric features along the cornice at the top of the building and around the arch on the north façade.</p>
<p><img alt="North top center" class="ss" src="https://leancrew.com/all-this/images2026/20260629-North%20top%20center.jpg" title="North top center" width="100%"/></p>
<p>Sullivan “signed” this building in the architrave above the entrance. Not just in the little LOUIS SULLIVAN ARCHITECT in the lower left corner, but in the big stylized LSA at the center of the piece.</p>
<p><img alt="Entranceway" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Entranceway.jpg" title="Entranceway" width="100%"/></p>
<p>Just inside the entrance is the landmark designation plaque.</p>
<p><img alt="Landmark plaque" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Landmark%20plaque.jpg" title="Landmark plaque" width="100%"/></p>
<p>After seeing the lovely exterior, I have to say I was a little disappointed when I went through the foyer into the interior. It’s nice enough, but I was ready to be hit by something like the interior of the <a href="https://leancrew.com/all-this/2025/08/minnesota-jewel-box-bank/">National Farmers’ Bank</a>. No such luck. The lines are clean, there’s a good view of the west windows, and there’s a gorgeous skylight running down the center of the ceiling, but no murals or hanging lights.</p>
<p><img alt="Interior looking south" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Interior%20looking%20south.jpg" title="Interior looking south" width="80%"/></p>
<p><img alt="West windows interior" class="ss" src="https://leancrew.com/all-this/images2026/20260629-West%20windows%20interior.jpg" title="West windows interior" width="100%"/></p>
<p><img alt="Skylight" class="ss" src="https://leancrew.com/all-this/images2026/20260629-Skylight.jpg" title="Skylight" width="80%"/></p>
<p>One of the tellers told me there used to be stencils of some sort running along the tops of the walls, but they were painted over. An odd decision, given how well the rest of the building has been preserved, but maybe they couldn’t be saved—or weren’t original.</p>
<p>Another small disappointment was the lack of documentation. Other banks had small shrines to their buildings, with displays of drawings, old photographs, or even pieces of original terra cotta and brickwork. F&amp;M had a little pamphlet and a visitors’ signature book, but that was it.</p>
<p>I don’t want to be too hard on this bank. It really is beautiful and in great shape. I guess my expectations for the interior were just too high after walking around and photographing the north and west façades. F&amp;M can’t be blamed if the previous owner didn’t keep the original drawings. Also, it’s a pretty small space—no second floor or mezzanine for a shrine.</p>]]>
</content:encoded>
</item>

<item>
<title>Classic</title>
<link>https://leancrew.com/all-this/2026/06/Classic/</link>
<pubDate>Wed, 24 Jun 2026 22:52:10 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/06/Classic/</guid>
<description>
  <![CDATA[<a href="https://relay.fm/upgrade/624">This week’s episode of <em>Upgrade</em></a> (which I listened to on a longish drive yesterday) has a preview of Jason Snell and Myke Hurley’s upcoming <a href="https://www.kickstarter.com/projects/designedincalifornia/designed-in-california-an-apple-history-podcast"><em>Designed in California</em> podcast</a>. No, not the “Road to the Apple II” series they’ve been squeezing into the <em>Upgrade</em> feed these past few weeks. This sneak preview—with special guest John Siracusa—is about the state of the classic Mac OS in the late 90s.]]>
</description>
<content:encoded>
  <![CDATA[<p><a href="https://relay.fm/upgrade/624">This week’s episode of <em>Upgrade</em></a> (which I listened to on a longish drive yesterday) has a preview of Jason Snell and Myke Hurley’s upcoming <a href="https://www.kickstarter.com/projects/designedincalifornia/designed-in-california-an-apple-history-podcast"><em>Designed in California</em> podcast</a>. No, not the “Road to the Apple II” series they’ve been squeezing into the <em>Upgrade</em> feed these past few weeks. This sneak preview—with special guest John Siracusa—is about the state of the classic Mac OS in the late 90s.</p>
<p>In a word, the state was sorry. This was largely due to some expedient decisions made in the early 80s that were necessary to get the Mac out the door. Unfortunately, those decisions made the Mac a less and less stable computing environment as the years went on.</p>
<p>The instability had to do with memory and multitasking. Jason and John cover it well in the podcast, so there’s no need for me to get into it. I will say, though, that if you listen to the podcast and think Jason is exaggerating when he says that he would often have to reboot his Mac a dozen or so times per day, I can assure you that’s no exaggeration. The frustration of using a Mac back then was the reason I abandoned it for Linux at the end of 1996.</p>
<p>The problem with the Mac was that it had a great user interface for multitasking but a lousy infrastructure. In the mid-80s, the lousy infrastructure didn’t matter so much because computer users were used to doing one thing at a time, which the Mac handled well. But the windowing OS, the consistency of Mac applications, and the multitasking tease of desk accessories slowly got users hungry to run many apps simultaneously and switch between them at will. The infrastructure couldn’t handle that.</p>
<p>I want to emphasize how important the consistency was. For example, all Mac apps had cut, copy, and paste, and those commands were always in the Edit menu and they always had the ⌘X, ⌘C, and ⌘V keyboard shortcuts.<sup id="fnref:early"><a href="#fn:early" rel="footnote">1</a></sup> Similarly for Save and ⌘S. DOS programs—and before Windows 95, most PC users were running DOS—didn’t have that consistency. I remember reading back in ’85 or ’86 that Mac users tended to regularly use many more applications than PC users. There were lots of PC users, especially in the workplace, who basically used one program; their computers were configured to boot into WordPerfect or Lotus 1-2-3, and that would be the only program they used until they turned off their machine at the end of the day.</p>
<p>Mac users weren’t like that. Because the Mac had a consistent language, users felt comfortable taking on new apps. They didn’t have to start at ground zero to learn a new set of commands. And when you’re comfortable using three, four, or more programs, you want them all running and available at a moment’s notice. <a href="https://en.wikipedia.org/wiki/MultiFinder">MultiFinder</a>, incorporated into the Finder itself in System 7, offered you the promise of being able to do that, but the underlying deficiencies of the OS reneged on that promise. Classic Mac OS was Lucy and you were Charlie Brown.</p>
<p><img alt="Lucy and Charlie Brown" class="ss" src="https://leancrew.com/all-this/images2026/20260624-Lucy%20and%20Charlie%20Brown.jpg" title="Lucy and Charlie Brown" width="100%"/></p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:early">
<p>OK, in the <em>very</em> early days, not every app had keyboard shortcuts for Cut, Copy, and Paste, but that didn’t last long. <a href="#fnref:early" rev="footnote">↩</a></p>
</li>
</ol>
</div>]]>
</content:encoded>
</item>

<item>
<title>Short memories</title>
<link>https://leancrew.com/all-this/2026/06/short-memories/</link>
<pubDate>Fri, 19 Jun 2026 17:46:18 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/06/short-memories/</guid>
<description>
  <![CDATA[I’ve been thinking about 1984 lately—the year, not the novel. What got me thinking about it was the reduction in <a href="https://www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=pet&amp;s=emm_epm0_pte_nus_dpg&amp;f=w">gas prices</a> over the past few weeks,]]>
</description>
<content:encoded>
  <![CDATA[<p>I’ve been thinking about 1984 lately—the year, not the novel. What got me thinking about it was the reduction in <a href="https://www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=pet&amp;s=emm_epm0_pte_nus_dpg&amp;f=w">gas prices</a> over the past few weeks,</p>
<p><img alt="Gasoline prices" class="ss" src="https://leancrew.com/all-this/images2026/20260619-Gasoline%20prices.png" title="Gasoline prices" width="100%"/></p>
<p>and <a href="https://www.nytimes.com/2026/06/13/us/politics/trump-white-working-class-voters-economy.html?searchResultPosition=1">this article</a> in the <em>New York Times</em> about Donald Trump’s declining poll numbers among white working-class voters and how that might affect November’s elections.<sup id="fnref:access"><a href="#fn:access" rel="footnote">1</a></sup></p>
<p>Forgive me for not being especially optimistic, but one of my distinct memories from 1984 makes me think the polls are lagging.</p>
<p>A news story on one of the networks back in 1984 included short interviews with prospective voters. One of the voters was a young white man (he was about my age at the time) who said he was voting for Ronald Reagan. When asked why, he said “He got me my job back.”</p>
<p>Of course, the man had been laid off early in the Reagan administration,<sup id="fnref:recession"><a href="#fn:recession" rel="footnote">2</a></sup> but that didn’t enter into his reasoning. The only thing that mattered was that he was working again. It was my introduction to the short memories of American voters.</p>
<p><img alt="Dali's The Persistence of Memory" class="ss" src="https://leancrew.com/all-this/images2026/20260619-The%20Persistence%20of%20Memory.jpg" title="Dali's The Persistence of Memory" width="100%"/></p>
<p class="caption">via <a href="https://www.moma.org/collection/works/79018">MoMA</a></p>
<p>I can’t help but think we’ll see the same thing this November. As long as the price of gas—like the unemployment rate in 1984—keeps going down, it won’t matter whether it gets back to where it had been or who caused it to go up in the first place. White working-class voters (especially men) will credit Trump with bringing gas prices down and vote Republican again, regardless of what they told pollsters recently. Only another major fuckup close to the election will get them to vote blue or just stay home in large numbers.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:access">
<p>If, like me, you don’t have a subscription to the <em>Times</em>, see if your local library gives you access to it. Mine does. <a href="#fnref:access" rev="footnote">↩</a></p>
</li>
<li id="fn:recession">
<p>Constant Republican propaganda has people thinking the Reagan years were all about prosperity, but the recession early in his first term was the worst economic downturn since the Great Depression, a distinction it held until 2008. <a href="#fnref:recession" rev="footnote">↩</a></p>
</li>
</ol>
</div>]]>
</content:encoded>
</item>

<item>
<title>World Cup combinatorics again</title>
<link>https://leancrew.com/all-this/2026/06/world-cup-combinatorics-again/</link>
<pubDate>Wed, 17 Jun 2026 03:12:47 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/06/world-cup-combinatorics-again/</guid>
<description>
  <![CDATA[At the end of yesterday’s post about <a href="https://leancrew.com/all-this/2026/06/world-cup-combinatorics/">the combinatorics of the World Cup group stage</a>, I said “this is good enough for me.” Turns out that was a lie. Today I rewrote some of the code to come up with a slightly more detailed result.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/06/world-cup-combinatorics-again/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>At the end of yesterday’s post about <a href="https://leancrew.com/all-this/2026/06/world-cup-combinatorics/">the combinatorics of the World Cup group stage</a>, I said “this is good enough for me.” Turns out that was a lie. Today I rewrote some of the code to come up with a slightly more detailed result.</p>
<p>The last bit of work in that post was to generate the 40 unique point totals that can come from a group. These are the possible totals, with no regard for which team gets which total:</p>
<pre><code>9 6 3 0     7 6 3 1     7 3 2 2     5 5 3 2
9 6 1 1     7 6 2 1     6 6 6 0     5 5 3 1
9 4 4 0     7 5 4 0     6 6 4 1     5 5 2 2
9 4 3 1     7 5 3 1     6 6 3 3     5 4 4 3
9 4 2 1     7 5 2 1     6 5 4 1     5 4 4 2
9 3 3 3     7 4 4 1     6 5 2 2     5 4 3 2
9 2 2 2     7 4 3 3     6 4 4 3     5 3 3 2
7 7 3 0     7 4 3 2     6 4 4 2     4 4 4 4
7 7 1 1     7 4 3 1     5 5 5 0     4 4 4 3
7 6 4 0     7 4 2 2     5 5 4 1     3 3 3 3
</code></pre>
<p>As discussed early in yesterday’s post, there are <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msup><mn>3</mn><mn>6</mn></msup><mo>=</mo><mn>729</mn></mrow></math> ways the six games of a group can turn out, so today’s script associates each of the above totals with the game results that add up to that total. I built a dictionary in which the keys are the totals shown above—expressed as tuples, like <code>(7, 7, 1, 1)</code>—and the values are lists of lists of game result lists, like</p>
<pre><code>[[[3, 0, 0, 0],
  [3, 0, 0, 0],
  [1, 0, 0, 1],
  [0, 1, 1, 0],
  [0, 0, 0, 3],
  [0, 0, 0, 3]],
 [[3, 0, 0, 0],
  [1, 0, 1, 0],
  [3, 0, 0, 0],
  [0, 0, 3, 0],
  [0, 1, 0, 1],
  [0, 0, 3, 0]],
 [[0, 3, 0, 0],
  [0, 0, 3, 0],
  [1, 0, 0, 1],
  [0, 1, 1, 0],
  [0, 3, 0, 0],
  [0, 0, 3, 0]],
 [[0, 3, 0, 0],
  [1, 0, 1, 0],
  [0, 0, 0, 3],
  [0, 3, 0, 0],
  [0, 1, 0, 1],
  [0, 0, 0, 3]],
 [[1, 1, 0, 0],
  [3, 0, 0, 0],
  [3, 0, 0, 0],
  [0, 3, 0, 0],
  [0, 3, 0, 0],
  [0, 0, 1, 1]],
 [[1, 1, 0, 0],
  [0, 0, 3, 0],
  [0, 0, 0, 3],
  [0, 0, 3, 0],
  [0, 0, 0, 3],
  [0, 0, 1, 1]]]
</code></pre>
<p>The innermost lists in this output are the points accumulated in a single game. For example, <code>[1, 1, 0, 0]</code> represents a game in which the first two teams in the group played to a draw. So the above result tells us that there are six ways the six games in a group can lead to a <code>(7, 7, 1, 1)</code> table at the end of the stage.</p>
<p>Here’s the Python code that built the dictionary and printed out a summary of the results:</p>
<pre><code>python:
 1:  #!/usr/bin/env python3
 2:  
 3:  from itertools import product
 4:  from collections import defaultdict
 5:  import numpy as np
 6:  
 7:  # Possible point distributions from each game.
 8:  game1 = [[3, 0, 0, 0], [0, 3, 0, 0], [1, 1, 0, 0]]
 9:  game2 = [[3, 0, 0, 0], [0, 0, 3, 0], [1, 0, 1, 0]]
10:  game3 = [[3, 0, 0, 0], [0, 0, 0, 3], [1, 0, 0, 1]]
11:  game4 = [[0, 3, 0, 0], [0, 0, 3, 0], [0, 1, 1, 0]]
12:  game5 = [[0, 3, 0, 0], [0, 0, 0, 3], [0, 1, 0, 1]]
13:  game6 = [[0, 0, 3, 0], [0, 0, 0, 3], [0, 0, 1, 1]]
14:  
15:  # Enumerate all possible six-game results, and put them in a dictionary.
16:  # The keys are the sorted point totals and the values are the list of
17:  # game results.
18:  games = defaultdict(list)
19:  results = np.array(list(product(game1, game2, game3, game4, game5, game6)))
20:  for r in results:
21:    points = tuple(sorted(r.sum(axis=0).tolist(), reverse=True))
22:    games[points].append(r.tolist())
23:  
24:  # Show how many game results lead to each tuple of sorted point totals.
25:  count = 0
26:  p = sorted(games.keys(), reverse=True)
27:  for k in p:
28:    count += len(games[k])
29:    print(f'({" ".join(str(p) for p in k)}): {len(games[k]):3d}')
30:  print(f'    Total: {count:3d}')
</code></pre>
<p>The output is</p>
<pre><code>(9 6 3 0):  24
(9 6 1 1):  12
(9 4 4 0):  12
(9 4 3 1):  24
(9 4 2 1):  24
(9 3 3 3):   8
(9 2 2 2):   4
(7 7 3 0):  12
(7 7 1 1):   6
(7 6 4 0):  24
(7 6 3 1):  24
(7 6 2 1):  24
(7 5 4 0):  24
(7 5 3 1):  24
(7 5 2 1):  24
(7 4 4 1):  36
(7 4 3 3):  24
(7 4 3 2):  24
(7 4 3 1):  24
(7 4 2 2):  24
(7 3 2 2):  12
(6 6 6 0):   8
(6 6 4 1):  24
(6 6 3 3):  24
(6 5 4 1):  24
(6 5 2 2):  12
(6 4 4 3):  36
(6 4 4 2):  24
(5 5 5 0):   4
(5 5 4 1):  24
(5 5 3 2):  12
(5 5 3 1):  12
(5 5 2 2):  12
(5 4 4 3):  24
(5 4 4 2):  24
(5 4 3 2):  24
(5 3 3 2):  12
(4 4 4 4):   6
(4 4 4 3):   8
(3 3 3 3):   1
    Total: 729
</code></pre>
<p>where the numbers after the colons are the number of ways the games can go to result in the given totals. There is, for example, only one way to get <code>(3, 3, 3, 3)</code>, which is for every game to end in a draw.</p>
<p>The code is not clever in any way. I build the <code>games</code> dictionary (actually a <a href="https://docs.python.org/3/library/collections.html#collections.defaultdict"><code>defaultdict</code></a>) one step at a time via the loop in Lines 20–22. As with yesterday’s script, I generate all the 729 game results using the <a href="https://docs.python.org/3.13/library/itertools.html#itertools.product"><code>product</code> function</a> from the <code>itertools</code> library and use NumPy’s <a href="https://numpy.org/doc/stable/reference/generated/numpy.sum.html"><code>sum</code> function</a> to add up the points from each of those results. The output comes from Lines 25–30.</p>
<p>If I run this script in an interactive environment, like <a href="https://ipython.readthedocs.io/en/stable/">IPython</a> or <a href="https://jupyter-console.readthedocs.io/en/latest/">Jupyter</a>, I can pull out the games that lead to any set of points. I think the <code>(5, 4, 3, 2)</code> total is fun because it’s the only straight among the 40 possibilities. After some reformatting, here’s what <code>games[(5, 4, 3, 2)]</code> returns:</p>
<pre><code>(3 0 0 0) (0 0 3 0) (1 0 0 1) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(3 0 0 0) (1 0 1 0) (0 0 0 3) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(3 0 0 0) (1 0 1 0) (1 0 0 1) (0 3 0 0) (0 1 0 1) (0 0 1 1) 
(3 0 0 0) (1 0 1 0) (1 0 0 1) (0 1 1 0) (0 3 0 0) (0 0 1 1) 
(0 3 0 0) (3 0 0 0) (1 0 0 1) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(0 3 0 0) (1 0 1 0) (3 0 0 0) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(0 3 0 0) (1 0 1 0) (1 0 0 1) (0 0 3 0) (0 1 0 1) (0 0 1 1) 
(0 3 0 0) (1 0 1 0) (1 0 0 1) (0 1 1 0) (0 0 0 3) (0 0 1 1) 
(1 1 0 0) (3 0 0 0) (0 0 0 3) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(1 1 0 0) (3 0 0 0) (1 0 0 1) (0 0 3 0) (0 1 0 1) (0 0 1 1) 
(1 1 0 0) (3 0 0 0) (1 0 0 1) (0 1 1 0) (0 1 0 1) (0 0 3 0) 
(1 1 0 0) (0 0 3 0) (3 0 0 0) (0 1 1 0) (0 1 0 1) (0 0 1 1) 
(1 1 0 0) (0 0 3 0) (1 0 0 1) (0 3 0 0) (0 1 0 1) (0 0 1 1) 
(1 1 0 0) (0 0 3 0) (1 0 0 1) (0 1 1 0) (0 1 0 1) (0 0 0 3) 
(1 1 0 0) (1 0 1 0) (3 0 0 0) (0 1 1 0) (0 0 0 3) (0 0 1 1) 
(1 1 0 0) (1 0 1 0) (3 0 0 0) (0 1 1 0) (0 1 0 1) (0 0 0 3) 
(1 1 0 0) (1 0 1 0) (0 0 0 3) (0 1 1 0) (0 3 0 0) (0 0 1 1) 
(1 1 0 0) (1 0 1 0) (0 0 0 3) (0 1 1 0) (0 1 0 1) (0 0 3 0) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 3 0 0) (0 0 0 3) (0 0 1 1) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 3 0 0) (0 1 0 1) (0 0 3 0) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 0 3 0) (0 3 0 0) (0 0 1 1) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 0 3 0) (0 1 0 1) (0 0 0 3) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 1 1 0) (0 3 0 0) (0 0 0 3) 
(1 1 0 0) (1 0 1 0) (1 0 0 1) (0 1 1 0) (0 0 0 3) (0 0 3 0) 
</code></pre>
<p>Notice that in every set of six games (i.e., each row), there are two games that end in a win and four that end in a draw. The team with five points has a win and two draws; the team with four points has a win, a draw, and a loss; the team with three points has three draws; and the team with two points has two draws and a loss.</p>
<p>OK, <em>now</em> I’m done.</p>
  ]]>
</content:encoded>
</item>

<item>
<title>World Cup combinatorics</title>
<link>https://leancrew.com/all-this/2026/06/world-cup-combinatorics/</link>
<pubDate>Tue, 16 Jun 2026 01:54:48 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/06/world-cup-combinatorics/</guid>
<description>
  <![CDATA[We’re in the middle of the first set of games in the group stage of the <a href="https://www.fifa.com/en/tournaments/mens/worldcup/canadamexicousa2026/scores-fixtures?country=US&amp;wtw-filter=ALL">2026 World Cup</a>, and I’ve been thinking about how many ways the points can be distributed among the teams in a given group. I used Python to help with the enumeration.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/06/world-cup-combinatorics/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>We’re in the middle of the first set of games in the group stage of the <a href="https://www.fifa.com/en/tournaments/mens/worldcup/canadamexicousa2026/scores-fixtures?country=US&amp;wtw-filter=ALL">2026 World Cup</a>, and I’ve been thinking about how many ways the points can be distributed among the teams in a given group. I used Python to help with the enumeration.</p>
<p>Here’s a quick summary of how the group stage works: The teams are split into groups of four. Within each group, all the teams play each other once. A team gets three points for a win and one point for a draw in each of the three games it plays. The teams are ranked by their point totals within their group when this stage is over.<sup id="fnref:advances"><a href="#fn:advances" rel="footnote">1</a></sup></p>
<p>Six games are played in each group. You can calculate that number in several ways, but it’s easy enough to just list them all. Let’s say the teams in our group are Alpha, Beta, Gamma, and Delta. Then the six games are:</p>
<pre><code>Alpha vs. Beta
Alpha vs. Gamma     Beta vs. Gamma
Alpha vs. Delta     Beta vs. Delta     Gamma vs. Delta
</code></pre>
<p>Since there are three possible outcomes in each game (W–L, L–W, and D–D), there are</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msup><mn>3</mn><mn>6</mn></msup><mo>=</mo><mn>729</mn></mrow></math>
<p>possible results for the six games of the group stage.</p>
<p>We can get the point distribution among the teams for each of these possible results with this bit of Python code:</p>
<pre><code>python:
 1:  #!/usr/bin/env python3
 2:  
 3:  from itertools import product
 4:  import numpy as np
 5:  
 6:  # Possible point distributions from each game.
 7:  game1 = [[3, 0, 0, 0], [0, 3, 0, 0], [1, 1, 0, 0]]
 8:  game2 = [[3, 0, 0, 0], [0, 0, 3, 0], [1, 0, 1, 0]]
 9:  game3 = [[3, 0, 0, 0], [0, 0, 0, 3], [1, 0, 0, 1]]
10:  game4 = [[0, 3, 0, 0], [0, 0, 3, 0], [0, 1, 1, 0]]
11:  game5 = [[0, 3, 0, 0], [0, 0, 0, 3], [0, 1, 0, 1]]
12:  game6 = [[0, 0, 3, 0], [0, 0, 0, 3], [0, 0, 1, 1]]
13:  
14:  # Enumerate all possible six-game results, add up the points, and sort.
15:  games = np.array(list(product(game1, game2, game3, game4, game5, game6)))
16:  points = games.sum(axis=1)
17:  points = points.tolist()
18:  points.sort(reverse=True)
19:  print(f'Number of point arrangements: {len(points)}')
</code></pre>
<p>The output is</p>
<pre><code>Number of point arrangements: 729
</code></pre>
<p>which matches our calculation above.</p>
<p>Lines 7–12 give the three possible point allocations for each of the games, where the inner lists are the points given to Alpha, Beta, Gamma, and Delta—in that order. Line 15 uses the <a href="https://docs.python.org/3.13/library/itertools.html#itertools.product"><code>product</code> function</a> from the <code>itertools</code> library to build all 729 outcomes. It turns them into a NumPy array because I wanted to use the <a href="https://numpy.org/doc/stable/reference/generated/numpy.sum.html"><code>sum</code> function</a> (Line 16) to add up the points from each game without any laborious looping. After this step, <code>points</code> is a 729×4 NumPy array.</p>
<p>Line 17 then turns <code>points</code> into a list of lists, and Line 18 sorts the 729 entries. It looks like this:</p>
<pre><code>[[9, 6, 3, 0],
 [9, 6, 1, 1],
 [9, 6, 0, 3],
 [9, 4, 4, 0],
 [9, 4, 3, 1],
    .
    .
    .
 [0, 4, 5, 7],
 [0, 4, 4, 9],
 [0, 3, 9, 6],
 [0, 3, 7, 7],
 [0, 3, 6, 9]]
</code></pre>
<p>There are repeats among these results. For example, there are two ways to get the result</p>
<pre><code>[5, 5, 4, 1]
</code></pre>
<p>This set of points can come from either</p>
<pre><code>Alpha draws Beta       [1, 1, 0, 0]
Alpha beats Gamma      [3, 0, 0, 0]
Alpha draws Delta      [1, 0, 0, 1]
Beta draws Gamma       [0, 1, 1, 0]
Beta beats Delta       [0, 3, 0, 0]
Gamma beats Delta      [0, 0, 3, 0]
</code></pre>
<p>or</p>
<pre><code>Alpha draws Beta       [1, 1, 0, 0]
Alpha draws Gamma      [1, 0, 1, 0]
Alpha beats Delta      [3, 0, 0, 0]
Beta beats Gamma       [0, 3, 0, 0]
Beta draws Delta       [0, 1, 0, 1]
Gamma beats Delta      [0, 0, 3, 0]
</code></pre>
<p>Sum down the columns to prove to yourself that this yields point totals of</p>
<pre><code>[5, 5, 4, 1]
</code></pre>
<p>OK, so how many unique point total results can there be? To answer this, I added the following code:</p>
<pre><code>python:
21:  # Unique points, team-by-team.
22:  unique_team_points = [ list(q) for q in set(tuple(p) for p in points) ]
23:  unique_team_points.sort(reverse=True)
24:  print(f'Number of unique point arrangements: {len(unique_team_points)}')
</code></pre>
<p>which output</p>
<pre><code>Number of unique point arrangements: 556
</code></pre>
<p>Unlike the 729 results we got earlier, I have no formula for calculating this number, and I have no interest in trying to come up with one. This is one of those situations where brute force programming is the best use of my time.</p>
<p>Line 22 uses the common Python trick of turning a list into a set to eliminate duplicates and then turns the set back into a list. The less-common trick is that it first turns the inner lists into tuples. This is needed because something like</p>
<pre><code>set(points)
</code></pre>
<p>returns this error:</p>
<pre><code>TypeError: cannot use 'list' as a set element (unhashable type: 'list')
</code></pre>
<p>In these 556 results, we kept the teams separated. In other words, we considered results</p>
<pre><code>[9, 6, 3, 0]
[9, 6, 0, 3]
[9, 3, 6, 0]
[9, 3, 0, 6]
[9, 0, 6, 3]
[9, 0, 3, 6]
    etc.
</code></pre>
<p>to be different because the team scores were different. But what if we just wanted to know the possible point combinations without regard to which team got which point total? Again, I have no formula for this, but it was easy to work it out in code:</p>
<pre><code>python:
26:  # Unique points without regard to team.
27:  sorted_points = sorted((sorted(p, reverse=True) for p in points), reverse=True)
28:  unique_points = [ list(q) for q in set(tuple(p) for p in sorted_points) ]
29:  unique_points.sort(reverse=True)
30:  print(f'Number of unique sets of points: {len(unique_points)}')
31:  print()
32:  point_strings = [ f'{p[0]} {p[1]} {p[2]} {p[3]}' for p in unique_points ]
33:  print('\n'.join(point_strings))
</code></pre>
<p>The first line of output is</p>
<pre><code>Number of unique sets of points: 40
</code></pre>
<p>which is quite a reduction. The number is now small enough to show all of them. Reshaping the 40 output lines that follow into four columns of ten gives</p>
<pre><code>9 6 3 0     7 6 3 1     7 3 2 2     5 5 3 2
9 6 1 1     7 6 2 1     6 6 6 0     5 5 3 1
9 4 4 0     7 5 4 0     6 6 4 1     5 5 2 2
9 4 3 1     7 5 3 1     6 6 3 3     5 4 4 3
9 4 2 1     7 5 2 1     6 5 4 1     5 4 4 2
9 3 3 3     7 4 4 1     6 5 2 2     5 4 3 2
9 2 2 2     7 4 3 3     6 4 4 3     5 3 3 2
7 7 3 0     7 4 3 2     6 4 4 2     4 4 4 4
7 7 1 1     7 4 3 1     5 5 5 0     4 4 4 3
7 6 4 0     7 4 2 2     5 5 4 1     3 3 3 3
</code></pre>
<p>These are the point totals for the 40 different ways a group stage can end. The two levels of sorting in Line 27 are the key to bringing the results down from 729.</p>
<p>You can go to <a href="https://www.espn.com/soccer/standings/_/league/FIFA.WORLD/season/2022">ESPN’s World Cup table for 2022</a> to show which of these 40 results occurred that year. There’s a popup menu button on the page that lets you check 2018, 2014, 2010, and 2006, too.</p>
<p>I’m sure serious soccer fans have been digging into the math behind this year’s change from eight groups to twelve. I’m not a serious fan, so this is good enough for me.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:advances">
<p>I won’t be going through the rules of how teams advance to the next stage—they start out simple but can get complicated quickly, especially now that the tournament has expanded. <a href="#fnref:advances" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

</channel>
</rss>

