#OK to post homework #Kent Mei, 11/8/20, Assignment 17a #--------------------------------- #Part 1 #Counting the final outcome of the electoral votes of the winner. #2000: #271 electoral #coeff(GFv(USEC(),x),x,271) #16965465344318 ways of leading to this outcome. #2004: #286 electoral #coeff(GFv(USEC(),x),x,286) #16196017263096 ways of leading to this outcome. #2008: #365 electoral #coeff(GFv(USEC(),x),x,365) #3182416524832 ways of leading to this outcome. #2012: #332 electoral #coeff(GFv(USEC(),x),x,332) #8628577597686 ways of leading to this outcome. #2016: #304 electoral #coeff(GFv(USEC(),x),x,304) #13873406885786 ways of leading to this outcome. #--------------------------------- #Part 2 #2000: #Proportion: p := 47.9 / (47.9 + 48.4) #f := GFvp(USEC(),p,x) #i) #add(coeff(f,x,i), i = 270..538) #.4854668622 #ii) #add(coeff(f,x,i), i = 271..538) #.4779353432 #2004: #Proportion: p := 50.7 / (50.7 + 48.3) #f := GFvp(USEC(),p,x) #i) #add(coeff(f,x,i), i = 270..538) #.5464029380 #ii) #add(coeff(f,x,i), i = 286..538) #.4261964827 #2008: #Proportion: p := 52.9 / (52.9 + 45.7) #f := GFvp(USEC(),p,x) #i) #add(coeff(f,x,i), i = 270..538) #.6445533538 #ii) #add(coeff(f,x,i), i = 365..538) #0.6752534480e-1 #2012: #Proportion: p := 47.9 / (47.9 + 48.4) #f := GFvp(USEC(),p,x) #i) #add(coeff(f,x,i), i = 270..538) #.5780307625 #ii) #add(coeff(f,x,i), i = 332..538) #.1599131129 #2016: #Proportion: p := 46.1 / (46.1 + 48.1) #f := GFvp(USEC(),p,x) #i) #add(coeff(f,x,i), i = 270..538) #.4523116129 #ii) #add(coeff(f,x,i), i = 304..538) #.2213345529 #--------------------------------- #Part 3 #SimuCount(USEC(),3/10,2000,4) #[160.3420000, 46.93465708, .2572120209, 2.870733857], .4255000000 #[162.0740000, 47.24771448, .3352394428, 2.930481450], .4300000000 #[161.4625000, 46.96806995, .2351930912, 2.772780351], .4240000000 #[161.0045000, 46.76513103, .3038229920, 2.843617488], .4180000000 #evalf(StatAnal(GFvp(USEC(),3/10,x),x,4)) #[161.4000000, 46.65683230, .2695069204, 2.844567676] #SimuCount(USEC(),2/5,2000,4) #[213.4080000, 49.78047344, .1441080604, 2.788527410], .2430000000 #[214.6360000, 49.35590647, .2253653025, 2.946951567], .2390000000 #[214.3430000, 49.60739210, 0.6655853647e-1, 2.787134903], .2585000000 #[216.2240000, 51.00418438, .1482463471, 2.807969737], .2550000000 #evalf(StatAnal(GFvp(USEC(),2/5,x),x,4)) #[215.2000000, 49.87825176, .1260503198, 2.769840597] #SimuCount(USEC(),1/2,2000,4) #[268.1920000, 51.22581513, 0.1427125685e-1, 2.734577033], .1515000000 #[268.0835000, 50.82377915, -0.3668535393e-1, 2.707650590], .1490000000 #[269.6540000, 50.48810042, -0.1554311348e-3, 2.776425044], .1585000000 #[269.6275000, 49.90066877, -0.4058111458e-1, 2.743066329], .1540000000 #evalf(StatAnal(GFvp(USEC(),1/2,x),x,4)) #[269., 50.90677755, 0., 2.748917015] #SimuCount(USEC(),3/5,2000,4) #[322.1280000, 50.02645916, -0.6589511207e-1, 2.750248187], .2295000000 #[323.2475000, 49.49598210, -.1272400168, 2.767226554], .2260000000 #[324.3695000, 49.57697016, -.1475465724, 2.946260076], .2375000000 #[322.6970000, 50.92324803, -.1291425975, 2.712498244], .2495000000 #evalf(StatAnal(GFvp(USEC(),3/5,x),x,4)) #[322.8000000, 49.87825176, -.1260503198, 2.769840597] #NOTE: p = 7/5 doesn't really make sense, so I tried 4/5 instead. #SimuCount(USEC(),4/5,2000,4) #[430.3580000, 40.61531528, -.4934259859, 3.094993914], .6130000000 #[431.7730000, 40.40300077, -.5699726779, 3.267664788], .6290000000 #[429.8920000, 41.11830902, -.3798226082, 2.948854590], .6280000000 #[430.6745000, 41.31833188, -.5470099237, 3.276455759], .6375000000 #evalf(StatAnal(GFvp(USEC(),4/5,x),x,4)) #[430.4000000, 40.72542204, -.4631384486, 3.031385373] #For each of the probabilities, the estimates of each of the moments seem to agree with each other pretty closely. Similarly, they agree with the true values rather closely. It seems like of all of them, the third moment has the most variability. The other moments usually don't differ from the actual value too much in terms of relative error. #The value for the probability a count is consistent seems to be close to each other within each of the probabilities.