Question: Q3 [6 Points] Construct a function to return the mean and variance of the distribution Print out the mean and variance of this distribution assuming

 Q3 [6 Points] Construct a function to return the mean and

Q3 [6 Points] Construct a function to return the mean and variance of the distribution Print out the mean and variance of this distribution assuming p = 0.8 In [e]: def LogDist_iterative (p): #Fill in the operations here return mean, variance In [0]: ##Call the function to return PMF corresponding to x=1, ..., 20 and p=0,8 #print out the PMF array result ##Q4 10 Points] The expected value of a discrete distribution follows: E(x) = ; XiPi For the distribution we work with, we need to sum up infinite terms. If we only sum up xip; from i = 1 up to i = k, where k is a large value, we can get a good approximation although not exact. Construct an array that gives how much error we have for the expected value when we choose k=1, 2, ..., 30. In [O]: #construct the array here print(Error_array) Q3 [6 Points] Construct a function to return the mean and variance of the distribution Print out the mean and variance of this distribution assuming p = 0.8 In [e]: def LogDist_iterative (p): #Fill in the operations here return mean, variance In [0]: ##Call the function to return PMF corresponding to x=1, ..., 20 and p=0,8 #print out the PMF array result ##Q4 10 Points] The expected value of a discrete distribution follows: E(x) = ; XiPi For the distribution we work with, we need to sum up infinite terms. If we only sum up xip; from i = 1 up to i = k, where k is a large value, we can get a good approximation although not exact. Construct an array that gives how much error we have for the expected value when we choose k=1, 2, ..., 30. In [O]: #construct the array here print(Error_array)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!