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!

]]>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.

Get the bullshit out of the camp and set it on fire. Not every parsha offers such actionable and contemporary advice!

]]>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:

[28, 29, 30, 32, 39, 40, 41, 42, 44, 45, 51, 52, 53, 62, 63, 64, 65, 81, 82, 105]

(east side Isthmus and near West)

[3, 4, 5, 7, 9, 10, 11, 17, 18, 22, 23, 24, 26, 38, 75, 88, 89, 90, 94, 96, 106, 107, 110, 111]

(far east and far west)

[15, 43, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 61, 66, 68, 69]

(campus and south Park)

[2, 12, 13, 14, 16, 21, 31, 33, 34, 35, 36, 37, 67, 80, 83, 84, 85, 86, 87, 93, 108, 109]

(west side, Hill Farms, north side, east of Monona)

[1, 6, 8, 19, 20, 25, 70, 71, 72, 73, 74, 76, 77, 78, 79, 91, 92, 95, 97, 98, 99, 100, 101, 102, 103, 104]

(southwest Madison and south of Monona)

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??

import csv

import numpy as np

import matplotlib.pyplot as plt

from sklearn.decomposition import PCA

S = csv.reader(open(‘MadisonPrimaryFeb19.csv’,’rb’))

Wards = [s for s in S]

#votes for Rhodes-Conway, Soglin, Shukla,Cheeks in that order

Alabel = np.array([[int(s[1]),int(s[2]),int(s[4]),int(s[5]),i+1] for i,s in enumerate(Wards[11:122])])

# strip out small districts

indices = [i for (i,row) in enumerate(Alabel) if sum(row[0:3]) < 20]

Astripped = np.delete(Alabel,indices,0)

Anorm = np.array([row/(sum(row**2)**(0.5)) for row in A])

# here’s the PCA

wards2d = np.transpose(PCA(n_components=2).fit_transform(Anorm))

plt.scatter(wards2d[0],wards2d[1],s=0)

for i in range(len(Astripped)):

plt.annotate(Astripped[i][4],(wards2d[0][i],wards2d[1][i]))

plt.show()

# and here’s the kmeans stuff

from sklearn.cluster import KMeans

kmeans = KMeans(n_clusters=5).fit(Anorm)

kmeans.labels_

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.

(Related: the edge lengths of a tetrahedron determine its volume but the areas of the faces don’t.)

]]>

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

]]>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!

The Dedekind sum comes up in a bunch of disparate places; it’s how you keep track of the way half-integral weight forms like the eta function aka discriminant to the one-twelfth transforms under SL_2, it shows up in the topology of modular knots, the alternating sum of continued fraction coefficients, etc. It has a weird definition which I find it hard to get a feel for. The Dedekind sum also satsfies *Rademacher reciprocity:*

If that right-hand side looks familiar, it’s because it’s the very same cubic form whose vanishing defines the Markoff numbers! Here’s a nice way to interpret it. Suppose A,B,C are matrices with ABC = 1 and

(1/3)Tr A = a

(1/3)Tr B = b

(1/3)Tr C = c

(Why 1/3? See this post from last month.)

Then

(see e.g. this paper of Bowditch.)

The well-known invariance of the Markoff form under moves like (a,b,c) -> (a,b,ab-c) now “lifts” to the fact that (the conjugacy class of) [A,B] is unchanged by the action of the mapping class group Gamma(0,4) on the set of triples (A,B,C) with ABC=1.

The Dedekind sum can be thought of as a function on such triples:

D(A,B,C) = D((1/3)Tr A, (1/3) Tr B; (1/3) Tr C).

Is there an alternate definition or characterization of D(A,B,C) which makes Rademacher reciprocity

more manifest?

]]>