Welcome to Discrete Random Variables!

In this chapter, we are moving from basic probability to the world of Random Variables. Don't let the name scare you! A random variable is simply a way to link the outcomes of a random event (like rolling a die or tossing a coin) to numbers. We focus on Discrete variables, which means we can count the outcomes (like 0, 1, 2...).

By the end of these notes, you’ll be able to calculate averages and "spreads" for these variables and understand the special Discrete Uniform Distribution. Let's dive in!

5.1 The Concept of a Discrete Random Variable

Imagine you are flipping a coin three times. The outcomes are things like "Heads, Tails, Heads." In Statistics, we want to turn those words into numbers. We might say, "Let \(X\) be the number of Heads."

Key Terms:
- Random Variable: A quantity whose value depends on the outcome of a random event.
- Discrete: This means the variable can only take specific, distinct values. You can have 1 sibling or 2, but never 1.5 siblings! Common examples include scores on a test, the number of cars in a car park, or the result of a die roll.

The Rules of the Game

For any Discrete Random Variable (DRV), there are two golden rules you must remember:
1. Every individual probability must be between 0 and 1: \(0 \le P(X=x) \le 1\).
2. The sum of all possible probabilities must equal 1: \(\sum P(X=x) = 1\).

Quick Review Box:
If a question asks you to find a missing value \(k\) in a probability table, just add up all the other probabilities and subtract from 1!

Summary: A discrete random variable assigns numbers to outcomes that we can count. All probabilities in a distribution must add up to exactly 1.

5.2 Probability and Cumulative Distribution Functions

We can describe a DRV in two main ways: using a table or using a formula.

The Probability Function, \(p(x)\)

This is just a fancy way of saying "the probability that \(X\) takes the value \(x\)."
Notation: \(P(X = x)\)

Example: If you roll a fair 6-sided die, the probability function is \(P(X = x) = \frac{1}{6}\) for \(x = 1, 2, 3, 4, 5, 6\).

The Cumulative Distribution Function, \(F(x)\)

Think of this as a "running total" of probabilities. The word "cumulative" means "adding up as you go."
Notation: \(F(x_0) = P(X \le x_0)\)

How to calculate it: To find \(F(3)\), you add up the probabilities for \(X=1\), \(X=2\), and \(X=3\).
\(F(x_0) = \sum_{x \le x_0} P(X=x)\)

Did you know?
The very last value of a cumulative distribution function \(F(x)\) will always be 1, because by the time you reach the final outcome, you’ve accounted for 100% of the possibilities!

Common Mistake to Avoid:
Confusing \(P(X < 3)\) with \(P(X \le 3)\). In discrete math, these are different! \(P(X < 3)\) only includes 1 and 2, while \(P(X \le 3)\) includes 1, 2, and 3.

Summary: \(P(X=x)\) gives the probability of a specific value. \(F(x)\) gives the probability of being "up to and including" that value.

5.3 Mean and Variance of a Discrete Random Variable

Just like we find the average and spread of a list of numbers, we can find the Expected Value (Mean) and Variance of a random variable.

Expected Value, \(E(X)\)

The Expected Value is the long-term average. If you performed the experiment thousands of times, this is the average result you would get.
Formula: \(E(X) = \sum x \cdot P(X=x)\)

Step-by-step:
1. Multiply each value (\(x\)) by its probability (\(P(X=x)\)).
2. Add all those results together.

Variance, \(Var(X)\)

This measures how much the values "spread out" from the mean.
Formula: \(Var(X) = E(X^2) - [E(X)]^2\)

Memory Aid: "The Mean of the Squares minus the Square of the Mean." (MS - SM).
To find \(E(X^2)\), just square each \(x\) value first, then multiply by the probability: \(\sum x^2 \cdot P(X=x)\).

Linear Transformations

Sometimes we change our variable, like doubling a score and adding 5: \(Y = 2X + 5\). Here are the shortcuts:
- Expectation: \(E(aX + b) = aE(X) + b\) (Everything affects the mean!)
- Variance: \(Var(aX + b) = a^2 Var(X)\) (Only the multiplier \(a\) affects variance, and it must be squared. Adding \(b\) doesn't change the spread!)

Analogy: Imagine a group of students standing in a line. If everyone takes two steps to the right (adding \(b\)), the "average" position moves, but the "spread" between the students stays exactly the same!

Summary: \(E(X)\) is the mean, found by \(\sum xP\). \(Var(X)\) is the spread, found by \(E(X^2) - [E(X)]^2\). Adding a constant shifts the mean but does not change the variance.

5.4 The Discrete Uniform Distribution

This is a special case where every outcome is equally likely. The most common example is a fair die or a spinner with equal sections.

If a variable \(X\) can take values \(1, 2, 3, ..., n\), and the probability for each is \(\frac{1}{n}\), then \(X\) follows a Discrete Uniform Distribution.

Properties of a Uniform Distribution (from 1 to \(n\)):

- Mean: \(E(X) = \frac{n+1}{2}\)
- Variance: \(Var(X) = \frac{(n+1)(n-1)}{12}\)

Don't worry if this seems tricky!
You don't always have to use these specific formulas for the uniform distribution. You can still use the standard \(\sum xP\) and \(E(X^2) - [E(X)]^2\) methods we learned in the previous section. They will give you the same answer!

Summary: In a uniform distribution, all probabilities are the same. You can use shortcuts for the mean and variance if the outcomes are consecutive integers starting from 1.

Final Chapter Wrap-up

Key Takeaways:
- Discrete variables are countable.
- The sum of all probabilities is always 1.
- \(F(x)\) is the "less than or equal to" probability.
- \(E(X)\) is the mean; \(Var(X)\) is the spread.
- For \(Var(aX+b)\), remember to square the \(a\) and ignore the \(b\)!

Keep practicing those table calculations—once you get the rhythm of multiplying and adding, this chapter becomes one of the most predictable parts of the S1 exam!