subject

Write a function sample_median(n, P) that generates n random values using distribution P and returns the median of the collected sample. Hint: Use function random. choice() to sample data from P and median() to find the median of the samples * Sample run * print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2])) print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2])) print(sample_median(5,P=[0.3,0.7]) print(sample_median(5,P=[0.3,0.7]) * Expected Output * 4.5 4.0 2.0 1.0

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
Your boss wants you to configure his laptop so that he can access the company network when he is on the road. you suggest a vpn connection to him. he is very concerned about security and asks you how secure vpn is. what do you tell him?
Answers: 1
question
Computers and Technology, 22.06.2019 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Type the correct answer in the box. spell all words correctly. what is the default margin width on all four sides of a document? by default, the document has a margin on all four sides.
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Who introduced the concept of combining artificial and natural light in the studio
Answers: 1
You know the right answer?
Write a function sample_median(n, P) that generates n random values using distribution P and returns...
Questions
question
Mathematics, 08.04.2020 18:40
question
English, 08.04.2020 18:40
question
Mathematics, 08.04.2020 18:40
question
Business, 08.04.2020 18:40
question
Mathematics, 08.04.2020 18:40
question
Mathematics, 08.04.2020 18:40
Questions on the website: 13722360