#its ok to post #TaerimKim,11/08/2020,Assignment 17a #1. From Wiki, the results are as follows and we can get the number of ways by caculating coeff of function GFv #year - Demo/Rep #2000 - 267/271 #2004 - 252/286 #2008 - 365/171 #2012 - 332/206 #2016 - 227/311 #from the given data, seq(coeff(GFv(USEC(),x),x,i),i=271,286,365,332,311); #doesnot work... #gotta do one by one then.... #year - coeff(GFv(USEC(),x),x,i) #2000 - coeff(GFv(USEC(),x),x,271) = 16965465344318 #2004 - coeff(GFv(USEC(),x),x,286) = 16196017263096 #2008 - coeff(GFv(USEC(),x),x,365) = 3182416524832 #2012 - coeff(GFv(USEC(),x),x,332) = 8628577597686 #2016 - coeff(GFv(USEC(),x),x,331) = 12669341528675 ########################################################################### #2. #2000 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: 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: 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: 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: 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 ################################################################################### #3. Using procedure SimCount(L,p,N,K) with N=2000, K=4, four times and with p=3/10, 2/5,1/2,3/5,7/10, and L=USEC(); #So L:=USEC(): # p =3/10 seq(SimuCount(L,3/10,2000,4),n=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] # p= 2/5 seq(SimuCount(L,2/5,2000,4),n=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] #p = 1/2 seq(SimuCount(L,1/2,2000,4),n=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] #p = 3/5 seq(SimuCount(L,3/5,2000,4),n=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] #p = 7/10 seq(SimuCount(L,7/10,2000,4),n=1..4); [376.8010000, 45.57579839, -0.2566308035, 2.928799383], 0.4095000000, [377.8260000, 45.54809242, -0.1821061027, 2.661227570], 0.4295000000, [377.6275000, 47.07132612, -0.2790095277, 2.873433327], 0.4290000000, [377.0820000, 46.76578104, -0.3120082264, 2.855427241], 0.4255000000 StatAnal(GFvp(USEC(),7/10,x),x,4) ; [1883/5, sqrt(217686)/10, -(46552*sqrt(217686))/80590467, 1604715262/564133269] #All of these are very much close to each other and correspond with StatAnal