You are on page 1of 4

Steven Weber

Dept. of ECE

Drexel University

ENGR 361 Statistical Analysis of Engineering Systems (Spring, 2012) Homework 1 Solutions
1. We roll a four-sided die once and then we roll it as many times as is necessary to obtain a dierent face than the one obtained in the rst roll. Let the outcome of the experiment be (r1 , r2 ) where r1 and r2 are the results of the rst and the last rolls, respectively. Assume that all possible outcomes have equal probability. Find the probability that: (a) r1 is even. Solution: 1/2. (b) Both r1 and r2 are even. Solution: 2/12. (c) r1 + r2 < 5. Solution: 4/12. To see this, illustrate the twelve possibilities for the sample space as: 1 2 3 4 1 x 2 x 3 x x 4

(1)

Observe that all twelve outcomes are equally likely. Now just count those outcomes for which r1 and r2 are even, and for which r1 + r2 < 5, respectively: 1 2 3 4 1 x 2 x o 3 x 4 o x 1 2 3 4 1 x o o 2 o x 3 o x 4 x

(2)

2. A magical four-sided die is rolled twice. Let S be the sum of the results of the two rolls. We are told that the probability that S = k is proportional to k, for k = 2, 3, , 8, and that all possible ways that a given sum k can arise are equally likely. Construct an appropriate probabilistic model and nd the probability of getting doubles. Solution. First, note 2 + 3 + 4 + 5 + 6 + 7 + 8 = 35. Let pk = P(S = k) for k {2, . . . , 8}. We require p2 + + p8 = 1. We are told pk = ck for some constant c. Then: p2 + + p8 = c2 + + c8 = c35 = 1 c = 1/35. Thus we have S 2 3 4 5 6 7 8 pk 2/35 3/35 4/35 5/35 6/35 7/35 8/35 (3) (4)

Now let = {(r1 , r2 ) : r1 [4], r2 [4]}. We partition the elements of by their sum, say k = { : S() = k}, and use the information that all outcomes with a given sum are equally likely: k 2 3 4 5 6 7 8 www.ece.drexel.edu/weber pk |k | k 2/35 1 (1, 1) (1, 2), (2, 1) 3/35 2 4/35 3 (1, 3), (3, 1), (2, 2) 5/35 4 (1, 4), (4, 1), (2, 3), (3, 2) 6/35 3 (2, 4), (4, 2), (3, 3) 7/35 2 (3, 4), (4, 3) (4, 4) 8/35 1 1

(5)

April 13, 2012

Steven Weber

Dept. of ECE

Drexel University

It follows that the probability assignment is as follows: 1 1 2 3 4


2 1 35 1 3 1 35 2 4 1 35 3 5 1 35 4

2
3 1 35 2 4 1 35 3 5 1 35 4 6 1 35 3

3
4 1 35 3 5 1 35 4 6 1 35 3 7 1 35 2

4
5 1 35 4 6 1 35 3 7 1 35 2 8 1 35 1

1 1 = 2 3 4
2 35 3 70 4 105 1 28

2
3 70 4 105 1 28 2 35

3
4 105 1 28 2 35 1 10

4
1 28 2 35 1 10 8 35

1 2 3 4

1 0.057 0.043 0.038 0.036

2 0.043 0.039 0.036 0.057

3 4 0.038 0.36 0.036 0.057 . 0.057 0.100 0.100 0.229

(6)

From here we can compute the probability of doubles (D) as P(D) = P({(1, 1), (2, 2), (3, 3), (4, 4)}) = P(1, 1)+P(2, 2)+P(3, 3)+P(4, 4) = 2 4 2 8 8 + + + = 0.381. 35 105 35 35 21 (7)

3. Alice and Bob each choose at random a number between zero and two. We assume a uniform probability law under which the probability of an event is proportional to its area. Consider the following events: (a) (b) (c) (d) A: B: C: D: The magnitude of the dierence of the two numbers is greater than 1/3. At least one of the numbers is greater than 1/3. The two numbers are equal. Alices number is greater than 1/3.

Find the probabilities P(A), P(B), P(A B), P(C), P(D), P(A D). Solution. See Fig. 1. Clearly: 1 1 1 1 25 2 2 2 = 0.694 4 2 3 3 36 1 1 35 1 4 = 0.972 P(B) = 4 3 3 36 P(A B) = P(A) P(A) = P(C) = 0 1 1 5 P(D) = 2 2 = 0.833 4 3 6 1 1 1 1 1 2 P(A D) = 2 2 + 2 4 2 3 3 2 3

2 3

41 0.5694 72

(8)

y 2 2

y 2

y 2

1/3 1/3 2

1/3 1/3 2

1/3 1/3 2

1/3 1/3 2

Figure 1: The sets in Problem 3.

www.ece.drexel.edu/weber

April 13, 2012

Steven Weber

Dept. of ECE

Drexel University

4. Consider a game where two fair (unbiased) coins are tossed, repeatedly as necessary as described below. Each toss results in heads (two heads), tails (two tails), or odds (one of each). A bet can be made that the spinner (coin tosser) will obtain three heads before a single tails and before ve consecutive odds. Notice that at most 15 tosses are required to resolve this bet. (If it is unresolved after 14 tosses, then the 14 tosses must consist of oooohoooohoooo, and the next toss is decisive.) Write a computer program to simulate this game, and run your program 100, 000 times keeping track of the fraction of n plays that result in a win. Plot this fraction of winning plays versus n, for n = 100, 200, . . . , 99900, 100000. That is, every 100 plays you should compute the cumulative fraction of plays that have been wins, and plot that fraction vs. n. What is your nal estimate of the probability of winning this bet. Make sure your plot has labeled axes and a title. Solution. Here is my Mathematica code. Clear[hw1p4a] hw1p4a[] := Module[{nh = 0, nco = 0, win = False, lose = False, toss}, While[win == False && lose == False, toss = RandomChoice[{1/4, 1/4, 1/2} -> {h, t, o}]; If[toss == h, nh++; nco = 0;]; If[toss == o, nco++;]; If[toss == t, nco = 0; lose = True;]; If[nh == 3, win = True;]; If[nco == 5, lose = True;]; ]; If[win == True, 1, 0] ]; n = 100000; m = 1000; pw = 29791/262144; a = Accumulate[Table[hw1p4a[], {i, n}]]; l = Table[a[[i]]/i, {i, n}]; ListPlot[l, MaxPlotPoints -> m, GridLines -> {{}, {pw}}, BaseStyle -> {FontSize -> 16}, AxesLabel -> {"n", "pw"}, PlotRange -> {Automatic, {0.10, 0.12}} ] This yielded the plot shown in Fig. 2. One can show the actual probability of winning is pw = 29791 0.113644. 262144 (9)

References
[1] Introduction to Probability, 2nd Edition by Dimitri P. Bertsekas and John N. Tsitsiklis, Athina Scientic Press, 2008.

www.ece.drexel.edu/weber

April 13, 2012

Steven Weber

Dept. of ECE

Drexel University

pw 0.120 0.115 0.110 0.105 n 80 000 100 000

20 000

40 000

60 000

Figure 2: The estimated probability of winning vs. the number of trials.

www.ece.drexel.edu/weber

April 13, 2012

You might also like