Вы находитесь на странице: 1из 3

Quiz 24-Mar-2020

1. Can you give an example of what the Bernoulli distribution is?

Home Work
2. Can you give an example of what the Geometric distribution is?
The geometric distribution represents the number of failures before you get a
success in a series of Bernoulli trials. This discrete probability distribution is
represented by the probability density function:
f(x) = (1 − p)x − 1p
For example, you ask people outside a polling station who they voted for until
you find someone that voted for the independent candidate in a local election.
The geometric distribution would represent the number of people who you
had to poll before you found someone who voted independent. You would
need to get a certain number of failures before you got your first success.
If you had to ask 3 people, then X=3; if you had to ask 4 people, then X=4
and so on. In other words, there would be X-1 failures before you get your
success.
If X=n, it means you succeeded on the nth try and failed for n-1 tries. The
probability of failing on your first try is 1-p. For example, if p = 0.2 then your
probability of success is .2 and your probability of failure is 1 – 0.2 = 0.8.
Independence (i.e. that the outcome of one trial does not affect the next)
means that you can multiply the probabilities together. So the probability of
failing on your second try is (1-p)(1-p) and your probability of failing on the
nth-1 tries is (1-p)n-1. If you succeeded on your 4th try, n = 4, n – 1 = 3, so
the probability of failing up to that point is (1-p)(1-p)(1-p) = (1-p)3.

3. Please use Excel and Python to generate Bernoulli distribution random


number, display the histogram of random number, and calculate the mean
of random number. The probability of true is 0.6 (p=0.6), random number
sample size=2000.
0.07

0.06

0.05

0.04

0.03

0.02

0.01

0
0 50 100 150 200 250

4. Please use Excel and Python to generate Geometric distribution random


number. display the histogram of random number, and calculate the mean
of random number. The probability of true is 0.05 (p=0.6), random number
sample size=2000.

250

200

150

100

50

5. There are 93 students in our class. We want to select 10 student’s ID from


them randomly. Please use Excel and Python to do this work. The duplicate
IDs are not allowed in selected list. The student’s ID list could be find in
attachment.
14

12

10

0
1 2 3 4 5 6 7 8 9

Quiz email to xclu@bjtu.edu.cn in 10 minutes.


Please email your homework to xclu@bjtu.edu.cn before 31 Mar. The models
(Excel file, Jupyter notebook file or Python file) should be attached.

24 March 2020

Вам также может понравиться