Instructive anecdote. I needed a somewhat expensive book and the UW library didn’t have it. So I decided to buy it. Had the Amazon order queued up and ready to go, $45 with free shipping, then had a pang of guilt about the destruction of the publishing industry and decided it was worth paying a little extra to order it directly from the publisher (Routledge.)

From the publisher it was $41, with free shipping.

I think it really did used to be true that the Amazon price was basically certain to be the best price. Not anymore. Shop around!

David Brooks writes in the New York Times that we should figure out how to bottle the civic health southwest Nebraska enjoys:

Everybody says rural America is collapsing. But I keep going to places with more moral coherence and social commitment than we have in booming urban areas. These visits prompt the same question: How can we spread the civic mind-set they have in abundance?

For example, I spent this week in Nebraska, in towns like McCook and Grand Island. These places are not rich. At many of the schools, 50 percent of the students receive free or reduced-cost lunch. But they don’t have the pathologies we associate with poverty.

Maybe that’s because those places aren’t high in poverty! The poverty rate in McCook is 9.6%; in Grand Island it’s 15%. The national rate is 12.3%. Here’s a Census page with those numbers. What about the lunches? 50 percent of students receiving free or reduced-price lunch sounds like a lot, unless you know that slightly more than half of all US public school students are eligible for free and reduced-price lunch. (Brooks says “receive,” not “are eligible for,” but it’s the latter statistics that are widely reported and I’m guessing that’s what he means; apologies if I’m wrong.)

Crime is low. Many people leave their homes and cars unlocked.

Is it? And do they? I didn’t immediately find city-level crime data that looked rock solid to me, but if you trust city-data.com, crime in Grand Island roughly tracks national levels while crime in McCook is a little lower. And long-time Grand Island resident Gary Christensen has a different take than Brooks does:

Gary Christensen, a Grand Island resident for over 68 years says times are changing. “It was a community that you could leave you doors open leave the keys in your car and that kind of thing, and nobody ever bothered it. But those days are long gone,” said Gary Christensen, resident.

One way you can respond to this is to say I’m missing the point of Brooks’s article. Isn’t he just saying civic involvement is important and it’s healthy when people feel a sense of community with their neighbors? Are the statistics really that important?

Yes. They’re important. Because what Brooks is really doing here is inviting us to lower ourselves into a warm comfortable stereotype; that where the civic virtues are to be found in full bloom, where people are “just folks,” are in the rural parts of Nebraska, not in New Orleans, or Seattle, or Laredo, or Madison, and most definitely not in Brooklyn or Brookline or Bethesda. But he can’t just say “you know how those people are.” There needs to be some vaguely evidentiary throat-clearing before you launch into what you were going to say anyway.

Which is that Nebraska people are simple dewy real Americans, not like you, urbanized coastal reader of the New York Times. I don’t buy it. McCook, Nebraska sounds nice; but it sounds nice in the same way that urbanized coastal communities are nice. You go someplace and talk to a guy who’s on the city council, you’re gonna be talking to a guy who cares about his community and thinks a lot about how to improve it. Even in Bethesda.

Constantly they are thinking: Does this help my town or hurt it? And when you tell them that this pervasive civic mind-set is an unusual way to be, they look at you blankly because they can’t fathom any other.

There’s Brooks in a nutshell. The only good people are the people who don’t know any better than to be good. By saying so, he condescends to his subjects, his readers, and himself all at once. I don’t buy it. I’ll bet people in southwest Nebraska can fathom a lot more than Brooks thinks they can. I think they probably fathom David Brooks better than he fathoms them.

Madison had a primary election last night for mayor and for several seats on the City Council and School Board. Turnout was high, as it seems to always be in Dane County lately. The Dane County Clerk has all the results in handy csv form, so you can just download things and start having some fun! There were four major candidates for mayor, so each ward in the city can be mapped to a point in R^4 by the vote share it gave to each of those; except of course this is really R^3 because the vote shares sum to 1. It’s easier to see R^2 than R^3 so you can use PCA to project yourself down to a nice map of wards:

This works pretty well! The main axis of variation (horizontal here) is Soglin vote, which is higher on the left and lower on the right; this vector is negatively weighted on Rhodes-Conway and Shukla but doesn’t pay much attention to Cheeks. The vertical axis mostly ignores Shukla and represents Cheeks taking votes from Rhodes-Conway at the top, and losing votes to Rhodes-Conway at the bottom. You can see a nice cluster of Isthmus and Near West wards in the lower right; Rhodes-Conway did really well there. 57 and 48 are off by themselves in the upper right corner; those are student wards, distinguished in the vote count by Grumpy Old Incumbent Paul Soglin getting next to no votes. And I mean “next to no” in the literal sense; he got one vote in each of those wards!

