## How I won the talent show

So I don’t want to brag or anything but I won the neighborhood talent show tonight.  Look, here’s my trophy:

My act was “The Great Squarerootio.”  I drank beer and computed square roots in my head.  So I thought it might be fun to explain how to do this!  Old hat for my mathematician readers, but this is elementary enough for everyone.

Here’s how it works.  Somebody in the audience said “752.”  First of all, you need to know your squares.  I think I know them all up to 36^2 = 1296.  In this case, I can see that 752 is between 27^2 = 729 and 28^2 = 784, a little closer to 729.  So my first estimate is 27.  This is not too bad:  27^2 = 729 is 23 away from 752, so my error is 23.

Now here’s the rule that makes things go:

new estimate = old estimate + error/(2*old estimate).

In this case, the error is 23 and my old estimate is 27, so I should calculate 23/2*27; well, 23 is just a bit less than 27, between 10 and 20% less, so 23/2*27 is a bit less than 1/2, but should be bigger than 0.4.

So our new estimate is “27.4 something.”

Actual value of 27 + 23/54: 27.4259…

so I probably would have gotten pretty close on the hundredth place if I’d taken more care with estimating the fraction.  Of course, another way to get even closer is to take 27.4 as your “old estimate” and repeat the process!  But then I’d have to know the square of 27.4, which I don’t by heart, and computing it mentally would give me some trouble.

Why does this work?  The two-word answer is “Newton’s method.”  But let me give a more elementary answer.

Suppose x is our original estimate, and n is the number we’re trying to find the square root of, and e is the error; that is, n = x^2 + e.

We want to know how much we should change x in order to get a better estimate.  So let’s say we modify x by d.  Then

$(x+d)^2 = x^2 + 2xd + d^2$

Now let’s say we’ve wisely chosen x to be the closest integer to the square root of n, so d should be pretty small, less than 1 at any rate; then d^2 is really small.  So small I will decide to ignore it, and estimate

$(x+d)^2 = x^2 + 2xd$.

What we want is

$(x+d)^2 = n = x^2 +e$.

For this to be the case, we need e = 2xd, which tells us we should take d = e/2x; that’s our rule above!

Here’s another way to think about it.  We’re trying to compute 752^(1/2), right?  And 752 is 729+23.  So what is (729+23)^(1/2)?

If you remember the binomial theorem from Algebra 2, you might remember that it tells you how to compute (x+y)^n for any n.  Well, any positive whole number n, right?  That’s the thing!  No!  Any n!  It works for fractions too!  Your Algebra 2 teacher may have concealed this awesome fact from you!  I will not be so tight-lipped.

The binomial theorem says

$(x+y)^n = x^n + {n \choose 1} x^{n-1} y + {n \choose 2} x^{n-2} y^2 + \ldots +$

Plugging in x=729,y=23,n=1/2 we get

$(729+23)^{1/2} = 729^{1/2} + {1/2 \choose 1} 729^{-1/2} \cdot 23 + {1/2 \choose 2} 729^{-3/2} \cdot 23^2 + \ldots$

Now 729^{1/2} we know; that’s 27.  What is the binomial coefficient 1/2 choose 1?  Is it the number of ways to choose 1 item out of 1/2 choices?  No, because that makes no sense.  Rather:  by “n choose 1” we just mean n, by “n choose 2” we just mean (1/2)n(n-1), etc.

So we get

$(729+23)^{1/2} = 27 + (1/2) \cdot 23 / 27 + (-1/8) \cdot 23^2 / 27^3 + \ldots$

And look, that second term is 23/54 again!  So the Great Squarerootio algorithm is really just “use the first two terms in the binomial expansion.”

To sum up:  if you know your squares up to 1000, and you can estimate fractions reasonably fast, you can get a pretty good mental approximation to the square root of any three-digit number.  Even while drinking beer!  You might even be able to beat out cute kids in your neighborhood and win a big honking cup!

## Sex Has Thrown A Bomb Into Business

This article, written in 1927 by the psychoanalyst Smith Ely Jeliffe (a dude) has a take on workplace sexism that is, to me, startlingly contemporary.

## Why Men Fail

That’s the book I picked up off the shelf while working in Memorial Library today.  It’s an book of essays by psychiatrists about failure and suboptimal function, published in 1936.  In the introduction I find:

We see what a heavy toll disorders of the mind exact from human happiness when we realize that of all the beds in all the hospitals throughout the United States one in every two is for mental disease; in other words, there are as many beds for mental ailments as for all other ailments put together.

