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=“X≥5”, 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 k∈L 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]2≫≫1.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)={1ye−x/ye−yx,y∈(0,∞)0otherwise

Find E[X|Y=y].

Solution

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

fY(y)≫≫∫0+∞1ye−x/ye−ydx≫≫−e−x/ye−y|x=0∞≫≫e−y

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

fX|Y(x|y)≫≫fX,Y(x,y)fY(y)≫≫1ye−x/ye−y⋅(e−y)−1≫≫1ye−x/y

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

E[X|Y=y]≫≫∫−∞+∞xfX|Y(x|y)dx≫≫∫0∞xye−x/ydx≫≫y

Flip coin, choose RV

Suppose X∼Ber(1/3) and Y∼Ber(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 G∼Ber(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)≫≫14⋅12+13⋅12≫≫724

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$.