Virtual Laboratories > Bernoulli Trials > 1 2 3 4 5 6 [7]

7. Notes


Simulating Bernoulli Trials

It is very easy to simulate a Bernoulli trials process with random numbers.

Mathematical Exercise 1. Let p be in [0, 1] and let U1, U2, U3, ... be a sequence of independent random variables, each uniformly distributed on (0, 1). Show that the following sequence is a Bernoulli trials process with parameter p:

Ij = 1 if Uj p, Ij = 0 if Uj > p

The binomial and negative binomial experiments can now be simulated directly from the Bernoulli trials sequence, since these variables are functions of the Bernoulli trials sequence.

Related Topics

Bernoulli trials appear in many chapters in this project, further evidence of the importance of the model.

Books

The Bernoulli trials model is discussed in virtually every book on probability. In particular see

Selected Answers for Section 1

Answer 1.8. Yes, probably so. The outcomes are correct and incorrect and p = 1 / 4.

Answer 1.9. Yes, approximately. The outcomes are prefer A and do not prefer A; p is the proportion of voters in the entire district who prefer A.

Answer 1.10. Yes, the outcomes are red and black, and p = 18 / 38.

Answer 1.11. No, probably not. The games are almost certainly dependent, and the win probably depends on who is serving and thus is not constant from game to game.

Answer 1.17.

  1. k = 10, E(Yk) = 19.56
  2. k = 5, E(Yk) = 426.22
  3. k = 32, E(Yk) = 62.76

Selected Answers for Section 2

Answer 2.5. f(0) = 0.4019, f(1) = 0.4019, f(2) = 0.1608, f(3) = 0.0322, f(4) = 0.0032, f(5) = 0.0001.

Answer 2.6. 0.07813

Answer 2.11.

  1. P(at least 1 ace in 6 rolls) = 0.6551
  2. P(at least 2 aces in 12 rolls) = 0.6187

Answer 2.12.

  1. P(at least 1 ace in 4 rolls of 1 die) = 0.5177
  2. P(at least 2 aces in 24 rolls of 2 dice) = 0.4914.

Answer 2.23. X = Number of failures. E(X) = 1, sd(X) = 0.9899

Answer 2.24. X = Number of aces. E(X) = 166.67, sd(X) = 11.79

Answer 2.31. Xn = Number of heads in the first n tosses. P(X20 = j | X100 = 30) = C(20, j) C(80, 30 - j) / C(100, 30).

Answer 2.37. X = Number who prefer A

  1. E(X) = 20, sd(X) = 3.464.
  2. P(X < 19) = 0.3356.
  3. P(X < 19) ~ 0.3335

Answer 2.44.

  1. R3,2(p) = 3p2 - 2p3.
  2. R5,3(p) = 10p3 - 15p4 + 6p5.
  3. 3 out of 5 is better for p 1 / 2.

Selected Answers for Section 3

Answer 3.13. R: Reject null hypothesis that the coin is fair.

  1. P(R) = 0.180, P(Rc) = 0.820
  2. P(R) = 0.384, P(Rc) = 0.616
  3. P(R) = 0.678, P(Rc) = 0.322
  4. P(R) = 0.930, P(Rc) = 0.070

Answer 3.15. No: 0.0262

Selected Answers for Section 4

Answer 4.5. 0.482

Answer 4.10. X = # launches. E(X) = 50, sd(X) = 49.497.

Answer 4.12. 0.4

Answer 4.18. Geometric with p = 18 / 38.

Answer 4.22. $1000.

Answer 4.27.

  1. P(W = 1) = 2/3, P(W = 2) = 1/3
  2. P(W = 1) = 4/7, P(W = 2) = 2/7, P(W = 3) = 1/7.
  3. P(W = i) = 2n - i / (2n - 1) for i = 1, 2, ..., n.

Selected Answers for Section 5

Answer 5.6. 0.579

Answer 5.13. X = launch number of 4'th failure. E(X) = 200, sd(X) = 98.995

Answer 5.17. X = number of tosses needed to get 50 heads.

  1. 0.0072
  2. No.

Answer 5.30.

  1. 0.6825.
  2. 0.7102

Answer 5.36. A gets $72.56, B gets $27.44

Selected Answers for Section 6

Answer 6.11.

  1. 0.0075
  2. 0.0178
  3. 0.205
  4. 0.123

Answer 6.12. f(u, v, w, x, y, z) = C(4; u, v, w, x, y, z) (1/4)u + z (1/8)v + w + x+ y for u, v, w, x, y, z nonnegative integers that sum to 4

Answer 6.14.

  1. -0.625
  2. -0.0386