Expectation of function on RV given by chart

Suppose that g:ℝ→ℝ in such a way that g:1↦4 and g:2↦1 and g:3↦87 and no other values are mapped to 4,1,87. Define Y=g(X).

X:123
PX(k):1/72/74/7
Y:4187

Then:

E[X]=1⋅17+2⋅27+3⋅47≫≫177

And:

E[Y]=4⋅17+1⋅27+87⋅47≫≫3547

Therefore:

E[5X+2Y+3]≫≫5⋅177+2⋅3547+3≫≫8147

PMF through many-to-one function

Suppose the PMF of X is given by:

PX(x)={0.2x=−10.4x=00.4x=+10else

Now suppose Y=|X|. That is to say, Y=g(X) and g(X)=|X|.

What is the PMF of Y?

Solution

Notice that g(+1)=1 and g(−1)=1. So PX(+1) and PX(−1) are combined into PY(1):

PY(y)={0.4y=00.6y=10else

Variance of uniform random variable

The uniform random variable X on [a,b] has distribution given by P[c≤X≤d]=d−cb−a when a≤c≤d≤b.

(a) Find Var[X] using the shorter formula.

(b) Find Var[3X] using “squaring the scale factor.”

(c) Find Var[3X] directly.

Solution (a)

(1) Compute density.

The density for X is:

fX(x)={1b−afor x∈[a,b]0otherwise

(2) Compute E[X] and E[X2] directly using integral formulas.

Compute E[X]:

E[X]=∫abxb−adx≫≫b+a2

Now compute E[X2]:

E[X2]=∫abx2b−adx≫≫13(b2+ba+a2)

(3) Find variance using short formula.

Plug in:

Var[X]=E[X2]−E[X]2≫≫13(b2+ab+a2)−(b+a2)2≫≫(b−a)212

(b)

(1) “Squaring the scale factor” formula:

Var[aX+b]=a2Var[X]

(2) Plugging in:

Var[3X]≫≫9Var[X]≫≫912(b−a)2

(c)

(1) Density.

The variable 3X will have 1/3 the density spread over the interval [3a,3b].

Density is then:

f3X(x)={13b−3aon [3a,3b]0otherwise

(2) Plug into prior variance formula.

Use a⇝3a and b⇝3b.

Get variance:

Var[3X]=(3b−3a)212

Simplify:

≫≫(3(b−a))212≫≫912(b−a)2

Average pay raise

Suppose the average salary at Company A is $52,000. Each employee is given a 3% raise and a $2000 bonus. What is the average salary now?

Solution

Let X be a random variable indicating the starting salary of each employee.

Then Y=g(X)=(1.03)X+2000 is a random variable giving the new salary of each employee.

We can calculate the expectation by linearity:

E[Y]=E[g(X)]≫≫E[(1.03)X+2000]≫≫(1.03)E[X]+2000≫≫(1.03)(52000)+2000≫≫55560

PDF of derived from CDF

Suppose that FX(x)=11+e−x.

(a) Find the PDF of X. (b) Find the PDF of eX.

Solution

(a)

Formula:

FX(x)=∫−∞xfX(t)dt⟹fX(x)=ddxFX(x)

Plug in:

fX(x)=ddx(1+e−x)−1≫≫−(1+e−x)−2⋅(−e−x)≫≫e−x(1+e−x)2

(b)

By definition:

FeX(x)=P[eX≤x]

Since eX is increasing, we know:

eX≤a⟺X≤ln⁡a

Therefore:

FeX(x)=FX(ln⁡x)≫≫11+e−ln⁡x≫≫11+x−1

Then using differentiation:

feX(x)=ddx(11+x−1)≫≫−(1+x−1)−2⋅(−x−2)≫≫1(x+1)2

Probabilities via CDF

Suppose the CDF of X is given by FX(x)=11+e−x. Compute:

(a) P[X≤1] (b) P[X<1] (c) P[−0.5≤X≤0.2] (d) P[−2≤X]