Virtual Laboratories > Finite Sampling Models > 1 2 3 4 5 6 7 8 9 [10]
It's very easy to simulate a random sample of size n, with replacement from D = {1, 2, ..., N}. Recall that the ceiling function ceil(x) gives the smallest integer that is at least as large as x.
1. Let Ui
be a random number for i = 1, 2, ..., n. Show that Xi
= ceil(NUi), i = 1, 2, ..., n simulates a random
sample, with replacement, from D.
It's a bit harder to simulate a random sample of size n, without replacement, since we need to remove each sample value before the next draw.
2. Show that the
following algorithm generates a random sample of size n, without replacement, from D.
For i = 1 to N, let bi = i.
For i = 1 to n,
let j = N i + 1;
let Ui = random number;
let J = ceil(j Ui);
let Xi = bJ;
let k = bj;
let bj = bJ;
let bJ = k.
Return (X1, X2, ..., Xn).
1.17.
1.19. 0.000547
2.15. Y =
number of defective chips in the sample
2.16. Y =
number of women, Z = 10 - Y = number of men
2.22. Y =
number of tagged fish in the sample
2.23. 0.6331
3.5. 20
3.6. 2000
3.7.
R | Correct | Incorrect |
---|---|---|
6 | 0.523 | 0.478 |
8 | 0.417 | 0.583 |
10 | 0.670 | 0.330 |
12 | 0.739 | 0.261 |
14 | 0.795 | 0.205 |
3.9.
R | Correct | Incorrect |
---|---|---|
6 | 0.890 | 0.109 |
8 | 0.818 | 0.182 |
10 | 0.262 | 0.732 |
12 | 0.343 | 0.657 |
14 | 0.424 | 0.526 |
3.11.
3.14. 2000
4.15.
4.16.
4.17.
4.18.
5.6.
5.17.
1437
5.19.
2322
6.5.
1,334,961
6.9.
k | 0 | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|---|
b5(k) | 44 | 45 | 20 | 10 | 0 | 1 |
6.12.
k | 0 | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|---|
P(N5 = k) | 0.3667 | 0.3750 | 0.1667 | 0.0833 | 0 | 0.0083 |
6.22.
7.5. 0.6029
7.7. 0.2778
7.9. 0.6181
7.11. 0.3024
7.14. 9
8.9. 0.3041
8.11. 0.2218
8.14.
0.3415
8.16.
0.3174
8.20.
87.576, 2.942
8.21.
22.952, 1.826
8.21.
9.894, 1.056
8.25. Let V
denote the number of distinct answers.
j | 1 | 2 | 3 |
---|---|---|---|
P(V = j) | 1/16 | 9/16 | 6/16 |
8.25. Let V
denote the number of ducks killed.
j | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
P(V = j) | 1/10000 | 927/2000 | 9/50 | 63/127 | 189/625 |
9.6.
0.9104
9.7.
0.8110
9.8.
0.0456
9.12.
10.988, 1.130
9.13.
14.700, 6.244
9.14.
29.290, 11.211
9.15.
2364.646, 456.207