**This is an old revision of the document!** ----
====== Math 445 Lab 8: Presidential election ====== Your job is to predict the outcome of today's Presidential election, given the last-minute polling data, following the practices of Specifically, given a list of states, their electoral votes, the composite polling percentages for each candidate, and the margins of error those polling percentages, you are to run a large number of simulations of the election. For each state, award each of the two candidates the specified composite polling percent plus a random number in the range between ''-margin'' and ''+margin''. Then award that state's electoral votes to the candidate with the larger percentage of votes. Add up all the electoral votes for each candidate, and award the ''n''th election to the candidate with more electoral votes. Run a large number of such simulated elections, and record the number of electoral votes for each candidate in each election. Make a histogram that shows the statistical distribution of total electoral votes for one of the candidates, using bins of width 5 between 0 and 539 (0-4 for bin 1, 5-9 for bin 2, etc). Color the bins corresponding to Romney wins red and the bins corresponding to Obama wins blue. Then answer the following questions - Who is most likely to win the presidential election? - What is the probability that the most likely winner will actually win? - What is the most likely range of electoral votes for the winner? (among the bins of width 5 specified above) Turn in print-outs of your codes, your histogram, and your answer to the above questions. Some further questions you might address * It would probably be better to interpret each reported margin of error as the standard deviations of Gaussian distribution, rather than the bounds of a uniform distribution. Modify your code to use the former. Does this significantly change your results? * Does doubling or halving the margins of error significantly change your results? * How many elections do you need to simulate in order to get reliable answers? * The lab as written assumes a two-party presidential election. Do you think we should include third-party candidates? If you do, does it change the results significantly? * We are trusting that the polling data form an accurate estimate of the actual votes cast, to within the margins of error. Is this a valid assumption? Why or why not? * Do you believe your own election prediction? Why or why not? Relevant matlab commands; **rand**, **randn**, **sum**, **hist**, plus standard plotting commands such as **xlabel**, **ylabel**, **title**.