====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2015:math445:lab9 [2015/03/24 07:06] gibson [Warm-up problem #3: flipping 100 coins with uncertain biases] |
gibson:teaching:spring-2015:math445:lab9 [2016/03/24 07:00] (current) gibson [Background] |
||
---|---|---|---|
Line 9: | Line 9: | ||
In the 2012 elections Silver's projections received an enormous amount of attention, and quite a bit of criticism, too. Political pundits derided his work as meaningless number crunching and his 2008 results as lucky. But this time, Silver predicted the Presidential election correctly in all 50 states, and 31 of 33 Senate elections. | In the 2012 elections Silver's projections received an enormous amount of attention, and quite a bit of criticism, too. Political pundits derided his work as meaningless number crunching and his 2008 results as lucky. But this time, Silver predicted the Presidential election correctly in all 50 states, and 31 of 33 Senate elections. | ||
+ | Further reading on Nate Silver, fivethirtyeight.com, and the mathematics of election prediction: | ||
+ | |||
+ | * [[http://en.wikipedia.org/wiki/FiveThirtyEight]] | ||
+ | * [[http://cosmiclog.nbcnews.com/_news/2012/10/30/14809227-political-forecasts-stir-up-a-storm?lite]], | ||
+ | * [[http://www.dailykos.com/story/2012/11/01/1153661/-Nate-Silver-s-Math-Based-Math]] | ||
+ | * [[https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=nate%20silver%20controversy | google:"Nate Silver controversy" ]] | ||
==== This lab ==== | ==== This lab ==== | ||
Line 28: | Line 34: | ||
A biased coin has something other than 50-50 chances of going heads or tails. Suppose you have 100 | A biased coin has something other than 50-50 chances of going heads or tails. Suppose you have 100 | ||
- | biased coins and you know the bias of each, i.e. the chance that each coin will turn up heads. | + | biased coins and you know the bias of each, i.e. the probability $p$ that each coin will turn up heads. |
Do the same computations as in warm-up problem 1 on this set of biased coins (do 1000 trials, | Do the same computations as in warm-up problem 1 on this set of biased coins (do 1000 trials, | ||
produce a histogram, etc.) Use the following datafile for the biases of the 100 coins: | produce a histogram, etc.) Use the following datafile for the biases of the 100 coins: | ||
Line 37: | Line 43: | ||
Now suppose you have 100 biased coins, but you don't know exactly what their biases | Now suppose you have 100 biased coins, but you don't know exactly what their biases | ||
- | are. Instead you have an estimated bias $p$ and a margin of error $m$. To account for | + | are. Instead, for each coin, you have an estimated bias $p$ and a margin of error $m$. |
- | this uncertainty, each time you flip a biased coin, change the estimated bias $p$ by a | + | To account for this uncertainty, each time you flip a biased coin, change the estimated bias $p$ by a |
random number between $-m$ and $m$. Again, run 1000 simulations of flipping these 100 | random number between $-m$ and $m$. Again, run 1000 simulations of flipping these 100 | ||
coins, make a histogram and compute the mean, median, and standard deviation of the | coins, make a histogram and compute the mean, median, and standard deviation of the | ||
- | number of heads. | + | number of heads. Here's a file for biased coins with margins of error: |
+ | [[gibson:teaching:spring-2015:math445:lab9:biasedcoins2.asc]] | ||
===== Monte Carlo simulation of the 2012 Presidential election ===== | ===== Monte Carlo simulation of the 2012 Presidential election ===== | ||
Line 59: | Line 66: | ||
and award the ''n''th election to the candidate with the majority of electoral votes. | and award the ''n''th election to the candidate with the majority of electoral votes. | ||
- | Run a large number of such simulated elections, keeping track of the number of | + | Run a large number (say, 1000) of such simulated elections, keeping track of the number of |
electoral votes for each candidate in each election. Make a histogram that | electoral votes for each candidate in each election. Make a histogram that | ||
shows the statistical distribution of total electoral votes for one of the | shows the statistical distribution of total electoral votes for one of the |