Assignment 5 Solutions - Probability Theory and Stochastic Processes | ECE 541, Assignments of Probability and Statistics

Material Type: Assignment; Professor: Hayat; Class: Probability Theory and Stochastic Processes; Subject: Electrical & Computer Engineer; University: University of New Mexico; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-4bw
koofers-user-4bw 🇺🇸

10 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 541 Probability and Stochastic Processes; Fall 2008
Assignment 5; Due date: Tuesday, Oct. 21, 2008
1. Consider a non-negative discrete random variable Xassuming values from {a1, a2, . . .}. Prove
that E[X] = P
i=1 aiP{X=ai}.
Recall that E[X] = limn→∞ Sn, where Sn=P
i=1 i
2nP{i
2n< X i+1
2n}. Now note that for
each i, there is a countable subset Aiof indices for which {i
2n< X i+1
2n}=jAi{X=aj}
and P{i
2n< X i+1
2n}=PjAiP{X=aj}. It is easy to see that the collection Ai,i= 1,2, . . .,
forms a partition of IN = {1,2,. . .}; that is AiAi0=when i6=i0while iAi= IN. As such,
P
i=1 PjAiajP{X=aj}=P
k=1 akP{X=ak}and P
i=1 PjAiP{X=aj}=P
k=1 P{X=ak}=
1.Also note that for any jAi, 0 aji2n2n.
Next, write
|Sn
X
j=1
ajP{X=aj}| =|
X
i=1
i
2nX
jAi
P{X=aj}
X
j=1
ajP{X=aj}|
=|
X
i=1³X
jAi
[ajP{X=aj}+ ( i
2naj)P{X=aj}]´
X
j=1
ajP{X=aj}|
=|
X
k=1
akP{X=ak}+
X
i=1 X
jAi
(i
2naj)P{X=aj}
X
j=1
ajP{X=aj}|
=|
X
i=1 X
jAi
(i
2naj)P{X=aj}|
X
i=1 X
jAi
|i
2naj|P{X=aj}
1
2n
X
i=1 X
jAi
P{X=aj}=1
2n
X
k=1
P{X=ak}=1
2n.
This establishes limn→∞ Sn=P
j=1 ajP{X=aj}, which completes the proof.
2. (Truncation of random variables). Consider the discrete random variable in Problem 1. For any
integer M1, we define XM4
= min(X, M ). Show that limM→∞ E[XM] = E[X].
Assume that E[X]<. First recall that E[XM] = P
i=1(aiM)P{X=ai}. Note that since
XMis increasing and bounded by X,E[XM] is also increasing and bounded by E[X]; therefore,
limM→∞ E[XM] exists.
Next, since E[X] = P
i=1 aiP{X=ai}, by definition of the convergent infinite series and the
monotonicity of Pn
i=1 aiP{X=ai}, for any ² > 0, there exists N1 such that 0 E[X]
Pn
i=1 aiP{X=ai}< ² for all nN. Equivalently, 0 P
i=n+1 aiP{X=ai}< ² for all nN.
But it is also true that 0 P
i=n+1(aiM)P{X=ai} P
i=n+1 aiP{X=ai}< ² for all nN,
from which we conclude 0 E[XM]Pn
i=1(aiM)P{X=ai}< ² for all nN. Since the
latter statement is true for any M, we can take the limit as M and obtain 0 limM→∞ E[X
M]Pn
i=1 aiP{X=ai} ². We now replace Pn
i=1 aiP{X=ai}in the last statement by its lower
1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Assignment 5 Solutions - Probability Theory and Stochastic Processes | ECE 541 and more Assignments Probability and Statistics in PDF only on Docsity!

ECE 541 Probability and Stochastic Processes; Fall 2008 Assignment 5; Due date: Tuesday, Oct. 21, 2008

  1. Consider a non-negative discrete random variable X assuming values from {a 1 , a 2 ,.. .}. Prove that E[X] = ∑∞ i=1 aiP{X^ =^ ai}.

Recall that E[X] = limn→∞ Sn, where Sn =

∑∞ i= i 2 n^ P{^

i 2 n^ < X^ ≤^

i+ 2 n^ }.^ Now note that for each i, there is a countable subset Ai of indices for which { 2 in < X ≤ i 2 +1n } = ∪j∈Ai {X = aj } and P{ 2 in < X ≤ i 2 +1n } =

