Chapter 2 (Discrete Random Variables): Conditioning (条件)

本文为 I n t r o d u c t i o n Introduction Introduction t o to to P r o b a b i l i t y Probability Probability 的读书笔记

Conditioning a Random Variable on an Event

  • The conditional PMF (条件分布列) of a random variable X X X, conditioned on a particular event A A A with P ( A ) > 0 P(A) > 0 P(A)>0, is defined by
    p X ∣ A ( x ) = P ( X = x ∣ A ) = P ( { X = x } ∩ A ) P ( A ) p_{X|A}(x)=P(X=x|A)=\frac{P(\{X=x\}\cap A)}{P(A)} pXA(x)=P(X=xA)=P(A)P({ X=x}A)Note that the events { X = x } ∩ A \{X=x\}\cap A { X=x}A are disjoint for different values of x x x, their union is A A A, and, therefore,
    P ( A ) = ∑ x P ( { X = x } ∩ A ) P(A) =\sum_xP(\{X=x\}\cap A) P(A)=xP({ X=x}A)Combining the above two formulas, we see that
    ∑ x p X ∣ A ( x ) = 1 , \sum_xp_{X|A}(x) = 1, xpXA(x)=1,so p X ∣ A p_{X|A} pXA is a legitimate PMF.

Conditioning one Random Variable on Another

  • Let X X X and Y Y Y be two random variables associated with the same experiment. If we know that the value of Y Y Y is some particular y y y [with p Y ( y ) > 0 p_Y(y) >0 pY(y)>0], this provides partial knowledge about the value of X X X. This knowledge is captured by the conditional PMF p X ∣ Y p_{X|Y} pXY of X X X given Y Y Y, which is defined by specializing the
    p X ∣ Y ( x ∣ y ) = P ( X = x ∣ Y = y ) = P ( X = x , Y = y ) P ( Y = y ) = p X , Y ( x , y ) p Y ( y ) p_{X|Y}(x| y) = P(X = x| Y = y)=\frac{P(X = x, Y = y)}{P(Y=y)}=\frac{p_{X,Y}(x,y)}{p_Y(y)} pXY(xy)=P(X=xY=y)=P(Y=y)P(X=x,Y=y)=pY(y)pX,Y(x,y)
  • The conditional PMF is often convenient for the calculation of the joint PMF, using a sequential approach and the formula
    p X , Y ( x , y ) = p Y ( y ) p X ∣ Y ( x ∣ y ) p_{X,Y}(x, y) =p_Y(y)p_{X|Y}(x| y) pX,Y(x,y)=pY(y)pXY(xy)
  • The conditional PMF can also be used to calculate the marginal PMFs.
    p X ( x ) = ∑ y p X , Y ( x , y ) = ∑ y p Y ( y ) p X ∣ Y ( x ∣ y ) p_X(x)=\sum_yp_{X,Y}(x,y)=\sum_yp_Y(y)p_{X|Y}(x|y) pX(x)=ypX,Y(x,y)=ypY(y)pXY(xy)This formula provides a divide-and-conquer method for calculating marginal PMFs. It is in essence identical to the total probability theorem.

Conditional Expectation

