Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago