Expectation of function on RV given by chart

Suppose that g: in such a way that g:14 and g:21 and g:387 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]=117+227+347177

And:

E[Y]=417+127+87473547

Therefore:

E[5X+2Y+3]5177+23547+38147

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[cXd]=dcba when acdb.

(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)={1bafor x[a,b]0otherwise

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

Compute E[X]:

E[X]=abxbadxb+a2

Now compute E[X2]:

E[X2]=abx2badx13(b2+ba+a2)

(3) Find variance using short formula.

Plug in:

Var[X]=E[X2]E[X]213(b2+ab+a2)(b+a2)2(ba)212

(b)

(1) “Squaring the scale factor” formula:

Var[aX+b]=a2Var[X]

(2) Plugging in:

Var[3X]9Var[X]912(ba)2

(c)

(1) Density.

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

Density is then:

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

(2) Plug into prior variance formula.

Use a3a and b3b.

Get variance:

Var[3X]=(3b3a)212

Simplify:

(3(ba))212912(ba)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)+200055560

PDF of derived from CDF

Suppose that FX(x)=11+ex.

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

Solution

(a)

Formula:

FX(x)=xfX(t)dtfX(x)=ddxFX(x)

Plug in:

fX(x)=ddx(1+ex)1(1+ex)2(ex)ex(1+ex)2

(b)

By definition:

FeX(x)=P[eXx]

Since eX is increasing, we know:

eXaXlna

Therefore:

FeX(x)=FX(lnx)11+elnx11+x1

Then using differentiation:

feX(x)=ddx(11+x1)(1+x1)2(x2)1(x+1)2

Probabilities via CDF

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

(a) P[X1] (b) P[X<1] (c) P[0.5X0.2] (d) P[2X]