条件期望

  • A conditional PMF is the same as an ordinary expectation, except that it refers to the new universe. and all probabilities and PMFs are replaced by their conditional counterparts. (Conditional variances can also be treated similarly.)

  • Let X X X and Y Y Y be random variables associated with the same experiment.
    • The conditional expectation of X X X given an event A A A with P ( A ) > 0 P(A)>0 P(A)>0, is defined by
      E [ X ∣ A ] = ∑ x x p X ∣ A ( x ) E[X|A]=\sum_xxp_{X|A}(x) E[XA]=xxpXA(x)For a function g ( X ) g(X) g(X), we have
      E [ g ( X ) ∣ A ] = ∑ x g ( x ) p X ∣ A ( x ) E[g(X)|A]=\sum_xg(x)p_{X|A}(x) E[g(X)A]=xg(x)pXA(x)
    • The conditional expectation of X X X given a value y y y of Y Y Y is defined by
      E [ X ∣ Y = y ] = ∑ x x p X ∣ Y ( x ∣ y ) E[X|Y=y]=\sum_xxp_{X|Y}(x|y) E[XY=y]=xxpXY(xy)
    • If A 1 , . . . , A n A_1, ... ,A_n A1,...,An be disjoint events that form a partition of the sample space, with P ( A i ) > 0 P(A_i) > 0 P(Ai)>0 for all i i i, then
      E [ X ] = ∑ i = 1 n P ( A i ) E [ X ∣ A i ] E [ X ] = ∑ y p Y ( y ) E [ X ∣ Y = y ] E[X]=\sum_{i=1}^nP(A_i)E[X|A_i]\\E[X]=\sum_yp_Y(y)E[X|Y=y] E[X]=i=1nP(Ai)E[XAi]E[X]=ypY(y)E[XY=y]Furthermore, for any event B B B with P ( A i ∩ B ) > 0 P(A_i \cap B) > 0 P(AiB)>0 for all i i i, we have
      E [ X ∣ B ] = ∑ i = 1 n P ( A i ∣ B ) E [ X ∣ A i ∩ B ] E[X|B]=\sum_{i=1}^nP(A_i|B)E[X|A_i\cap B] E[XB]=i=1nP(AiB)E[XAiB]
      • The last three equalities above apply in different situations. but are essentially equivalent. and will be referred to collectively as the total expectation theorem. They can be used to calculate the unconditional expectation E [ X ] E[X] E[X] from the conditional PMF or expectation.

Example 2.17. Mean and Variance of the Geometric.
You write a software program over and over, and each time there is probability p p p that it works correctly, independent of previous attempts. What is the mean and variance of X X X. the number of tries until the program works correctly?

SOLUTION
p X ( x ) = ( 1 − p ) x − 1 p ,         x = 1 , 2 , . . . p_X(x)=(1-p)^{x-1}p,\ \ \ \ \ \ \ x=1,2,... pX(x)=(1p)x1p,       x=1,2,...

  • The mean and variance of X X X are given by
    E [ X ] = ∑ k = 1 ∞ k ( 1 − p ) k − 1 p v a r ( X ) = ∑ k = 1 ∞ ( k − E [ X ] ) 2 ( 1 − p ) k − 1 p E[X]=\sum_{k=1}^\infty k(1-p)^{k-1}p\\var(X)=\sum_{k=1}^\infty (k-E[X])^2(1-p)^{k-1}p E[X]=k=1k(1p)k1pvar(X)=k=1(kE[X])2(1p)k1pbut evaluating these infinite sums is somewhat tedious.
  • As an alternative, we will apply the total expectation theorem, with A 1 = { X = 1 } = { f i r s t   t r y   i s   a   s u c c e s s } A_1 = \{ X = 1\} = \{ first\ try\ is\ a\ success\} A1={ X=1}={ first try is a success}, A 2 = { X > 1 } = { f i r s t   t r y   i s   a   f a i l u r e } A_2 = \{X > 1\} = \{first\ try\ is\ a\ failure\} A2={ X>1}={ first try is a failure}, and end up with a much simpler calculation.
    • If the first try is successful, we have X = 1 X = 1 X=1, and
      E [ X ∣ x = 1 ] = 1 E[X|x=1]=1 E[Xx=1]=1
    • If the first try fails ( X > 1 X>1 X>1), we have wasted one try, and we are back where we started. So, the expected number of remaining tries is E [ x ] E[x] E[x], and
      E [ X ∣ X > 1 ] = 1 + E [ X ] E[X|X>1]=1+E[X] E[XX>1]=1+E[X]Thus,
      E [ X ] = P ( X = 1 ) E [ X ∣ X = 1 ] + P ( X > 1 ) E [ X ∣ X > 1 ] = p + ( 1 − p ) ( 1 + E [ X ] ) \begin{aligned}E[X]&=P(X=1)E[X|X=1]+P(X>1)E[X|X>1]\\ &=p+(1-p)(1+E[X])\end{aligned} E[X]=P(X=1)E[XX=1]+P(X>1)E[XX>1]=p+(1p)(1+E[X])from which we obtain
      E [ X ] = 1 p E[X]=\frac{1}{p} E[X]=p1
    • With similar reasoning, we also have
      E [ X 2 ∣ X = 1 ] = 1 , E [ X 2 ∣ X > 1 ] = E [ ( 1 + X ) 2 ] = 1 + 2 E [ X ] + E [ X 2 ] E[X^2|X=1]=1,E[X^2|X>1]=E[(1+X)^2]=1+2E[X]+E[X^2] E[X2X=1]=1,E[X2X>1]=E[(1+X)2]=1+2E[X]+E[X2]so that
      E [ X 2 ] = p + ( 1 − p ) ( 1 + 2 E [ X ] + E [ X 2 ] ) E[X^2]=p+(1-p)(1+2E[X]+E[X^2]) E[X2]=p+(1p)(1+2E[X]+E[X2])from which we obtain
      E [ X 2 ] = 1 + 2 ( 1 − p ) E [ X ] p = 2 p 2 − 1 p E[X^2]=\frac{1+2(1-p)E[X]}{p}=\frac{2}{p^2}-\frac{1}{p} E[X2]=p1+2(1p)E[X]=p22p1
    • We conclude that
      v a r ( x ) = E [ X 2 ] − ( E [ X ] ) 2 = 1 − p p 2 var(x)=E[X^2]-(E[X])^2=\frac{1-p}{p^2} var(x)=E[X2](E[X])2=p21p

Example 2.18. The Two-Envelopes Paradox.
You are handed two envelopes. and you are told that one of them contains m m m times as much money as the other, where m m m is an integer with m > 1 m > 1 m>1. You open one of the envelopes and look at the amount inside. You may now keep this amount, or you may switch envelopes and keep the amount in the other envelope. What is the best strategy?

  • Here is a line of reasoning that argues in favor of switching. Let A A A be the envelope you open and B B B be the envelope that you may switch to. Let also x x x and y y y be the amounts in A A A and B B B, respectively. Then, as the argument goes, either y = x / m y = x/m y=x/m or y = m x y = mx y=mx, with equal probability 1 / 2 1/2 1/2, so given x x x, the expected value of y y y is
    1 2 ⋅ x m + 1 2 ⋅ m x = 1 2 ( 1 m + m ) x > x \frac{1}{2}\cdot\frac{x}{m}+\frac{1}{2}\cdot mx=\frac{1}{2}(\frac{1}{m}+m)x>x 21mx+21mx=21(m1+m)x>xTherefore, you should always switch to envelope B B B! But then, since you should switch regardless of the amount found in A A A, you might as well open B B B to begin with; but once you do, you should switch again, etc.
  • There are two assumptions, both flawed to some extent, that underlie this paradoxical line of reasoning.
    • (a) You have no a priori knowledge about the amounts in the envelopes, so given x x x, the only thing you know about y y y is that it is either 1 / m 1/m 1/m or m m m times x x x, and there is no reason to assume that one is more likely than the other.
    • (b) Given two random variables X X X and Y Y Y, representing monetary amounts, if E [ Y ∣ X = x ] > x E[Y |X = x] > x E[YX=x]>x, for all possible values x x x of X X X, then the strategy that always switches to Y Y Y yields a higher expected monetary gain.
  • Let us scrutinize these assumptions.
    • Assumption (a) is flawed because it relies on an incompletely specified probabilistic model. Indeed, in any correct model, all events, including the possible values of X X X and Y Y Y, must have well-defined probabilities. With such probabilistic knowledge about X X X and Y Y Y, the value of X X X may reveal a great deal of information about Y Y Y. Roughly speaking, if you have an idea about the range and likelihood of the values of X X X, you can judge whether the amount X X X found in A A A is relatively small or relatively large, and accordingly switch or not switch envelopes.
      • For example, assume the following probabilistic model: someone chooses an integer dollar amount Z Z Z from a known range [ z ‾ , z ‾ ] [\underline z,\overline z] [z,z],according to some distribution, places this amount in a randomly chosen envelope, and places m m m times this amount in the other envelope. You then choose to open one of the two envelopes (with equal probability), and look at the enclosed amount X X X. If X X X turns out to be larger than the upper range limit z ‾ \overline z z, you know that X X X is the larger of the two amounts, and hence you should not switch. Thus, in this model, the choice to switch or not should depend on the value of X X X.
      • Mathematically, in a correct probabilistic model, we must have a joint PMF for the random variables X X X and Y Y Y, the amounts in envelopes A A A and B B B, respectively. This joint PMF is specified by introducing a PMF p Z p_Z pZ for the random variable Z Z Z, the minimum of the amounts in the two envelopes. Then, for all z z z,
        p X , Y ( m z , z ) = p X , Y ( z , m z ) = 1 2 p Z ( z ) p_{X,Y}(mz,z)=p_{X,Y}(z,mz)=\frac{1}{2}p_Z(z) pX,Y(mz,z)=pX,Y(z,mz)=21pZ(z)and p X , Y ( x , y ) = 0 p_{X,Y}(x,y)=0 pX,Y(x,y)=0 for every ( x , y ) (x,y) (x,y) that is not of the form ( m z , z ) (mz, z) (mz,z) or ( z , m z ) (z, mz) (z,mz). With this specification of p X , Y ( x , y ) p_{X,Y}(x, y) pX,Y(x,y), and given that X = x X = x X=x, one can use the rule
        s w i t c h   i f   a n d   o n l y   i f   E [ Y ∣ X = x ] > x . switch\ if\ and\ only\ if\ E[Y |X = x] > x. switch if and only if E[YX=x]>x.
    • Here is a devilish example: A fair coin is tossed until it comes up heads. Let N N N be the number of tosses. Then, m N m^N mN dollars are placed in one envelope and m N − 1 m^{N -1} mN1 dollars are placed in the other. Let X X X be the amount in the envelope you open (envelope A A A), and let Y Y Y be the amount in the other envelope (envelope B B B). Now, if A A A contains $1, clearly B B B contains $m, so you should switch envelopes. If. on the other hand, A A A contains m n m^n mn dollars, where n > 0 n > 0 n>0, then B B B contains either m n − 1 m^{n-1} mn1 or m n + 1 m^{n+1} mn+1 dollars. Since N N N has a geometric PMF, we have
      P ( Y = m n + 1 ∣ X = m n ) P ( Y = m n − 1 ∣ X = m n ) = P ( Y = m n + 1 , X = m n ) P ( Y = m n − 1 , X = m n ) = P ( N = n + 1 ) P ( N = n ) = 1 2 \frac{P(Y=m^{n+1}|X=m^n)}{P(Y=m^{n-1}|X=m^n)}=\frac{P(Y=m^{n+1},X=m^n)}{P(Y=m^{n-1},X=m^n)}=\frac{P(N=n+1)}{P(N=n)}=\frac{1}{2} P(Y=mn1X=mn)P(Y=mn+1X=mn)=P(Y=mn1,X=mn)P(Y=mn+1,X=mn)=P(N=n)P(N=n+1)=21Thus
      P ( Y = m n − 1 ∣ X = m n ) = 2 3 , P ( Y = m n + 1 ∣ X = m n ) = 1 3 P(Y=m^{n-1}|X=m^n)=\frac{2}{3},P(Y=m^{n+1}|X=m^n)=\frac{1}{3} P(Y=mn1X=mn)=32,P(Y=mn+1X=mn)=31and
      E [ Y ∣ X = m n ] = 2 3 ⋅ m n − 1 + 1 3 ⋅ m n + 1 = 2 + m 2 3 m ⋅ m n E[Y|X=m^n]=\frac{2}{3}\cdot m^{n-1}+\frac{1}{3}\cdot m^{n+1}=\frac{2+m^2}{3m}\cdot m^n E[YX=mn]=32mn1+31mn+1=3m2+m2mnWe have ( 2 + m 2 ) / 3 m > 1 (2 +m^2)/3m > 1 (2+m2/3m>1 if and only if m 2 − 3 m + 2 > 0 m^2 - 3m + 2 > 0 m23m+2>0 or ( m − 1 ) ( m − 2 ) > 0 (m - 1)(m - 2) > 0 (m1)(m2)>0. Thus if m > 2 m > 2 m>2, then
      E [ Y ∣ X = m n ] > m n E[Y|X=m^n]>m^n E[YX=mn]>mnand to maximize the expected monetary gain you should always switch to B B B!
      A naive application of the total expectation theorem might seem to indicate that E [ Y ] > E [ X ] E[Y] > E[X] E[Y]>E[X]. However, this cannot be true, since X X X and Y Y Y have identical PMFs. Instead, we have
      E [ X ] = E [ Y ] = ∞ E[X]=E[Y]=\infty E[X]=E[Y]=The conclusion is that the decision rule that switches if and only if E [ Y ∣ X = x ] > x E[Y |X =x] > x E[YX=x]>x does not improve the expected monetary gain in the case where E [ Y ] = E [ X ] = ∞ E[Y] =E[X] = \infty E[Y]=E[X]=, and the apparent paradox is resolved.

Problem 32. D. Bernoulli’s problem of joint lives.
Consider 2 m 2m 2m persons forming m m m couples who live together at a given time. Suppose that at some later time, the probability of each person being alive is p p p, independent of other persons. At that later time. let A A A be the number of persons that are alive and let S S S be the number of couples in which both partners are alive. For any survivor number a a a, find E [ S ∣ A = a ] E[S | A= a] E[SA=a].

SOLUTION

  • Let X i X_i Xi be the random variable taking the value 1 or 0 depending on whether the first partner of the i i ith couple has survived or not. Let Y i Y_i Yi be the corresponding random variable for the second partner of the i i ith couple. Then, we have S = ∑ i = 1 m X i Y i S =\sum_{i=1}^m X_iY_i S=i=1mXiYi, and by using the total expectation theorem,
    E [ S ∣ A = a ] = ∑ i = 1 m E [ X i Y i ∣ A = a ] = m E [ X 1 Y 1 ∣ A = a ] = m E [ Y 1 ∣ X 1 = 1 , A = a ] P ( X 1 = 1 ∣ A = a ) = m P ( Y 1 = 1 ∣ X 1 = 1 , A = a ) P ( X 1 = 1 ∣ A = a ) = m a − 1 2 m − 1 a 2 m = a ( a − 1 ) 2 ( 2 m − 1 ) \begin{aligned}E[S |A = a] &=\sum_{i=1}^mE[X_iY_i|A = a] \\&= mE[X_1Y_1 |A = a] \\&= mE[Y_1 |X_1 = 1, A = a]P(X_1 = 1|A = a) \\&= mP(Y_1 = 1 |X_1 = 1, A = a)P(X_1 = 1|A = a) \\&=m\frac{a-1}{2m-1}\frac{a}{2m} \\&=\frac{a(a-1)}{2(2m-1)}\end{aligned} E[SA=a]=i=1mE[XiYiA=a]=mE[X1Y1A=a]=mE[Y1X1=1,A=a]P(X1=1A=a)=mP(Y1=1X1=1,A=a)P(X1=1A=a)=m2m1a12ma=2(2m1)a(a1)

Problem 33.
A coin that has probability of heads equal to p p p is tossed successively and independently until a head comes twice in a row or a tail comes twice in a row. Find the expected value of the number of tosses.

SOLUTION

  • One possibility here is to calculate the PMF of X X X, the number of tosses until the game is over, and use it to compute E [ X ] E[X] E[X]. However, with an unfair coin, this turns out to be cumbersome, so we argue by using the total expectation theorem and a suitable partition of the sample space.
  • Let H k H_k Hk (or T k T_k Tk) be the event that a head (or a tail, respectively) comes at the k k kth toss. and let p p p (respectively, q q q) be the probability of H k H_k Hk (respectively, T k T_k Tk) . Since H 1 H_1 H1 and T 1 T_1 T1 form a partition of the sample space, and P ( H 1 ) = p P(H_1) = p P(H1)=p and P ( T 1 ) = q P(T_1) = q P(T1)=q, we have
    E [ X ] = p E [ X ∣ H 1 ] + q E [ X ∣ T 1 ] E[X] = pE[X | H_1] + qE[X|T_1] E[X]=pE[XH1]+qE[XT1]
  • Using again the total expectation theorem, we have
    E [ X ∣ H 1 ] = p E [ X ∣ H 1 ∩ H 2 ] + q E [ X ∣ H 1 ∩ T 2 ] = 2 p + q ( 1 + E [ X ∣ T 1 ] ) E[X|H_1]=pE[X|H_1\cap H_2]+qE[X|H_1\cap T_2]=2p+q(1+E[X|T_1]) E[XH1]=pE[XH1H2]+qE[XH1T2]=2p+q(1+E[XT1])Similarly, we obtain
    E [ X ∣ T 1 ] = 2 q + p ( 1 + E [ X ∣ H 1 ] ) E[X|T_1]=2q+p(1+E[X|H_1]) E[XT1]=2q+p(1+E[XH1])Combining the above two relations. collecting terms, and using the fact p + q = 1 p + q = 1 p+q=1, we obtain after some calculation
    E [ X ∣ T 1 ] = 2 + p 2 1 − p q ,       E [ X ∣ H 1 ] = 2 + q 2 1 − p q E[X|T_1]=\frac{2+p^2}{1-pq},\ \ \ \ \ E[X|H_1]=\frac{2+q^2}{1-pq} E[XT1]=1pq2+p2,     E[XH1]=1pq2+q2Thus,
    E [ X ] = 2 + p q 1 − p q E[X]=\frac{2+pq}{1-pq} E[X]=1pq2+pq

Problem 34
A spider and a fly move along a straight line. At each second, the fly moves a unit step to the right or to the left with equal probability p p p, and stays where it is with probability 1 − 2 p 1 -2p 12p. The spider always takes a unit step in the direction of the fly. The spider and the fly start D D D units apart, where D D D is a random variable taking positive integer values with a given PMF. If the spider lands on top of the fly, it’s the end. What is the expected value of the time it takes for this to happen?

SOLUTION

  • Let T T T be the time at which the spider lands on top of the fly. We define
    • A d A_d Ad: the event that initially the spider and the fly are d d d units apart.
    • B d B_d Bd: the event that after one second the spider and the fly are d d d units apart.
  • Our approach will be to first apply the (conditional version of the) total expectation theorem to compute E [ T ∣ A i ] E[T | A_i] E[TAi], then use the result to compute E [ T ∣ A 2 ] E[T |A_2] E[TA2] and similarly compute sequentially E [ T ∣ A d ] E[T | A_d] E[TAd] for all relevant values of d d d. We will then apply the (unconditional version of the) total expectation theorem to compute E [ T ] E[T] E[T].
  • We have
    A d = ( A d ∩ B d ) ∪ ( A d ∩ B d − 1 ) ∪ ( A d ∩ B d − 2 ) ,      i f   d > 1 A_d= (A_d\cap B_d)\cup (A_d \cap B_{d-1}) \cup (A_d\cap B_{d-2}), \ \ \ \ if\ d > 1 Ad=(AdBd)(AdBd1)(AdBd2),    if d>1This is because if the spider and the fly are at a distance d > 1 d > 1 d>1 apart, then one second later their distance will be d d d (if the fly moves away from the spider) or d − 1 d -1 d1 (if the fly does not move) or d − 2 d - 2 d2 (if the fly moves towards the spider). We also have, for the case where the spider and the fly start one unit apart,
    A 1 = ( A 1 ∩ B 1 ) ∪ ( A 1 ∩ B 0 ) A_1 = (A_1\cap B_1)\cup (A_1 \cap B_0) A1=(A1B1)(A1B0)Using the total expectation theorem. we obtain
    E [ T ∣ A d ] = P ( B d ∣ A d ) E [ T ∣ A d ∩ B d ] + P ( B d − 1 ∣ A d ) E [ T ∣ A d ∩ B d − 1 ] + P ( B d − 2 ∣ A d ) E [ T ∣ A d ∩ B d − 2 ] ,      i f   d > 1 E[T| A_d] = P(B_d| A_d)E[T | A_d\cap B_d]+ P(B_{d-1}| A_d)E[T | A_d\cap B_{d-1}]+P(B_{d-2}| A_d)E[T | A_d\cap B_{d-2}],\ \ \ \ if\ d > 1 E[TAd]=P(BdAd)E[TAdBd]+P(Bd1Ad)E[TAdBd1]+P(Bd2Ad)E[TAdBd2],    if d>1and
    E [ T ∣ A 1 ] = P ( B 1 ∣ A 1 ) E [ T ∣ A 1 ∩ B 1 ] + P ( B 0 ∣ A 1 ) E [ T ∣ A 1 ∩ B 0 ] ,      i f   d = 1 E[T| A_1] = P(B_1| A_1)E[T | A_1\cap B_1]+ P(B_0| A_1)E[T | A_1\cap B_0],\ \ \ \ if\ d =1 E[TA1]=P(B1A1)E[TA1B1]+P(B0A1)E[TA1B0],    if d=1It can be seen based on the problem data that
    P ( B 1 ∣ A 1 ) = 2 p , P ( B 0 ∣ A 1 ) = 1 − 2 p E [ T ∣ A 1 ∩ B 1 ] = 1 + E [ T ∣ A 1 ] , E [ T ∣ A 1 ∩ B 0 ] = 1 P(B_1 | A_1) = 2p, P(B_0 | A_1) = 1 - 2p \\E[T|A_1\cap B_1]=1+E[T|A_1],E[T|A_1\cap B_0]=1 P(B1A1)=2p,P(B0A1)=12pE[TA1B1]=1+E[TA1],E[TA1B0]=1so by applying the formula for the case d = 1 d = 1 d=1, we obtain
    E [ T ∣ A 1 ] = 2 p ( 1 + E [ T ∣ A 1 ] ) + ( 1 − 2 p ) ∴ E [ T ∣ A 1 ] = 1 1 − 2 p E[T|A_1]=2p(1+E[T|A_1])+(1-2p)\\ \therefore E[T|A_1]=\frac{1}{1-2p} E[TA1]=2p(1+E[TA1])+(12p)E[TA1]=12p1By applying the formula with d = 2 d = 2 d=2, we obtain
    E [ T ∣ A 2 ] = p E [ T ∣ A 2 ∩ B 2 ] + ( 1 − 2 p ) E [ T ∣ A 2 ∩ B 1 ] + p E [ T ∣ A 2 ∩ B 0 ] = p ( 1 + E [ T ∣ A 2 ] ) + ( 1 − 2 p ) ( 1 + E [ T ∣ A 1 ] ) + p ∴ E [ T ∣ A 2 ] = 2 1 − p \begin{aligned}E[T|A_2]&=pE[T|A_2\cap B_2]+(1-2p)E[T|A_2\cap B_1]+pE[T|A_2\cap B_0]\\ &=p(1+E[T|A_2])+(1-2p)(1+E[T|A_1])+p \\\therefore E[T|A_2]&=\frac{2}{1-p}\end{aligned} E[TA2]E[TA2]=pE[TA2B2]+(12p)E[TA2B1]+pE[TA2B0]=p(1+E[TA2])+(12p)(1+E[TA1])+p=1p2Generalizing. we obtain for d > 2 d > 2 d>2,
    E [ T ∣ A d ] = p ( 1 + E [ T ∣ A d ] ) + ( 1 − 2 p ) ( 1 + E [ T ∣ A d − 1 ] ) + p ( 1 + E [ T ∣ A d − 2 ] ) E[T|A_d]=p(1+E[T|A_d])+(1-2p)(1+E[T|A_{d-1}])+p(1+E[T|A_{d-2}]) E[TAd]=p(1+E[TAd])+(12p)(1+E[TAd1])+p(1+E[TAd2])Thus, E [ T ∣ A d ] E[T | A_d] E[TAd] can be generated recursively for any initial distance d d d, using as initial conditions the values of E [ T ∣ A 1 ] E[T | A_1] E[TA1] and E [ T ∣ A 2 ] E[T |A_2] E[TA2] obtained earlier.
  • Finally, the expected value of T T T can be obtained using the given PMF for the initial distance D D D and the total expectation theorem:
    E [ T ] = ∑ d p D ( d ) E [ T ∣ A d ] E[T]=\sum_dp_D(d)E[T|A_d] E[T]=dpD(d)E[TAd]

Problem 35
Verify the expected value rule
E [ g ( X , Y ) ] = ∑ x ∑ y g ( x , y ) p X , Y ( x , y ) E[g(X,Y)]=\sum_x\sum_yg(x,y)p_{X,Y}(x,y) E[g(X,Y)]=xyg(x,y)pX,Y(x,y)using the expected value rule for a function of a single random variable.

SOLUTION
E [ g ( X , Y ) ] = ∑ y p Y ( y ) E [ g ( X , Y ) ∣ Y = y ] = ∑ y p Y ( y ) E [ g ( X , y ) ∣ Y = y ] = ∑ y p Y ( y ) ∑ x g ( x , y ) p X ∣ Y ( x ∣ y ) = ∑ x ∑ y g ( x , y ) p X , Y ( x , y ) \begin{aligned}E[g(X,Y)]&=\sum_yp_Y(y)E[g(X,Y)|Y=y] \\&=\sum_yp_Y(y)E[g(X,y)|Y=y] \\&=\sum_yp_Y(y)\sum_xg(x,y)p_{X|Y}(x|y) \\&=\sum_x\sum_yg(x,y)p_{X,Y}(x,y) \end{aligned} E[g(X,Y)]=ypY(y)E[g(X,Y)Y=y]=ypY(y)E[g(X,y)Y=y]=ypY(y)xg(x,y)pXY(xy)=xyg(x,y)pX,Y(x,y)


Problem 37. Splitting a Poisson random variable
A transmitter sends out either a 1 1 1 with probability p p p. or a 0 0 0 with probability 1 − p 1 -p 1p. independent of earlier transmissions. If the number of transmissions within a given time interval has a Poisson PMF with parameter λ \lambda λ, show that the number of 1 1 1s transmitted in that same time interval has a Poisson PMF with pararneter p λ p\lambda pλ

SOLUTION

  • Let X X X and Y Y Y be the numbers of 1 1 1s and 0 0 0s transmitted. respectively. Let Z = X + Y Z = X + Y Z=X+Y be the total number of symbols transmitted. We have
    p X , Y ( n , m ) = p X , Y ∣ Z ( n , m ∣ n + m ) p Z ( n + m ) = ( n + m n ) p n ( 1 − p ) m ⋅ e − λ λ n + m ( n + m ) ! = e − λ p ( λ p ) n n ! e − λ ( 1 − p ) ( λ ( 1 − p ) ) m m ! \begin{aligned}p_{X,Y}(n,m)&=p_{X,Y|Z}(n,m|n+m)p_Z(n+m) \\&=\begin{pmatrix}n+m\\n\end{pmatrix}p^n(1-p)^{m}\cdot \frac{e^{-\lambda}\lambda^{n+m}}{(n+m)!} \\&=\frac{e^{-\lambda p}(\lambda p)^n}{n!}\frac{e^{-\lambda(1-p)}(\lambda(1-p))^m}{m!}\end{aligned} pX,Y(n,m)=pX,YZ(n,mn+m)pZ(n+m)=(n+mn)pn(1p)m(n+m)!eλλn+m=n!eλp(λp)nm!eλ(1p)(λ(1p))mThus.
    p X ( n ) = ∑ m = 0 ∞ p X , Y ( n , m ) = e − λ p ( λ p ) n n ! e − λ ( 1 − p ) ∑ m = 0 ∞ ( λ ( 1 − p ) ) m m ! = e − λ p ( λ p ) n n ! e − λ ( 1 − p ) e λ ( 1 − p ) = e − λ p ( λ p ) n n ! \begin{aligned}p_X(n)&=\sum_{m=0}^\infty p_{X,Y}(n,m) \\&=\frac{e^{-\lambda p}(\lambda p)^n}{n!}e^{-\lambda(1-p)}\sum_{m=0}^\infty \frac{(\lambda(1-p))^m}{m!} \\&=\frac{e^{-\lambda p}(\lambda p)^n}{n!}e^{-\lambda(1-p)}e^{\lambda(1-p)} \\&=\frac{e^{-\lambda p}(\lambda p)^n}{n!}\end{aligned} pX(n)=m=0pX,Y(n,m)=n!eλp(λp)neλ(1p)m=0m!(λ(1p))m=n!eλp(λp)neλ(1p)eλ(1p)=n!eλp(λp)n

猜你喜欢

转载自blog.csdn.net/weixin_42437114/article/details/113480986