![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 08.04.2020 18:32, anaber524
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
![answer](/tpl/images/cats/otvet.png)
Answers: 1
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 23:00, brookerebman15
Which type of tab stop is most for weights and measurements?
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Do you know the correct answer?
Write a function sample_median(n, P) that generates n random values using distribution P and returns...
Questions in other subjects:
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/geografiya.png)
![Konu](/tpl/images/cats/en.png)
English, 12.12.2020 16:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 12.12.2020 16:00
![Konu](/tpl/images/cats/mat.png)
Mathematics, 12.12.2020 16:00
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 12.12.2020 16:00