Welcome to the World of Expectations!

Hello there! Welcome to one of the most vital chapters in your CS1 journey. If you’ve ever wondered how insurance companies decide how much to charge for a policy, or how a gambler calculates their potential winnings, you’re looking at the answer: Expectations.

In this chapter, we are going to learn how to calculate the "long-run average" of random variables. Don't worry if the math looks a bit scary at first—we'll break it down step-by-step using simple analogies and clear examples. Let's dive in!

1. What is an Expectation?

Think of the Expected Value (denoted as \(E[X]\)) as the center of gravity for a probability distribution. It’s the average value you would get if you repeated an experiment millions of times.

The Discrete Case

If your random variable \(X\) is discrete (meaning you can count the outcomes, like rolling a die), the expectation is a weighted average. You multiply each possible value by the probability of it happening, and then add them all up.

\(E[X] = \sum x \cdot P(X = x)\)

Example: Imagine a game where you win \$10 with a 20% chance and \$0 with an 80% chance.
\(E[X] = (10 \times 0.20) + (0 \times 0.80) = \$2\). \n
Even though you will never actually win exactly \$2 in a single game, if you played 1,000 times, you’d expect to average \$2 per game.

\n\n

The Continuous Case

\n

If \(X\) is continuous (like the exact time it takes for a claim to arrive), we use integration instead of summation. It’s the same logic, just applied to a smooth curve.

\n

\(E[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx\)

\n

Quick Review: To find the expectation, just remember: Value \(\times\) Probability, then sum (or integrate) it all up!

\n\n

2. The Properties of Expectations

\n

Expectations are "well-behaved." They follow some simple rules that make our lives much easier:

\n

1. Linearity: \(E[aX + b] = aE[X] + b\). If you double everyone’s insurance claim and add \$5, the average claim also doubles and increases by \$5.
2. Sums: \(E[X + Y] = E[X] + E[Y]\). The average of the total is the sum of the averages.

Common Mistake to Avoid:

Many students think \(E[X^2]\) is the same as \((E[X])^2\). This is not true! Always calculate \(E[X^2]\) separately by summing \(x^2 \cdot P(X=x)\).

3. Conditional Expectation: Adding a "Given"

This is where things get interesting. Sometimes, we have extra information. For example, what is the expected claim size given that we know the policyholder is under age 25?

The Conditional Expectation \(E[X|Y=y]\) is the average of \(X\) calculated only using the cases where \(Y\) takes the value \(y\).

How to Calculate It:

1. Find the conditional probability \(P(X|Y)\) or the conditional density \(f(x|y)\).
2. Use the standard expectation formula, but use that conditional probability instead of the regular one.

\(E[X|Y=y] = \sum x \cdot P(X=x|Y=y)\) (Discrete)
\(E[X|Y=y] = \int x \cdot f(x|y) \, dx\) (Continuous)

Did you know? In actuarial work, conditional expectation is used for experience rating. If a driver has 3 accidents in a year, we "condition" our expectation of their future claims on that specific piece of information!

4. The Law of Total Expectation

This is a favorite for IFoA examiners! It’s also known as the Law of Iterated Expectations or the "Tower Property."

It states: \(E[X] = E[E[X|Y]]\)

Wait, what does that mean?
Think of it this way: To find the overall average of \(X\), you can first find the averages for different groups (\(E[X|Y]\)) and then take the average of those group averages.

Analogy: The School Exam

Imagine you want the average exam score for a whole school.
1. First, find the average score for each individual class (\(E[X|Class]\)).
2. Then, take the average of those class averages, weighted by how many students are in each class.
That gives you the total school average (\(E[X]\)).

5. Variance and Conditional Variance

Expectation tells us the "center," but Variance tells us how spread out the values are.
The standard formula is: \(Var(X) = E[X^2] - (E[X])^2\).

The Law of Total Variance

This formula looks intimidating, but let's break it down:
\(Var(X) = E[Var(X|Y)] + Var(E[X|Y])\)

Mnemonic: "The Expectation of the Variance plus the Variance of the Expectation." (E-V plus V-E).

This formula splits total risk into two parts:
1. \(E[Var(X|Y)]\): The "within-group" variation. (The average amount of uncertainty inside each group).
2. \(Var(E[X|Y])\): The "between-group" variation. (How much the averages of the groups differ from each other).

6. Summary and Key Takeaways

Congratulations! You’ve covered the core concepts of evaluating expectations. Here’s what you should remember for your revision:

- Expectation is the weighted average: Multiply outcomes by their probabilities.
- Linearity: You can move constants out of the expectation bracket.
- Conditionality: Use \(E[X|Y]\) when you have extra information that changes the probabilities.
- Law of Total Expectation: \(E[X] = E[E[X|Y]]\). Use this when \(X\) depends on some other factor \(Y\).
- Law of Total Variance: \(Var(X) = E[Var(X|Y)] + Var(E[X|Y])\). This helps decompose risk into different sources.

Final Tip: When you see a problem where one random variable depends on another (e.g., the number of claims depends on the weather), your mind should immediately jump to Conditional Expectations! Keep practicing, and these formulas will become second nature.