#OK to post #Soham Palande, Assignment 17a, 11/08/2020 #PART 1 R D 2000 : 271 267 (added 1 electoral vote to Al Gore since one elector abstained in the election) 2004 : 286 252 (added 1 electoral vote to Kerry-D since one elector messed up) 2008 : 173 365 2012 : 206 332 2016 : 311 227 (added 7 electoral votes to Trump-R since there were 7 faithless votes) L:=USEC() L := [3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 13, 14, 15, 16, 16, 18, 20, 20, 29, 29, 38, 55] #2000 coeff(GFv(L,x),x^271) 16965465344318 #2004 coeff(GFv(L,x),x^286) 16196017263096 #2008 coeff(GFv(L,x),x^365) 3182416524832 #2012 coeff(GFv(L,x),x^332) 8628577597686 #2016 coeff(GFv(L,x),x^311) 12669341528675 #PART 2 #2000 (i) f:=GFvp(USEC(),(47.9)/(48.4+47.9),x): add(coeff(f,x,i),i=270..538) .4854668622 (ii) f:=GFvp(USEC(),(47.9)/(48.4+47.9),x): add(coeff(f,x,i),i=271..538) .4779353432 #2004 (i) f:=GFvp(USEC(),(50.7)/(48.3+50.7),x): add(coeff(f,x,i),i=270..538) .5464029380 (ii) f:=GFvp(USEC(),(50.7)/(48.3+50.7),x): add(coeff(f,x,i),i=286..538) .4261964827 #2008 (i) f:=GFvp(USEC(),(52.9)/(45.7+52.9),x): add(coeff(f,x,i),i=270..538) .6445533538 (ii) f:=GFvp(USEC(),(52.9)/(45.7+52.9),x): add(coeff(f,x,i),i=365..538) 0.6752534480e-1 #2012 (i) f:=GFvp(USEC(),(51.1)/(47.2+51.1),x): add(coeff(f,x,i),i=270..538) .5780307625 (ii) f:=GFvp(USEC(),(51.1)/(47.2+51.1),x): add(coeff(f,x,i),i=332..538) .1599131129 #2016 (i) f:=GFvp(USEC(),(46.1)/(48.2+46.1),x): add(coeff(f,x,i),i=270..538) .4501744769 (ii) f:=GFvp(USEC(),(46.1)/(48.2+46.1),x): add(coeff(f,x,i),i=311..538) .1816625712 # PART 3 # p =3/10 seq(SimuCount(L,3/10,2000,4),i=1..4) [162.0740000, 47.24771448, .3352394428, 2.930481450], .4300000000, [161.4625000, 46.96806995, .2351930912, 2.772780351], .4240000000, [161.0045000, 46.76513103, .3038229920, 2.843617488], .4180000000, [160.6670000, 45.44018168, .2589458405, 2.875651401], .4210000000 StatAnal(GFvp(USEC(),3/10,x),x,4) [807/5, (1/10)*217686^(1/2), (46552/80590467)*217686^(1/2), 1604715262/564133269] #The first components of the output are pretty close to each other and also agree with StatAnal # p= 2/5 seq(SimuCount(L,2/5,2000,4),i=1..4) [214.7310000, 49.52548474, .2184606358, 2.924279368], .2375000000, [214.4285000, 49.71080252, 0.6010108177e-1, 2.789756589], .2590000000, [216.1240000, 50.92965368, .1535181817, 2.807734822], .2550000000, [214.1415000, 50.88379387, .1641630978, 2.775107460], .2490000000 StatAnal(GFvp(USEC(),2/5,x),x,4) [1076/5, (2/5)*15549^(1/2), (81466/80590467)*15549^(1/2), 892890989/322361868] #They are close but don't exactly agree #p = 1/2 seq(SimuCount(L,1/2,2000,4),i=1..4) [267.6915000, 49.30455687, -0.3099552645e-1, 2.724897676], .1525000000, [269.7650000, 50.77817225, -0.1064401250e-1, 2.809330356], .1565000000, [268.5570000, 50.31930793, -0.3741041878e-1, 2.727156310], .1570000000, [268.3835000, 50.97363464, 0.2399299140e-1, 2.817444842], .1605000000 StatAnal(GFvp(USEC(),1/2,x),x,4) [269, (1/2)*10366^(1/2), 0, 73845502/26863489] #Are pretty close #p = 3/5 seq(SimuCount(L,3/5,2000,4),i=1..4) [323.5110000, 49.41942816, -.1270898286, 2.777088314], .2280000000, [324.3990000, 49.56838508, -.1490952392, 2.946912493], .2375000000, [322.6795000, 50.95220095, -.1284334715, 2.710819590], .2500000000, [323.8345000, 49.93460834, -.1544242879, 2.728145633], .2595000000 StatAnal(GFvp(USEC(),3/5,x),x,4) [1614/5, (2/5)*15549^(1/2), -(81466/80590467)*15549^(1/2), 892890989/322361868] #Pretty close #p = 5/7 (typo in hw was originally 7/5 - changed to 5/7) seq(SimuCount(L,5/7,2000,4),i=1..4) [384.0260000, 47.24420942, -.2915600350, 2.829127636], .4545000000, [385.6880000, 45.76597704, -.2218744579, 2.816355161], .4600000000, [385.3300000, 45.29114814, -.3275449423, 2.907263941], .4540000000, [385.4105000, 45.12720897, -.2835922813, 2.786192760], .4545000000 StatAnal(GFvp(USEC(),5/7,x),x,4) [2690/7, (2/7)*25915^(1/2), -(244398/134317445)*25915^(1/2), 307522945/107453956]