That’s startling to me!  Can it really have been so?  What’s the proportion now?

Tagged ,

## Landlord rights and Wisconsin home rule follies

The era of small government remains over in Wisconsin, as the state legislature continues to chew away at municipal self-governance.  This time:  cities are prohibited from requiring regular inspections of rental properties.

Just to remind you again what the Wisconsin Constitution says on this point:

Cities and villages organized pursuant to state law may determine their local affairs and government, subject only to this constitution and to such enactments of the legislature of statewide concern as with uniformity shall affect every city or every village.

Over the years, the state has accorded to itself the power to declare just about anything a city might do “of statewide concern,” rendering the Home Rule Amendment essentially null.  The statewide effect of Beloit requiring landlords to subject their rental properties to safety inspections every once in a while seems pretty minor to me.  I guess that’s why I’m not on the Wisconsin Supreme Court.

And yes, I get that there’s lots of interpretation of the Commerce Clause that runs roughly along the same lines.  And yes, I get that a strong interpretation of home rule would keep states from invalidating discriminatory municipal ordinances unless they ran afoul of federal law.  But these judges say they’re pure custodians of the Constitutional text.  It gets up my nose when they act as if it doesn’t exist.

Previous blog post where I complain at length about previous SC-WI home rule jurisprudence.

Tagged , , , ,

## Are Alabama’s House seats gerrymandered?

This map has a lot of people saying so:

Here’s what I think:  Alabama’s House maps might well be gerrymandered, but the Moore-Jones numbers aren’t very strong evidence.

First of all, about that weirdly shaped District 7 where so many Democrats live.  That’s a majority-minority district.  The Voting Rights Act requires the creation of some such districts, and that provision has increased the representation of racial minorities in Congress.  But most people agree they hurt Democrats overall.  You might be able to draw a district map for Alabama, Republican though it is, with two districts where Democrats have a chance instead of one.  But you’d also increase the likelihood of Alabama sending an all-white delegation.

Alabama, without District 7, is about 78% white, and white people in Alabama are about 85% Republican.  It’s not gerrymandering that Dems don’t have a chance in those six districts under normal conditions; it would happen just about any way you drew the maps.

But the Moore-Jones election was anything but normal conditions!  Did the party draw a map designed to withstand a historic Democratic turnout wave?

I doubt it.  Suppose you wanted to draw a map that would keep your big House majority even if just over half of Alabamian voters chose the Democrat.  You’ve got no chance in AL-7, and in the other 6 districts combined, the Republican is winning by 10 points.  Well, the last thing you’d do is draw an ultra-Republican district like AL-4; that makes the other districts way too close.  You’d take some of those wards and move them over to shore up AL-5, which Moore won by less than half a percent.  You might also try to concentrate the more Democratic parts of AL-1 and AL-2 into one, creating a district you might lose in a wave but leaving the rest of the state so solidly Republican that even an election more disastrous than this one for Republicans would leave five seats in GOP hands.

Outside district 7, Alabama is a very Republican state, even when offered the weakest Republican candidate in recent memory.  That’s the simplest explanation for why Moore finished ahead in districts 1-6, and it’s the one I favor.

Update:  Some people have communicated to me that in their view district 7 is more majority-minority than the Voting Rights Act requires, and that the district was drawn this way on purpose in order to increase Republican margin in the other 6 districts.

Tagged , ,

## “Worst of the worst maps”: a factual mistake in Gill v. Whitford

The oral arguments in Gill v. Whitford, the Wisconsin gerrymandering case, are now a month behind us.  But there’s a factual error in the state’s case, and I don’t want to let it be forgotten.  Thanks to Mira Bernstein for pointing this issue out to me.

Misha Tseytlin, Wisconsin’s solicitor general, was one of two lawyers arguing that the state’s Republican-drawn legislative boundaries should be allowed to stand.  Tseytlin argued that the metrics that flagged Wisconsin’s maps as drastically skewed in the GOP’s favor were unreliable:

And I think the easiest way to see this is to take a look at a chart that plaintiff’s own expert created, and that’s available on Supplemental Appendix 235. This is plain — plaintiff’s expert studied maps from 30 years, and he identified the 17 worst of the worst maps. What is so striking about that list of 17 is that 10 were neutral draws.  There were court-drawn maps, commission-drawn maps, bipartisan drawn maps, including the immediately prior Wisconsin drawn map.

That’s a strong claim, which jumped out at me when I read the transcripts–10 of the 17 very worst maps, according to the metrics, were drawn by neutral parties!  That really makes it sound like whatever those metrics are measuring, it’s not partisan gerrymandering.

