#OK to post homework #Karnaa Mistry, 11/8/20, Assignment HW #17a with(combinat): # 1. # coeff(GFv(USEC(),x),x,271) = 16965465344318 ways for George W. Bush # coeff(GFv(USEC(),x),x,286) = 16196017263096 ways for George W. Bush (2nd term) # coeff(GFv(USEC(),x),x,365) = 3182416524832 ways for Barack Obama # coeff(GFv(USEC(),x),x,332) = 8628577597686 ways for Barack Obama (2nd term) # coeff(GFv(USEC(),x),x,304) = 13873406885786 ways for Donald Trump # 2. # Trump's Popular Vote % ~ 0.477 # Probability of Trump winning (scoring at least 270 votes) = sum(coeff(GFvp(USEC(),0.477,x),x,i),i=270..538) = 0.4017956492 = ~ 40.2% # Biden's Popular Vote % ~ 0.506 # Probability of Biden winning (scoring at least 270 votes) = sum(coeff(GFvp(USEC(),0.506,x),x,i),i=270..538) = 0.5211051575 = ~ 52.1% # 3. # SimuCount(USEC(),3/10,2000,4) = [162.7020000, 46.42433840, 0.2578988962, 2.801500896], 0.4205000000 # = [160.1745000, 46.30589649, 0.2751344854, 2.865822743], 0.4275000000 # = [160.7935000, 46.54096966, 0.2920921114, 2.828226250], 0.3960000000 # = [162.4350000, 46.72959207, 0.2215524979, 2.825133667], 0.4175000000 # evalf(StatAnal(GFvp(USEC(),3/10,x),x,4)) = [161.4000000, 46.65683230, 0.2695069204, 2.844567676] # SimuCount(USEC(),2/5,2000,4) = [213.4035000, 50.85002150, 0.1118196786, 2.770988810], 0.2500000000 # = [215.9585000, 49.66738142, 0.1206537765, 2.620561944], 0.2245000000 # = [214.5270000, 50.65992767, 0.1298209851, 2.799920388], 0.2605000000 # = [214.9020000, 49.71176316, 0.1716160003, 2.702705340], 0.2660000000 # evalf(StatAnal(GFvp(USEC(),2/5,x),x,4)) = [215.2000000, 49.87825176, 0.1260503198, 2.769840597] # SimuCount(USEC(),1/2,2000,4) = [272.2505000, 49.89784314, 0.02472323771, 2.677198929], 0.1505000000 # = [269.0480000, 51.43311867, -0.01019421438, 2.757038607], 0.1680000000 # = [268.6215000, 50.98339180, -0.07906006297, 2.758011764], 0.1575000000 # = [268.8950000, 51.62492590, -0.06376390437, 2.757276536], 0.1565000000 # evalf(StatAnal(GFvp(USEC(),1/2,x),x,4)) = [269., 50.90677755, 0., 2.748917015] # SimuCount(USEC(),3/5,2000,4) = [323.3930000, 50.11114198, -0.1422159756, 2.637502368], 0.2265000000 # = [324.0715000, 49.68934884, -0.1164478307, 2.772638760], 0.2510000000 # = [322.5695000, 48.42325030, -0.05463435375, 2.770179550], 0.2355000000 # = [323.2190000, 49.51471538, -0.06146352494, 2.697747296], 0.2525000000 # evalf(StatAnal(GFvp(USEC(),3/5,x),x,4)) = [322.8000000, 49.87825176, -0.1260503198, 2.769840597] # Overall, the estimates for the moments very much do agree with the actual Stat Analysis number, as they are often # within a 1's place away, differing by a max of + or - 2.0 points # The measures of consistency within each section is also very close together, differing by only a few # hundreths each time