After selecting the random experiment, write a Python program that performs the following:
(The experiment I chose is : Random experiment = Number of calls you receive on your mobile phone from 8 am to 4 pm. Sample space = { 0,1,4,6,8}
a. Generate a sample path using 1000 trials of the random experiment.
b. Compute the average of the sample path (e.g., for experiment 1, this number is the average number of calls)
c. Compute the probability that the outcome of the random experiment is greater than the average computed in (b). Use the same sample path generated in (a).
import random
import numpy as np
random_number = random.random()
x = np.random.random_sample(1000) #sample path
sum = x.sum()
avg = sum / 1000 #average
print(avg)
Comments
Leave a comment