But the claim isn’t true.

(To be clear, I believe Tseytlin made a mistake here, not a deliberate misrepresentation.)

The table he’s referring to is on p.55 of this paper by Simon Jackman, described as follows:

Of these, 17 plans are utterly unambiguous with respect to the sign of the efficiency gap estimates recorded over the life of the plan:

Let me unpack what Jackman’s saying here.  These are the 17 maps where we can be sure the efficiency gap favored the same party, three elections in a row.  You might ask: why wouldn’t we be sure about which side the map favors?  Isn’t the efficiency gap something we can compute precisely?  Not exactly.  The basic efficiency gap formula assumes both parties are running candidates in every district.  If there’s an uncontested race, you have to make your best estimate for what the candidate’s vote shares would have been if there had been candidates of both parties.  So you have an estimate for the efficiency gap, but also some uncertainty.  The more uncontested races, the more uncertain you are about the efficiency gap.

So the maps on this list aren’t the 17 “worst of the worst maps.”  They’re not the ones with the highest efficiency gaps, not the ones most badly gerrymandered by any measure.  They’re the ones in states with so few uncontested races that we can be essentially certain the efficiency gap favored the same party three years running.

Tseytlin’s argument is supposed to make you think that big efficiency gaps are as likely to come from neutral maps as partisan ones.  But that’s not true.  Maps drawn by Democratic legislatures have average efficiency gap favoring Democrats; those by GOP on average favor the GOP; neutral maps are in between, and have smaller efficiency gaps overall.

That’s from p.35 of another Jackman paper.  Note the big change after 2010.  It wasn’t always the case that partisan legislators automatically thumbed the scales strongly in their favor when drawing the maps.  But these days, it kind of is.  Is that because partisanship is worse now?  Or because cheaper, faster computation makes it easier for one-party legislatures to do what they always would have done, if they could?  I can’t say for sure.

Efficiency gap isn’t a perfect measure, and neither side in this case is arguing it should be the single or final arbiter of unconstitutional gerrymandering.  But the idea that efficiency gap flags neutral maps as often as partisan maps is just wrong, and it shouldn’t have been part of the state’s argument before the court.

## The greatest Astro/Dodger

The World Series is here and so it’s time again to figure out which player in the history of baseball has had the most distinguished joint record of contributions to both teams in contention for the title.  (Last year:  Riggs Stephenson was the greatest Cub/Indian.)  Astros history just isn’t that long, so it’s a little surprising to find we come up with a really solid winner this year:  Jimmy Wynn, “The Toy Cannon,” a longtime Astro who moved to LA in 1974 and had arguably his best season, finishing 5th in MVP voting and leading the Dodgers to a pennant.  Real three-true-outcomes guy:  led the league in walks twice and strikeouts once, and was top-10 in the National League in home runs four times in the AstrodomeCareer total of 41.4 WAR for the Astros, and 12.3 for the Dodgers in just two years there.

As always, thanks to the indispensable Baseball Reference Play Index for making this search possible.

Other contenders:  Don Sutton is clearly tops among pitchers.  Sutton was the flip side of Wynn; he had just two seasons for Houston but they were pretty good.  Beyond that it’s slim pickings.  Jeff Kent put in some years for both teams.  So did Joe Ferguson.

Who are we rooting for?  On the “ex-Orioles on the WS Roster” I guess the Dodgers have the advantage, with Rich Hill and Justin Turner (I have to admit I have no memory of Turner playing for the Orioles at all, even though it wasn’t that long ago!  It was in 2009, a season I have few occasions to recall.)  But both these teams are stocked with players I just plain like:  Kershaw, Puig, Altuve, the great Carlos Beltran…

Tagged , ,

## Trace test

Jose Rodriguez gave a great seminar here yesterday about his work on the trace test, a numerical way of identifying irreducible components of varieties.  In Jose’s world, you do a lot of work with homotopy; if a variety X intersects a linear subspace V in points p1, p2, .. pk, you can move V a little bit and numerically follow those k points around.  If you move V more than a little bit — say in a nice long path in the Grassmannian that loops around and returns to its starting point — you’ll come back to p1, p2, .. pk, but maybe in a different order.  In this way you can compute the monodromy of those points; if it’s transitive, and if you’re careful about avoiding some kind of discriminant locus, you’ve proven that p1,p2…pk are all on the same component of V.