∑ j∈Ai P{X^ =^ aj^ }.^ It is easy to see that the collection^ Ai,^ i^ = 1,^2 ,.. ., forms a partition of IN = ∑ { 1 , 2 ,.. .}; that is Ai ∩ Ai′ = ∅ when i 6 = i′^ while ∪iAi = IN. As such, ∞ i=

∑ j∈Ai aj^ P{X^ =^ aj^ }^ =^

∑∞ k=1 akP{X^ =^ ak}^ and^

∑∞ i=

∑ j∈Ai P{X^ =^ aj^ }^ =^

∑∞ k=1 P{X^ =^ ak}^ =

  1. Also note that for any j ∈ Ai, 0 ≤ aj − i 2 −n^ ≤ 2 −n. Next, write

|Sn −

∑^ ∞

j=

aj P{X = aj }| = |

∑^ ∞

i=

i 2 n

j∈Ai

P{X = aj } −

∑^ ∞

j=

aj P{X = aj }|

∑^ ∞

i=

( ∑

j∈Ai

[aj P{X = aj } + ( i 2 n^ − aj )P{X = aj }]

) −

∑^ ∞

j=

aj P{X = aj }|

∑^ ∞

k=

akP{X = ak} +

∑^ ∞

i=

j∈Ai

i 2 n^ − aj )P{X = aj } −

∑^ ∞

j=

aj P{X = aj }|

∑^ ∞

i=

j∈Ai

i 2 n^ − aj )P{X = aj }|

∑^ ∞

i=

j∈Ai

i 2 n^ − aj |P{X = aj }

2 n

∑^ ∞

i=

j∈Ai

P{X = aj } =

2 n

∑^ ∞

k=

P{X = ak} =

2 n^

This establishes limn→∞ Sn =

∑∞ j=1 aj^ P{X^ =^ aj^ }, which completes the proof.

  1. (Truncation of random variables). Consider the discrete random variable in Problem 1. For any integer M ≥ 1, we define X ∧ M = min(^4 X, M ). Show that limM →∞ E[X ∧ M ] = E[X].

Assume that E[X] < ∞. First recall that E[X ∧ M ] = ∑∞ i=1(ai^ ∧^ M^ )P{X^ =^ ai}. Note that since X ∧ M is increasing and bounded by X, E[X ∧ M ] is also increasing and bounded by E[X]; therefore, limM →∞ E[X ∧ M ] exists. Next, since E[X] =

∑∞ i=1 aiP{X^ =^ ai}, by definition of the convergent infinite series and the monotonicity of

∑n ∑ i=1^ aiP{X^ =^ ai}, for any^ ≤ >^ 0, there exists^ N^ ≥^ 1 such that 0^ ≤^ E[X]^ − n i=1 aiP{X^ =^ ai}^ < ≤^ for all^ n^ ≥^ N^.^ Equivalently, 0^ ≤^

∑∞ i=n+1 aiP{X^ =^ ai}^ < ≤^ for all^ n^ ≥^ N^. But it is also true that 0 ≤

∑∞ i=n+1(ai^ ∧^ M^ )P{X^ =^ ai} ≤^

∑∞ i=n+1 aiP{X^ =^ ai}^ < ≤^ for all^ n^ ≥^ N^ , from which we conclude 0 ≤ E[X ∧ M ] − ∑n i=1(ai^ ∧^ M^ )P{X^ =^ ai}^ < ≤^ for all^ n^ ≥^ N^.^ Since the latter statement is true for any M , we can take the limit as M → ∞ and obtain 0 ≤ limM →∞ E[X ∧ M ] − ∑n i=1 aiP{X^ =^ ai} ≤^ ≤. We now replace^ −^

∑n i=1 aiP{X^ =^ ai}^ in the last statement by its lower

bound −E[X] and obtain limM →∞ E[X ∧ M ] − E[X] ≤ ≤. We can also replace −

∑n i=1 aiP{X^ =^ ai} in the same statement by its upper bound ≤ − E[X] and obtain 0 ≤ limM →∞ E[X ∧ M ] − E[X] + ≤. By combining the two last inequalities we obtain −≤ ≤ limM →∞ E[X ∧ M ] − E[X] ≤ ≤. Since ≤ was arbitrary, we conclude limM →∞ E[X ∧ M ] = E[X]. Now assume E[X] = ∞. Then for any K > 0, there exists L ≥ 1 so that

i=1 aiP{X^ =^ ai}^ > K for all ≥ L. With this we can write limM →∞