You can also do some off-the-shelf k-means clustering of those vectors in R^4 and you get meaningful results there. Essentially arbitrarily I broke the wards into 5 clusters and got:

Now what would be interesting is to go back and compare this with the ward-by-ward results of the gubernatorial primary last August! But I have other stuff to do today. Here’s some code so I remember it; this stuff is all simple and I have made no attempt to make the analysis robust.

Update: I did the comparison with the August primary; interestingly, I didn’t see very many strong relationships. Soglin-for-mayor wards were typically also Soglin-for-governor wards. Wards that were strong for Kelda Helen Roys were also strong for Raj Shukla and weak for Soglin, but there wasn’t a strong relationship between Roys vote and Rhodes-Conway vote. On the other hand, Rhodes-Conway’s good wards also tended to be good ones for… Mike McCabe??

I got to meet Karen Caswelch, the CEO of Madison startup SciArtSoft last week. The company is based on tech developed by my colleague Krishnan Suresh. When I looked at one of his papers about this stuff I was happy to find there was a lovely piece of classical solid geometry hidden in it!

Here’s the deal. You want to build some component out of metal, which metal is to be contained in a solid block. So you can think of the problem as: you start with a region V in R^3, and your component is going to be some subregion W in R^3. For each choice of W there’s some measure of “compliance” which you want to minimize; maybe it’s fragility, maybe it’s flexibility, I dunno, depends on the problem. (Sidenote: I think lay English speakers would want “compliance” to refer to something you’d like to maximize, but I’m told this usage is standard in engineering.) (Subsidenote: I looked into this and now I get it — compliance literally refers to flexibility; it is the inverse of stiffness, just like in the lay sense. If you’re a doctor you want your patient to comply to their medication schedule, thus bending to outside pressure, but bending to outside pressure is precisely what you do not want your metal widget to do.)

So you want to minimize compliance, but you also want to minimize the weight of your component, which means you want vol(W) to be as small as possible. These goals are in conflict. Little lacy structures are highly compliant.

It turns out you can estimate compliance by breaking W up into a bunch of little hexahedral regions, computing compliance on each one, and summing. For reasons beyond my knowledge you definitely don’t want to restrict to chopping uniformly into cubes. So a priori you have millions and millions of differently shaped hexahedra. And part of the source of Suresh’s speedup is to gather these into approximate congruence classes so you can do a compliance computation for a whole bunch of nearly congruent hexahedra at once. And here’s where the solid geometry comes in; an old theorem of Cauchy tells you that if you know what a convex polyhedron’s 1-skeleton looks like as a graph, and you know the congruence classes of all the faces, you know the polyhedron up to rigid motion. In partiuclar, you can just triangulate each face of the hexahedron with a diagonal, and record the congruence class by 18 numbers, which you can then record in a hash table. You sort the hashes and then you can instantly see your equivalence classes of hexahedra.

Mariano Rivera was elected to the Hall of Fame, the first player ever to appear on every single ballot. Why has this never happened? Because there are a lot of ballots and thus a lot of opportunities for glitchy idiosyncrasy. In 2007, eight voters left Cal Ripken, Jr. off. What possible justification could there be? Paul Ladewski of Chicago’s Daily Southtown was one of the eight. He turned in a blank ballot that year. He said he wouldn’t vote for anyone tainted by playing during the “Steroids Era.” In 2010, he voted for Roberto Alomar.

Walking to the gym today I was thinking, 10 degrees Fahrenheit — sure, it’s cold out, but when I lived back east I would have considered this brutally, unfairly cold. Now it’s an unexceptional level of cold, easily managed by putting on gloves and a hat.

Then I got to the gym and looked at my phone and it was actually -3.

This all started when CJ asked which three baseball stadiums formed the smallest triangle. And we agreed it had to be the Brewers, the White Sox, and the Cubs, because Milwaukee and Chicago are really close together.

But it seems like cheating to use two teams in the same city. The most elegant way to forbid that is to ask the question one league at a time. Which three American League parks form the smallest triangle? And what about the National League?