But the trace test is another thing; it’s about short paths, not long paths.  For somebody like me, who never thinks about numerical methods, this means “oh we should work in the local ring.”  And then it says something interesting!  It comes down to this.  Suppose F(x,y) is a form (not necessarily homogenous) of degree at most d over a field k.  Hitting it with a linear transformation if need be, we can assume the x^d term is nonzero.  Now think of F as an element of k((y))[x]:  namely

$F = x^d + a_1(y) x^{d-1} + \ldots + a_d(y).$

Letting K be the algebraic closure of k((y)), we can then factor F as (x-r_1) … (x-r_d).  Each of these roots can be computed as explicitly to any desired precision by Hensel’s lemma.  While the r_i may be power series in k((y)) (or in some algebraic extension), the sum of the r_i is -a_1(y), which is a linear function A+by.

Suppose you are wondering whether F factors in k[x,y], and whether, for instance, r_1 and r_2 are the roots of an irreducible factor of F.  For that to be true, r_1 + r_2 must be a linear function of y!  (In Jose’s world, you grab a set of points, you homotopy them around, and observe that if they lie on an irreducible component, their centroid moves linearly as you translate the plane V.)

Anyway, you can falsify this easily; it’s enough for e.g. the quadratic term of r_1 + r_2 to be nonzero.  If you want to prove F is irreducible, you just check that every proper subset of the r_i sums to something nonlinear.

1.  Is this something I already know in another guise?
2.  Is there a nice way to express the condition (which implies irreducibility) that no proper subset of the r_i sums to something with zero quadratic term?

## Game report: Cubs 5, Brewers 0

• I guess the most dominant pitching performance I’ve seen in person?  Quintana never seemed dominant.  The Brewers hit a lot of balls hard.  But a 3-hit complete game shutout is a 3-hit complete game shutout.
• A lot of Cubs fans. A lot a lot.  My kids both agreed there were more Cubs than Brewers fans there, in a game that probably mattered more to Milwaukee.
• For Cubs fans to boo Ryan Braun in Wrigley Field is OK, I guess.  To come to Miller Park and boo Ryan Braun is classless.  Some of those people were wearing Sammy Sosa jerseys!
• This is the first time I’ve sat high up in the outfield.  And the view was great, as it’s been from every other seat I’ve ever occupied there.  A really nice design.  If only the food were better.
Tagged

My kids both wanted to see the eclipse and I said “that sounds fun but it’s too far” and I kept thinking about it and thinking about it and finally, Saturday night, I looked inward and asked myself is there really a reason we can’t do this? And the answer was no.  Or rather the answer was “it might be the case that it’s totally impossible to find a place to sleep in the totality zone within 24 hours for a non-insane amount of money, and that would be a reason” so I said, if I can get a room, we’re going.  Hotel Tonight did the rest.  (Not the first time this last-minute hotel app has saved my bacon, by the way.  I don’t use it a lot, but when I need it, it gets the job done.)

Notes on the trip:

• We got to St. Louis Sunday night; the only sight still open was my favorite one, the Gateway Arch.  The arch is one of those things whose size and physical strangeness a photo really doesn’t capture, like Mt. Rushmore.  It works for me in the same way a Richard Serra sculpture works; it cuts the sky up in a way that doesn’t quite make sense.
• I thought I was doing this to be a good dad, but in fact the total eclipse was more spectacular than I’d imagined, worth it in its own right.  From the photos I imagined the whole sky going nighttime dark.  But no, it’s more like twilight. That makes it better.  A dark blue sky with a flaming hole in it.
• Underrated aspect:  the communality of it all.  An experience now rare in everyday life.  You’re in a field with thousands of other people there for the same reason as you, watching the same thing you’re watching.  Like a baseball game!  No radio call can compare with the feeling of jumping up with the crowd for a home run.  You’re just one in an array of sensors, all focused on a sphere briefly suspended in the sky.
• People thought it was going to be cloudy.  I never read so many weather blogs as I did Monday morning.  Our Hotel Tonight room was in O’Fallon, MO, right at the edge of the totality.  Our original plan was to meet Patrick LaVictoire in Hermann, west of where we were.  But the weather blogs said south, go south, as far as you can.  That was a problem, because at the end of the day we had to drive back north.  We got as far as Festus.  There were still three hours to totality and we thought it might be smart to drive further, maybe even all the way to southern Illinois.  But a guy outside the Comfort Inn with a telescope, who seemed to know what he was doing, told us not to bother, it was a crapshoot either way and we weren’t any better off there than here.  I always trust a man with a telescope.