Showing posts with label probability. Show all posts
Showing posts with label probability. Show all posts

2009-11-02

Randomizing a Coin Toss

Way to report only the problem, Freakonomics blog:
But it may be that the the random coin toss isn’t so random. A 2007 study found that a vigorously flipped coin is likely to land on the same side it started on at least 51 percent of the time, possibly more depending on the person doing the flipping.
Say you have a coin with a bias that doesn't change from flip to flip. You can remove the bias by flipping the coin twice, and taking the first result if the second result differs from the first or repeating if it lands the same way both times.

Mathematically, if the probability of landing heads is P, then:

  • P^2 = Prob[HH]
  • P*(1-P) = Prob[HT]
  • (1-P)*P = Prob[TH]
  • (1-P)^2 = Prob[TT]


Since the probability of HT is the same as TH, taking the first element removes the bias.

Mad props to von Neumann for inventing this trick (publication was "Various techniques used in connection with random digits"), along with fundamental portions of the theory for quantum mechanics, cryptography, and game theory. They don't make mathematicians like they used to.

2008-11-05

Tie in Iowa County



Iowa County, a county in (unsurprisingly) Iowa, had as many blue votes as red votes.
Obama: 4,173
McCain: 4,173
"Other": 125

I thought this would be a rare event until I messed around with a few numbers. If you assume that voters are independent and equally likely to vote for one of two candidates, the chance of an 8,000 person county being equally divided is almost 1%. With fewer people in a county, the odds increase. Assuming 100 counties with fewer than 8,000 people, one expects at least one county in the country to evenly split the vote.

Those are some pretty big assumptions, though. The odds are very sensitive to how split the voters are, so if one candidate has odds of 51% and the other 49%, then the probability for such a county drops to around 0.1%. If you assume 52% odds for one candidate, then we're down to 0.001%. I used the handy binomial calculator from Vassar to crunch the numbers. Also, I do not think that county size and vote color are independent; I would guess that small counties tend to vote red.

A quick, non-exhaustive search shows there were a few other counties that came close:
KY's Bath County: 24
MN's Murray County: 25
MN's Aitkin County: 10
MO's Washington County: 9 (EDIT: added later)

I couldn't find systematic county data to look at, so I might have missed counties that were closer or even tied. The data above (having a few counties in the sub-25 range) suggests around a 20% chance of a tie during an election in which a democrat is slightly ahead.