15.4k views
0 votes
Write a python function average_sample_median(n,P), that return the average of 1000 samples of size n sampled from the distribution P.

* Sample run *

print(average_sample_median(10,[0.2,0.1,0.15,0.15,0.2,0.2])) print(average_sample_median(10,[0.3,0.4,0.3])) print(average_sample_median(10,P=[0.99,0.01])
* Expected Output *
3.7855
2.004
1

User Nate Cook
by
3.5k points

1 Answer

1 vote

Answer:

Explanation: E(x)=np

E(x+y)=E(x)+E(y)

Y:p(y=1)=p

P(y-0)=1-p

I hope you can understand this example if not just tell me and I can Give you more examples thaks:-)

User GenericJon
by
3.5k points