∑` i=1(ai^ ∧^ M^ )P{X^ =^ ai}^ =^

i=1 aiP{X^ =^ ai}^ > K for all ≥ L; and hence, limM →∞

∑∞ i=1(ai^ ∧^ M^ )P{X^ =^ ai}^ > K. Since^ K^ can be chosen arbitrarily large, we conclude limM →∞

∑∞ i=1(ai^ ∧^ M^ )P{X^ =^ ai}^ =^ ∞, or^ E[X^ ∧^ M^ ]^ → ∞^ as^ M^ → ∞.

  1. Consider a non-negative random variable X. Use Problem 2 and approximation of X from below by a monotone sequence of discrete random variables to show that limM →∞ E[X ∧ M ] = E[X].

Recall that we can always approximate a random variable X monotonically from below by a discrete random variable. More precisely, define Xn =

∑∞ i= i 2 n^ I{ 2 in <X≤ i 2 +1n }, and recall that^ Xn^ ↑^ X and E[Xn] ↑ E[X] (from the definition of the expectation of X). From Problem 2 we know that limM →∞ E[Xn ∧ M ] = E[Xn]. Next, since E[X ∧ M ] is increasing, limM →∞ E[X ∧ M ] either exists or it is infinity. Now since Xn ∧ M ≤ X ∧ M ≤ X, we have

E[Xn] = lim M →∞ E[Xn ∧ M ] ≤ lim M →∞

E[X ∧ M ] ≤ E[X].

Now take the limit as n → ∞ to obtain

E[X] ≤ lim M →∞

E[X ∧ M ] ≤ E[X],

which completes the proof.

  1. Let X and Y be independent, square-integrable a random variables. Prove that E[X|Y ] = E[X].

We need to show that (1) E[X] is square integrable and σ(Y ) measurable and that (2) E[XW ] = E

[ E[X]W

] for all square integrable and σ(Y ) measurable W. Clearly, (1) is trivial. To show (2),

note that E[XW ] = E[X]E[W ] by independence of W (being σ(Y ) measurable) and X.

  1. Consider the experiment consisting of flipping a coin successively until n consecutive heads appear. See notes for details.

a) Show that the average time till the first head is observed is y 1 = p−^1 , where p is the prob- ability of getting a head each time the coin is tossed. Then find a closed form explicit solution to yn, the average time till n consecutive heads are observed for the first time.

Let X 1 , X 2 ,... , be i.i.d., Xj ∈ { 0 , 1 } with P{Xj = 0} = p, j = 1, 2 ,.. .. Let T 1 = min{i : Xi = 1}. Now, P{T 1 = k} = P{X 1 = X 2 =... = Xk=1 = 0, Xk = 1} = (1 − p)k−^1 p. From the notes, E[T 1 ] = 1/p. In what follows we will characterize yk. Again, from the notes yk = p−^1 yk− 1 + p−^1 , k ≥ 2. (1)

Case 2: s = 1 (i.e. the T (k − 1) + 1st flip is a head) Note in this case XT (k−1)+1 = 1 and therefore the steak of k heads is achieved precisely at time t + 1. That is, h(t, 1 , Xt+2,.. .) = t + 1; and thus, w(1) = (t + 1)^2.

In summary, we can combine cases 1 and 2 compactly as follows: w(s) = (t + 1)^2 I{ 1 }(s) + {(t + 1)^2 + 2(t + 1)y(k) + y 2 (k)}I{ 0 }(s), where as usual, the indicator function of a set A, I{A}(s), is defined as 1 if s ∈ A and 0 otherwise. Thus, w(Xt+1) = (t+1)^2 I{ 1 }(Xt+1)+{(t+1)^2 +2(t+1)y(k)+y 2 (k)}I{ 0 }(Xt+1). We next calculate g(t). Recall that g(t) = E[w(Xt+1)] and by using the last expression for w(Xt+1), we have g(t) = (t + 1)^2 E[I{ 1 }(Xt+1)] + {(t + 1)^2 + 2(t + 1)y(k) + y 2 (k)}E[I{ 0 }(Xt+1)]. But E[I{ 1 }(Xt+1)] = p. Similarly, E[I{ 0 }(Xt+1)] = (1 − p) ≡ q. Hence, g(t) = (t + 1)^2 + {2(t + 1)y(k) + y 2 (k)}q.

Finally, y 2 (k) = E[g(T (k − 1))] = E[(T (k − 1) + 1)^2 p + {2(T (k − 1) + 1)y(k) + y 2 (k)}q]. By recognizing that E[T (k − 1)^2 ] = y 2 (k − 1) and E[T (k − 1)] = y(k − 1), we arrive at the final result,

y 2 (k) = p−^1 y 2 (k − 1) + 2p−^1 y(k − 1) + 2qp−^1 y(k − 1)y(k) + 2qp−^1 y(k) + p−^1.

Initial condition: y 2 (1) = ∑∞ i=1 i^2 pqi−^1 =^ p−^1 (1 + 2q/p)

e) Use the difference equation derived in part (a) to evaluate y 2 , 2 and y 2 , 3.

From above, p = q = 0. 5 y 2 (1) = 6, y 2 (2) = 58, y 2 (3) = 338.

f) Use simulation to estimate y 2 , 2 and y 2 , 3. Compare to your results in part (e). Comment on the comparison.

See attachment.

From the text: Chapter 2: 50; Chapter 3: 1, 2, 34.

  1. When pn = 1/n, H(X) =

∑n i=1 n − (^1) log n = log n;

when pn = δ(n − 1), say, then H(X) = − ∑n i=1 δ(i^ −^ 1) log^ δ(i^ −^ 1) = 0.

  1. By comparison to G(z) = p 0 + p 1 z + p 2 z^2 +... , we conclude p 0 = 1/ 6 , p 1 = 1/ 6 , p 2 = 2/3.
  1. pX (n) = (1/6)δ(n) + (1/6)δ(n − 1) + (2/3)δ(n − 2).
  2. Since the probability mass functions for Y and X are both zero for negative indices (akin to causal signals), pZ (n) = ∑n k=0 pX^ (k)pY^ (n^ −^ k).

Z1=XX(2:MAX);

ZA=(XX(1:MAX-1)+Z1)./2;

ZZ=min(find(ZA == 1));

T=ZZ+1;

%T3 is the time till the first three consecutive heads

Y1=XX(2:MAX-1);

Y2=XX(3:MAX);

YA=(XX(1:MAX-2)+Y1+Y2)./3;

YY=min(find(YA == 1));

T3=YY+2;

if length(ZZ) == 0

error=1;

end

if length(YY) == 0

error=1;

end

if error==

M1(k) = W; %this is the W for the nth trial

M2(k) = T; %this is the T for the nth trial

M3(k) = T3; %this is the T3 for the nth trial

% Calculate first moment

y1(k)=mean(M1); %this is the average of W over n trials

y2(k)=mean(M2); %this is the average of T over n trials

y3(k)=mean(M3); %this is the average of T3 over n trials

% Calculate second moment

y2_1(k)=mean(M1.^2);

y2_2(k)=mean(M2.^2);

y2_3(k)=mean(M3.^2);

k=k+1;

end % if

end % for

totalerrors=maxloop-k+

figure(1)

t=[1:length(y1)];

plot(t,y1,t,y2,t,y3)

xlabel('NUMBER OF TRIALS')

ylabel('AVERAGE WAITING TIME (FIRST MOMENT)')

legend('UNTIL FIRST HEAD','UNITIL FIRST TWO HEADS','UNITIL FIRST THREE

HEADS')

text(10000,(mean(y2)+mean(y3))/2,['p=' num2str(p)],'fontsize',16)

figure(2)

t=[1:length(y1)];

plot(t,y2_1,t,y2_2,t,y2_2,t,y2_3)

xlabel('NUMBER OF TRIALS')

ylabel('AVERAGE SQUARE WAITING TIME (SECOND MOMENT)')

legend('UNTIL FIRST HEAD','UNITIL FIRST TWO HEADS','UNITIL FIRST THREE

HEADS')

text(10000,(mean(y2_2)+mean(y2_3))/2,['p=' num2str(p)],'fontsize',16)

MATLAB CODE

% Theoretical analysis for coin flipping

% Created by Prof. Hayat for ECE 541, Oct. 14, 2003

clear all;

p=0.5;

n=3;

N=[1:n];

q=1-p;

y(1)=1/p;

y2(1)=(1/p)(1+(2q/p));

for i=2:n

y(i)=y(i-1)/p + 1/p;

y2(i)=(1/p)(y2(i-1)+2y(i-1)+2qy(i)y(i-1)+2q*y(i)+1);

end