SOLUTION FOR ASSIGNMENT #2 Spring 1999 -------------------------- #1: Plot of the following: x value | pdf value | CDF value --------+-----------+----------- 0 | 0.017212 | 0.017212 1 | 0.135175 | 0.152388 2 | 0.602580 | 0.754967 3 | 0.162015 | 0.916983 4 | 0.077062 | 0.994044 5 | 0.004594 | 0.998638 6 | 0.001362 | 1.000000 #2: E[X] = (0*0.017212)+(1*0.135175)+(2*0.602580)+(3*0.162015)+ (4*0.077062)+(5*0.004594)+(6*0.001362) = 2.1658 E[X^2] = (0^2*0.017212)+(1^2*0.135175)+(2^2*0.602580)+(3^2*0.162015)+ (4^2*0.077062)+(5^2*0.004594)+(6^2*0.001362) = 5.4005 Mean = E[X] = 2.1658 Variance = E[X^2] - E[X]^2 = 0.7098 #3: See as3_3sol.c #4: Using Excel, mean of the 10000 generated values is 2.1491 and the variance is 0.695069. These values are reasonably close to the theoretically computed values from the distribution. If more than 10000 values were used, one would expect the "closeness" to be even better. ---