First of all, what does “smallest” mean? There are lots of choices, but (perhaps inspired by the summer we played a lot of Ingress) we asked for the triangle with the smallest area. Which means you don’t just want the parks to be close together, you want them to be almost collinear!

I asked on Twitter and got lots of proposed answers. But it wasn’t obvious to me which, if any, were right, so I worked it out myself! Seamheads has the longitude and latitude of every major league ballpark past and present in a nice .csv file. How do you compute the area of a spherical triangle given longitudes and latitudes? You probably already know that the area is given by the excess over pi of the sum of the angles. But then you gotta look up a formula for the angles. Or another way: Distance on the sphere is standard, and then it turns out that there’s a spherical Heron formula for the area of a spherical triangle given its edgelengths! I guess it’s clear there’s some formula like that, but it’s cool how Heron-like it looks. Fifteen lines of Python and you’re ready to go!

So what are the answers?

We were right that Brewers-White Sox-Cubs form the smallest major league triangle. And the smallest American League triangle is not so surprising: Red Sox, Yankees, Orioles, forming a shortish line up the Eastern Seaboard. But for the National League, the smallest triangle isn’t what you might expect! A good guess, following what happened in the AL, is Mets-Phillies-Nationals. And that’s actually the second-smallest. But the smallest National League triangle is formed by the Phillies, the Nationals, and the Atlanta Braves! Here’s a piece the geodesic path from SunTrust Park in Atlanta to Citizen’s Bank Park in Philly, courtesy of GPSVisualizer:

Not only does it go right through DC, it passes about a mile and a half from Nationals Park!

Another fun surprise is the second-smallest major league triangle: you’d think it would be another triangle with two teams in the same city, but no! It’s Baltimore-Cincinnati-St. Louis. Here’s the geodesic path from Oriole Park at Camden Yards to Busch Stadium:

And here’s a closeup:

The geodesic path runs through the Ohio River, about 300m from the uppermost bleachers at Great American Ball Park. Wow!

Now here’s a question: should we find it surprising that the smallest triangles involve teams that are pretty far from each other? If points are placed at random in a circle (which baseball teams are definitely not) do we expect the smallest-area triangles to have small diameter, or do we expect them to be long and skinny? It’s the latter! See this paper: “On Smallest Triangles,” by Grimmet and Janson. Put down n points at random in the unit circle; the smallest-area triangle will typically have area on order 1/n^3, but will have diameter on order 1. Should that have been what I expected?

PS: the largest-area major league triangle is Boston-Miami-SF. Until MLB expands to Mexico City, that is!

He firmly believed that everything he did was right, that he ought on all occasions to have his own way — and like the sting of a wasp or serpent his hatred rushed out armed and poisonous against anything like opposition. He was proud of his hatred as of everything else. Always to be right, always to trample forward, and never to doubt, are not these the great qualities with which dullness takes lead in the world?

I fell down a rabbit hole this week and found myself thinking about Markoff numbers again. I blogged about this before when Sarnak lectured here about them. But I understood one minor point this week that I hadn’t understood then. Or maybe I understood it then but I forgot. Which is why I’m blogging this now, so I don’t forget again, or for the first time, as the case may be.

Remember from the last post: a Markoff number is (1/3)Tr(A), where A is an element of SL_2(Z) obtained by a certain construction. But why is this an integer? Isn’t it a weird condition on a matrix to ask that its trace be a multiple of 3? Where is this congruence coming from?

OK, here’s the idea. The Markoff story has to do with triples of matrices (A,B,C) in SL_2(Z) with ABC = identity and which generate H, the commutator subgroup of SL_2(Z). I claim that A, B, and C all have to have trace a multiple of 3! Why? Well, this is of course just a statement about triples (A,B,C) of matrices in SL_2(F_3). But they actually can’t be arbitrary in SL_2(F_3); they lie in the commutator. SL_2(F_3) is a double cover of A_4 so it has a map to Z/3Z, which is in fact the full abelianization; so the commutator subgroup has order 8 and in fact you can check it’s a quaternion group. What’s more, if A is central, then A,B, and C = A^{-1}B^{-1} generate a group which is cyclic mod its center, so they can’t generate all of H. We conclude that A,B, and C are all non-central elements of the quaternion group. Thus they have exact order 4, and so their eigenvalues are +-i, so their trace is 0.

In other words: any minimal generating set for the commutator subgroup of SL_2(Z) consists of two matrices whose traces are both multiples of 3.