Menu

(Solved) : 7 Probability Obtaining Face 1 One Throw Die 1 6 Means Perform N Measurements Face 1 Appea Q44108541 . . .

7. The probability of obtaining face 1 in one throw of a die is 1/6, which means that if we perform N measurements, face 1 wi

7. The probability of obtaining face 1 in one throw of a die is 1/6, which means that if we perform N measurements, face 1 will appear approximately N/6 times. We can express this with the following two functions. N S= ſi, if the ith throw gives 1 To otherwise. The independent variable is i which can adopt the values {1,2,3,4,5,6}; this is the whole sample space. s, is a function of i. If you plot it as a histogram, all the intensity (normalized to one) would be in the face 1 bin and all the other bins would have an intensity of zero. You can consider this histogram a probability density function (PDF). S in this case represents the number of times that face 1 appears in N measurements. The probability of getting each of the members of the sample space is the same, 1/6, but only getting face 1 increases value of S. The face that you get each time you throw the die is unpredictable (you can only make educated guesses) and independent of the faces that you got in previous throws. This makes it an independent random variable, so the central limit theorem ensures that adding the results of outcomes will result in a normal distribution. Using the definitions of the mean, variance, and standard deviation, we get: 5 = 1.52 = 2, and g? = 52 – 52 = ?-? . For 6 36 36 N throws, Š = and o} = 5x Now consider the case in which siis uniformly distributed between 0 and 1. Calculate the mean and the variance analytically using their integral) definitions. You should get 1/2 for the mean and 1/3 for the variance. The code below calculates the same quantities numerically by applying the central limit theorem. Run it and play around with the variables M (the number of samples) and N (the number of values of ssampled from the uniform distribution). Explain the code in your own words. (Based on GT 3.45) import numpy as np import pandas as pd M = 1000 N = 10000 means = 0 variances = 0 for m in range(M): samples = np.random.random(N) mean = np.sum( samples) /N variance = np. sum( samples* samples) /N means.append(mean) variances.append(variance) print(‘Average mean:’, np. sum( np.array (means))/M) print(‘Average variance:’, np. sum(np.array(variances))/M) pd. Series (means).plot(kind=’hist’, xlim=(0,1)) pd. Series (variances).plot(kind=’hist’, xlim=(0,1)) Show transcribed image text 7. The probability of obtaining face 1 in one throw of a die is 1/6, which means that if we perform N measurements, face 1 will appear approximately N/6 times. We can express this with the following two functions. N S= ſi, if the ith throw gives 1 To otherwise. The independent variable is i which can adopt the values {1,2,3,4,5,6}; this is the whole sample space. s, is a function of i. If you plot it as a histogram, all the intensity (normalized to one) would be in the face 1 bin and all the other bins would have an intensity of zero. You can consider this histogram a probability density function (PDF). S in this case represents the number of times that face 1 appears in N measurements. The probability of getting each of the members of the sample space is the same, 1/6, but only getting face 1 increases value of S. The face that you get each time you throw the die is unpredictable (you can only make educated guesses) and independent of the faces that you got in previous throws. This makes it an independent random variable, so the central limit theorem ensures that adding the results of outcomes will result in a normal distribution. Using the definitions of the mean, variance, and standard deviation, we get: 5 = 1.52 = 2, and g? = 52 – 52 = ?-? . For 6 36 36 N throws, Š = and o} = 5x Now consider the case in which siis uniformly distributed between 0 and 1. Calculate the mean and the variance analytically using their integral) definitions. You should get 1/2 for the mean and 1/3 for the variance. The code below calculates the same quantities numerically by applying the central limit theorem. Run it and play around with the variables M (the number of samples) and N (the number of values of ssampled from the uniform distribution). Explain the code in your own words. (Based on GT 3.45) import numpy as np import pandas as pd M = 1000 N = 10000 means = 0 variances = 0 for m in range(M): samples = np.random.random(N) mean = np.sum( samples) /N variance = np. sum( samples* samples) /N means.append(mean) variances.append(variance) print(‘Average mean:’, np. sum( np.array (means))/M) print(‘Average variance:’, np. sum(np.array(variances))/M) pd. Series (means).plot(kind=’hist’, xlim=(0,1)) pd. Series (variances).plot(kind=’hist’, xlim=(0,1))

Expert Answer


Answer to 7. The probability of obtaining face 1 in one throw of a die is 1/6, which means that if we perform N measurements, face…

OR