EECS 401
Due on Feb 2, 2007 PROBLEM 1 (25 points) Joe and Helen each know that the a priori probability that her
mother will be home on any given night is 0.6. However, Helen can determine her mother’s plan for the night at 6 P.M., and then, at 6:15 P.M., she has only one chance each evening to shout one of two code words across river to Joe. He will visit her with probability 1.0 if he thinks Helen’s message means “Ma will be away,” and he will stay home with probability 1.0 if he thinks the message means “Ma will be home.”
But Helen has a meek choice and the river is channeled for heavy barge traffic. Thus she is faced with the problem of coding for a noisy channel. She has decided to use a code containing only the code wordsAandB.
The channel is described by P(a|A) = 2 3, P(a|B) = 1 4, P(b|A) = 1 3, P(b|B) = 3 4
where ais the event that “Joe think message isA” andbis the event that “Joe thinks message isB.”
(a) In order to minimize the probability of error between transmitted and received messages, should Helen and Joe agree to use code I or code II?
Code I Code II
A = Ma away A = Ma home B = Ma home B = Ma away
Solution Using Code I
Pr(error) =Pr(A, b) +Pr(B, a) =Pr(A)Pr(b|A) +Pr(B)Pr(a|B) =0.4×1 3 +0.6× 1 4 = 0.2833 Using Code II
Pr(error) =Pr(A, b) +Pr(B, a) =Pr(A)Pr(b|A) +Pr(B)Pr(a|B) =0.6×1 3 +0.4× 1 3 = 0.3
Thus Joe and Helen should code I
(b)Helen and Joe put the following cash values (in dollars) on all possible outcomes of a day
Ma home and Joe comes -30 Ma home and Joe doesn’t come 0 Ma away and Joe comes +30 Ma away and Joe doesn’t come -5
Joe and Helen make their plans with the objective of maximizing the expected value of each day of their continuing romance. Which of the above codes will maximize the expected cash value per day of this romance?
Solution Using code I
E[value] =Pr(A, a)(30) +Pr(A, b)(−5) +Pr(B, a)(−30) +Pr(B, b)(0) =0.4× 2 3 ×30−0.4× 1 3 ×5−0.6× 1 4 ×30= 2.833 Using code II
E[value] =Pr(A, a)(−30) +Pr(A, b)(0) +Pr(B, a)(−5) +Pr(B, b)(30) = −0.6×1 3 ×30−0.4× 1 4 ×5+0.4× 3 4 ×30= 2.5
Thus to maximize the expected cash value of their romance, Joe and Helen shoulduse code I.
(c) Clara isn’t quite so attractive as Helen, but at least she lives on the same side of the river. What would be the lower limit of Clara’s expected value per day which would make Joe decide to give up Helen?
Solution Clara’s expected value per day must be at least $2.833 for Joe to decide to give up Helen.
(d)What would be the maximum rate which Joe would pay the phone company for a noiseless wire to Helen’s house which he could use once per day at 6:15P.M.?
Solution Suppose Helen uses the telephone line. LetMbe the event that Ma is home. Then,
E[value] =0×Pr(M) +30×Pr(M0) = 12
Thus Joe will be willing to give $(12-2.84) = $9.16 .
(e) How much is it worth to Joe and Helen to double her mother’s probability of being away from home? Would this be a better or worse investment than spending the same amount of money for a telephone line (to be used once a day at 6:15P.M.) with the following probabilities.
P(a|A) =P(b|B) =0.9, P(b|A) =P(a|B) =0.1
Solution Suppose that the probability of Ma begin away from home is doubled to 0.8. Then using code I,
E[value] =Pr(A, a)(30) +Pr(A, b)(−5) +Pr(B, a)(−30) +Pr(B, b)(0) =0.8× 2 3 ×30−0.8× 1 3 ×5−0.2× 1 4 ×30= 13.17 Using code II
E[value] =Pr(A, a)(−30) +Pr(A, b)(0) +Pr(B, a)(−5) +Pr(B, b)(30) = −0.2×1 3 ×30−0.8× 1 4 ×5+0.8× 3 4 ×30= 15
Thus, if Ma’s probability of being away is doubled, Joe and Helen will use code II with an expected value of $15. Thus, they will be willing to give $(15-2.84) = $12.16 .
The telephone line is symmetric, so both codes will have the same expected value of (asummingAis the event Ma is home
E[value] =Pr(A, a)(−30) +Pr(A, b)(0) +Pr(B, a)(−5) +Pr(B, b)(30) = −0.6×0.1×30−0.4×0.1×5+0.4×0.9×30= 8.8
This is less than the expected return when Ma is away with a probability of 0.8. Thus spending in doubling Ma’s probability from being away from home is better.
PROBLEM 2 (18 points)Hypothesis testing
May B. Lucky is a compulsive gambler who is convinced that on any given day she is either “lucky,” in which case she wins each red/black bet she makes in roulette with probability pL > 0.5, or she is “unlucky,” in which case she wins each red/black bet
she makes in roulette with probabilitypU < 0.5.May visits the casino every day, and
believes that she knows thea prioriprobability that any one given visit is a “lucky” one (i.e., corresponds topLrather thanpU). To improve her chances, May adopts a system
whereby she estimates on-line whether she is lucky or unlucky on a given day, by keeping a running count of the number of bets that she wins and loses. In particular, she continues to play until the conditional odds in favor of the event{lucky on the current day}given the number of wins and losses so far, fall below a certain threshold. As soon as this happens, she stops playing. Provide a simple algorithm for updating May’s conditional odds with each play.
Note that ifA andB are events withP(A) > 0 andP(B) > 0, the odds in favor ofA givenBare defined as
O(A|B) = P(A|B) P(Ac|B).
Solution LetAbe the event that May is lucky on the current day and letBn,m be the
event thatnwins andmlosses have occurred so far. Assume independence of the results of different spins/plays. Letpbe thea priorprobability that she is lucky on the current day. Then we have,
O(A|Bn,m) = Pr(A|Bn,m) Pr(Ac|B n,m) = Pr(A)Pr(Bn,m|A) Pr(Ac)Pr(B n,m|Ac) = n+m n pnL(1−pL)m n+m m pn U(1−pU)m = pL pU n 1−pL 1−pU m p 1−p
From this formula, a recursive algorithm can be obtained. Letq(n+m)be the odds after n+mgames. Then
q(n+m+1) =
q(n+m)pL
pU, if she wins the next play
q(n+m)1−pL
1−pU, if she loses the next play
The initial condition isO(A|B0,0)which is equal to the initial (unconditional) oddsO(A),
which May knows by assumption.
PROBLEM 3 (12 points)Fischer and Spassky play a sudden-death chess match whereby the first player to win a game wins the match. Each game is won by Fischer with probability p, by Spassky with probabilityq, and is a draw with probability1−p−q.
(a) What is the probability that Fischer wins the match?
Solution LetEbe the event that Fischer wins the match. We can expressEas E= [
n>0
En
whereEnis the event that each of the firstngames is a draw and the(n+1)th game is
won by Fischer. SinceEn’s are disjoint, we have
Pr(E) = X n>0 Pr(En) = X n>0 (1−p−q)np= p p+q.
(b)What is the PMF, the mean, and the variance of the duration of the match?
Solution The PMF ofDis given by
pD(d) = (1−p−q)d−1(p+q), d=1, 2, 3 . . . .
Since the durationDof the match is a geometric random variable with parameterp+q, we obtain
E[D] = 1 p+q, and var(D) = 1−p−q
PROBLEM 4 (24 points)When you push the “SEND” button on your cell phone, the phone
attempts to set up a call by transmitting a “SETUP” message to a nearby base station. The phone waits for a response and if none arrives within 0.5 seconds it tries again. If it doesn’t get a response afterNtries the phone stops transmitting and generates a busy symbol. Assume that all transmissions are independent and that with probability p the “SETUP” message will get through. Also assume that if the “SETUP” message gets through the response from the base station is always correctly received by the cell phone within 0.5 seconds.
(a) What is the PMF ofX, the number of times the “SETUP” message is transmitted in a call attempt?
Solution Xcan take values1, 2, . . . , N. The PMF is given by pX(x) = p(1−p)x−1, x = 1,2,. . .,(N-1) (1−p)N−1 x = N 0 otherwise
(b)What is the probability that the call will generate a busy signal?
Solution We get a busy signal if allNattempts are unsuccessful. Thus Pr(BUSY) = (1−p)N
(c) Assuming that there is no limit on the number of tries, i.e., your phone will keep transmitting the “SETUP” message indefinitely until it gets through, what is the PMF ofX, the number of transmissions in a call attempt?
Solution If the number of trials are unlimited, the PMF is given by pX(x) =
p(1−p)x−1, x = 1,2,3,. . .
0 otherwise
(d)Following the previous part, what is the expected number of transmissions of the “SETUP” message in a call attempt?
Solution Notice that this is the geometric distribution with parameterp. Thus, E[X] = 1
PROBLEM 5 (12 points)LetXbe a random variable with PMFpX
(a) Supposegis a one-to-one function; i.e.,g(x)6=g(y)ifx6=y. Show that E(g(X)) =X
x
g(x)pX(x). (1)
Solution AssumeX takesnvaluesx1, x2, . . . , xn. Define a r.v. Y = g(X), which also
takesndistict valuesy1=g(x1), y2=g(x2), . . . , yn =g(xn). By definition
E[Y] =
n
X
i=1
yipY(yi) (2)
But event{Y =yi}={X=xi}sincegis a one-to-one mapping, thus
pY(yi) =Pr({Y =yi}) =Pr({X=xi}) =pX(xi)
Pluggin the above result into (2), we have E[Y] = n X i=1 yipY(yi) = n X i=1 g(xi)pX(xi).
(b)Suppose now thatgis general and can be many-to-one. Show that (1) still holds.
Solution In this case, the event{Y = yl} = ml [ k=1 X = xkl , where X = xkl , k =
1, 2, . . . , mlare disjoint andg(xkl) =yl, k=1, 2, . . . , ml. Thus
pY(yl) =Pr({Y =yl}) = ml X k=1 Pr({X=xkl}) = ml X k=1 pX(xkl).
Substituting this in (2) above, we have E[Y] = n X l=1 ylpY(yl) = X ml ml X l=1 g(xkl)pX(xkl),
Sincexkl are distinct for all possiblel, k, the summation just enumerates all thexi, i=
1, 2, . . . , nand therefore we have E[Y] =
n
X
i=1
PROBLEM 6 (9 points)The annual premium of a special kind of insurance starts at $1000
and is reduced by 10% after each year where no claim has been filed. The probability that a claim is filed in a given year is0.05, independently of preceding years. What is the PMF of the total premium paid up to and including the year when the first claim is filed?
Solution A claim is first filed for the first time in yearnwith probability(0.05)·(0.95)n−1, and the corresponding total premium is
1000· 1+0.9+. . .+ (0.9)n−1=1000·1− (0.9) n
1−0.9 = 10000·(1− (0.9)
n).
Thus the PMF ofX, the total premium paid up to and including the year when the first claim was filed, is
pX(x) =
0.05·(0.95)n−1, ifx=10000(1− (0.95)n), n=1, 2, . . .