Conditional PMF, fixed event, expectation

Suppose X measures the lengths of some items and has the following PMF:

PX(k)={0.15k=1,2,3,40.1k=5,6,7,80 otherwise 

Let L=X5, an event.

(a) Find the conditional PMF of X given that L is known.

(b) Find the conditional expected value and variance of X given L.

Solution

(a)

Conditional PMF formula with kL plugged in:

PX|L(k)={PX(k)P[L]k=5,6,7,80 otherwise 

Compute P[L] by adding cases:

P[L]=k=58PX(k)0.4

Divide nonzero PMF entries by 0.1:

PX|L(k)={0.25k=5,6,7,80 otherwise 

(b)

Find E[X|L]:

E[X|L]=k=58kPX|L(k)5(0.25)+6(0.25)+7(0.25)+8(0.25)6.5min

Find E[X2|L]:

E[X2|L]=k=58k2PX|L(k)52(0.25)+62(0.25)+72(0.25)+82(0.25)43.5min2

Find Var[X|L] using “short form” with conditioning:

Var[X|L]=E[X2|L]E[X|L]21.25min2

Conditional PMF, variable event, via joint density

Suppose X and Y have joint PMF given by:

PX,Y(k,)={k+21k=1,2,3;=1,20otherwise

Find PX|Y(k|) and PY|X(,k).

Solution

Marginal PMFs:

PX(k)=2k+321,k=1,2,3 PY()=+27,=1,2

Assuming =1 or 2, for each k=1,2,3 we have:

PX|Y(k|)=PX,Y(k,)PY()k+3+6

Assuming k=1, 2, or 3, for each =1,2 we have:

PY|X(|k)=PY,X(,k)PX(k)k+2k+3

Proof of Iterated Expectation, continuous case

Prove Iterated Expectation for the continuous case.

Conditional expectations from joint density

Suppose X and Y are random variables with joint density given by:

fX,Y(x,y)={1yex/yeyx,y(0,)0otherwise

Find E[X|Y=y]. Use this to compute E[X].

Solution

(1) Derive the marginal density fY(y):

fY(y)0+1yex/yeydxex/yey|x=0ey

(2) Use fY(y) to compute fX|Y(x|y):

fX|Y(x|y)fX,Y(x,y)fY(y)1yex/yey(ey)11yex/y

(3) Use fX|Y(x|y) to calculate expectation conditioned on the variable event:

E[X|Y=y]+xfX|Y(x|y)dx0xyex/ydxy

(4) Apply Iterated Expectation:

Set g(y)=y. By Iterated Expectation, we know that E[X]=E[g(Y)]. Therefore:

E[X]=E[g(Y)]=+g(y)fY(y)dy0+yeydy1

Notice that g(Y)=Y, so E[X|Y]=Y, and Iterated Expectation says that E[X]=E[Y].

Flip coin, choose RV

Suppose XBer(1/3) and YBer(1/4) represent two biased coins, giving 1 for heads and 0 for tails.

Here is the experiment:

  1. Flip a fair coin.
  2. If heads, flip the X coin; if tails, flip the Y coin.
  3. Record the outcome as Z.

What is E[Z]?

Solution

Let GBer(1/2) describe the fair coin. Then:

E[Z]=E[E[Z|G]]E[Z|G=0]PG(0)+E[Z|G=1]PG(1)E[Y]PG(0)+E[X]PG(1)1412+1312724

Sum of random number of RVs

Let N denote the number of customers that enter a store on a given day.

Let Xi denote the amount spent by the ith customer.

Assume that E[N]=50 and E[X_i]=\ ParseError: Unexpected character: '\' at position 8: E[X_i]=\̲8foreachi$.

What is the expected total spend of all customers in a day?

Solution

A formula for the total spend is X=i=1NXi.

By Iterated Expectation, we know E[X]=E[E[X|N]].

Now compute E[X|N] as a function of N:

E[X|N=n]E[(i=1NXi)|N=n]E[(i=1nXi)|N=n]i=1nE[Xi|N=n]i=1nE[Xi]8n

Therefore g(n)=8n and g(N)=8N and E[X|N]=8N.

Then by Iterated Expectation, E[X]=E[8N]=8E[N]=\ ParseError: Unexpected character: '\' at position 18: …X]=E[8N]=8E[N]=\̲400$.