Solved Examples

Step-by-step solutions to key problems in probability and random variables.

Example 1: Computing Expected Value

Expectation

Problem: Let \(X\) have the following PMF:

$$P(X=1) = 0.3, \quad P(X=2) = 0.4, \quad P(X=3) = 0.3$$ Find \(E[X]\) and \(E[X^2]\).

Step 1: Apply the expectation formula

$$E[X] = \sum x \cdot P(X=x) = 1(0.3) + 2(0.4) + 3(0.3)$$

Step 2: Calculate

$$E[X] = 0.3 + 0.8 + 0.9 = 2.0$$

Step 3: Compute \(E[X^2]\)

$$E[X^2] = \sum x^2 \cdot P(X=x) = 1^2(0.3) + 2^2(0.4) + 3^2(0.3)$$ $$E[X^2] = 0.3 + 1.6 + 2.7 = 4.6$$

Example 2: Variance from PMF

Variance

Problem: For the distribution in Example 1, find \(\text{Var}(X)\).

Step 1: Use the variance formula

$$\text{Var}(X) = E[X^2] - (E[X])^2$$

Step 2: Substitute values from Example 1

$$\text{Var}(X) = 4.6 - (2.0)^2 = 4.6 - 4.0 = 0.6$$

Standard deviation: \(\sigma = \sqrt{0.6} \approx 0.775\)

Example 3: Finding CDF from PDF

Continuous

Problem: Given PDF \(f_X(x) = 2x\) for \(0 \leq x \leq 1\), find the CDF.

Step 1: Setup the integral

$$F_X(x) = \int_{-\infty}^x f_X(t) \, dt = \int_0^x 2t \, dt$$

Step 2: Integrate

$$F_X(x) = [t^2]_0^x = x^2$$

Step 3: Write the complete CDF

$$F_X(x) = \begin{cases} 0 & x < 0 \\ x^2 & 0 \leq x \leq 1 \\ 1 & x> 1 \end{cases}$$

Example 4: Normal Distribution Probability

Normal

Problem: Let \(X \sim N(5, 4)\). Find \(P(3 < X < 7)\).

Step 1: Standardize the values

Given: \(\mu = 5, \sigma^2 = 4\), so \(\sigma = 2\) $$Z = \frac{X - \mu}{\sigma}$$ For \(x = 3\): \(z_1 = \frac{3-5}{2} = -1\)
For \(x = 7\): \(z_2 = \frac{7-5}{2} = 1\)

Step 2: Use the standard normal table

$$P(3 < X < 7)=P(-1 < Z < 1)=\Phi(1) - \Phi(-1)$$ $$=0.8413 - 0.1587=0.6826 \approx 68.3\%$$
This is the 68% in the 68-95-99.7 rule!