Question

Here is some empirical data: { 1, 2, 1, 4, 5, 3, 1, 2, 2, 1,...

Here is some empirical data: { 1, 2, 1, 4, 5, 3, 1, 2, 2, 1, 1, 3, 5, 1, 3, 2, 1, 2, 5, 2, 4, }. Create a Python program that draws a random number from the empirical distribution of this data

Homework Answers

Answer #1

Answer:

import random

numberList = [1, 2, 1, 4, 5, 3, 1, 2, 2, 1, 1, 3, 5, 1, 3, 2, 1, 2, 5, 2, 4]
print("random number from list is: ", random.choice(numberList))

Explanation:

In this program we first import the library random. Then we create the list named as numberList with numbers. At last print random number from random.choice(numberList).

Hope you like the answer.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Some data from one experiment are given as below: 1, 1, 2, 3, 3, 4, 5,...
Some data from one experiment are given as below: 1, 1, 2, 3, 3, 4, 5, 5, 5, 7, 9 a) Find the median, mean and variance of the data. [4 marks]    b) Find the first, second, third quartiles and the Inter Quartile Range (IQR), minimum and maximum values. [4 marks] c) Draw the box-plot as stated in (b) above. [2 marks]
5) Here are some (simulated) data on the maximum age distribution in rabbits: age: 0 1...
5) Here are some (simulated) data on the maximum age distribution in rabbits: age: 0 1 2 3 4 5 6 7 8 9 frequency: 47 232 429 388 205 99 58 10 3 0 Give the following: a) Pr(Y > 6) b) Pr(2 < Y < 6) c) Pr(Y ≥ 3) d) Pr(Y < 7) e) Pr(Y = 9) e) Add (a) and (d). Are you surprised? Why or why not?
1. Some data from one experiment are given as below: 1, 1, 2, 3, 3, 4,...
1. Some data from one experiment are given as below: 1, 1, 2, 3, 3, 4, 5, 5, 5, 7, 9 a) Find the median, mean and variance of the data. [4 marks]    b) Find the first, second, third quartiles and the Inter Quartile Range (IQR), minimum and maximum values. [4 marks] c) Draw the box-plot as stated in (b) above. [2 marks]
Consider these data sets: I: 1, 3, 2, 2, 5, 4, 4, 3, 3 II: 1,...
Consider these data sets: I: 1, 3, 2, 2, 5, 4, 4, 3, 3 II: 1, 2, 4, 1, 2, 5, 2, 5, 1, 5, 5, 3 (a) Find the mean and median for each set. Show your work. (b) Find variance and standard deviation for each set. Show your work. (c) Would you be surprised to hear someone claim that these data were drawn from the same population? (Hint: Draw a histogram for each set. Compare the shapes.)
java data structure question - Consider the following recurrence function" f(1)=1; f(2)=2; f(3)=3; f(4)=2; f(5)=2 f(n)...
java data structure question - Consider the following recurrence function" f(1)=1; f(2)=2; f(3)=3; f(4)=2; f(5)=2 f(n) = 2 * f(n -1) + f(n – 5) for n >= 6 Write a program to demonstrate this recurrence relation (recursive method) and demonstrate it for the values n = 6, 7, 10, and 12; Create a second method that solves the same problem using an iterative solution. Modify your test program to show that both the recursive method and the iterative methods...
5. (2 + 3 + 3 marks) A firm receives number of calls per day that...
5. (2 + 3 + 3 marks) A firm receives number of calls per day that follows Poisson distribution with mean 0.8. Find the probability that the number of calls a. on the 4th day is 2 b. on the first 8 days totals 5. c. in the first 6 hours totals at least 2. 4.(4 + 3 marks) In an ordinary deck of 52 playing cards, if a person draws a king or a jack, he is paid $10;...
Determine the quadratic regression for the data. {(1, 5), (3, 4), (4, 1), (5, 2), (7,...
Determine the quadratic regression for the data. {(1, 5), (3, 4), (4, 1), (5, 2), (7, 4)}1, 5, 3, 4, 4, 1, 5, 2, 7, 4 Explain how you got your answers. Round to the nearest hundredth.
(19.06) In government data, a household consists of all occupants of a dwelling unit. Here is...
(19.06) In government data, a household consists of all occupants of a dwelling unit. Here is the distribution of household size in the United States: Number of persons 1 2 3 4 5 6 7 probability 0.28 0.35 0.15 0.13 0.06 0.02 0.01 Choose an American household at random and let the random variable Y be the number of persons living in the household. What is P(2<Y?6) (±±0.001)? ___
here is an interesting pattern 1+2+1=2^2 1+2+3+2+1=3^2 1+2+3+4+3+2+1=4^2 and so on. this pattern continues where the...
here is an interesting pattern 1+2+1=2^2 1+2+3+2+1=3^2 1+2+3+4+3+2+1=4^2 and so on. this pattern continues where the sum is always the middle number squared. using theorem 1.1 see fi you can explain the pattern
Here is a data set summarized as a stem-and-leaf plot: 3   00024677779 4 0003445677888899 5 04456...
Here is a data set summarized as a stem-and-leaf plot: 3   00024677779 4 0003445677888899 5 04456 6 669 How many data values are in this data set? n=n= What is the minimum value in the last class? What is the minimum value in the entire sample? How many of the original values are greater than 40? The test scores for two algebra classes are shown in the Stem and Leaf below. Test Scores Period 9 Period 10 9 8 2...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT