Welcome to Discrete Random Variables!

In this chapter of your S1: Statistics course, we are moving from simple "what are the chances?" questions to predicting the long-term behavior of events. Whether you are interested in game design, finance, or science, understanding how "randomness" follows certain patterns is incredibly powerful.

We will learn how to organize possible outcomes, calculate "average" expectations, and measure how much results vary. Don't worry if it seems a bit abstract at first—we will break it down using simple examples like rolling dice and playing games!

1. What is a Discrete Random Variable?

Let's break the name down:
Discrete: This means the outcomes are distinct, separate values (like 1, 2, 3) rather than a continuous scale (like height or weight).
Random: The outcome depends on chance.
Variable: It can take on different values.

The Probability Distribution
This is simply a list (usually a table) of all the possible values a variable \(X\) can take, and the probability of each one happening.
Example: If \(X\) is the number of heads when flipping two coins:
\(X\) can be 0, 1, or 2.
\(P(X=0) = 0.25\)
\(P(X=1) = 0.50\)
\(P(X=2) = 0.25\)

Important Rule: The sum of all probabilities in a distribution must equal 1.
\( \sum P(X=x) = 1 \)

Quick Review:
X (capital) represents the "name" of the experiment (e.g., "The Score").
x (lowercase) represents the specific result (e.g., "The score was 5").

2. Expected Value: The "Average" Outcome

The Expected Value, written as \(E(X)\) or the Greek letter \(\mu\) (mu), is the mean value you would expect if you ran the experiment many, many times.

The Formula:
\( E(X) = \mu = \sum x_i p_i \)

How to calculate it step-by-step:
1. Multiply each possible value (\(x\)) by its probability (\(p\)).
2. Add all those results together.
Analogy: It’s like a "weighted average" where the outcomes that happen more often have more "pull" on the final result.

Expectation of a function:
If you want to find the expected value of a changed version of your data, like \(X^2\), you use:
\( E(g(X)) = \sum g(x_i) p_i \)
Example: To find \(E(X^2)\), you square each \(x\) value before multiplying by the probability.

Key Takeaway: \(E(X)\) isn't necessarily a value that will happen (e.g., the expected value of a die roll is 3.5, even though you can't roll a 3.5!). It is the long-term average.

3. Variance and Standard Deviation: Measuring Spread

The Variance, written as \(\text{Var}(X)\) or \(\sigma^2\), tells us how spread out the results are. A high variance means the results are "all over the place," while a low variance means they are consistent.

The Formula:
\( \text{Var}(X) = \sigma^2 = E(X^2) - [E(X)]^2 \)

Memory Trick: Think of it as "The Mean of the Squares minus the Square of the Mean."

Standard Deviation:
The Standard Deviation (\(\sigma\)) is simply the square root of the variance.
\( \sigma = \sqrt{\text{Var}(X)} \)

Common Mistake to Avoid: When calculating \(\text{Var}(X)\), students often forget to square the mean (\(\mu\)) at the end. Always double-check your subtraction step!

4. Coding and Linear Transformations

Sometimes we want to change our data—perhaps by adding a bonus score to everyone or doubling all the results. We use these rules to find the new Mean and Variance without recalculating everything from scratch.

The Rules:
1. Expectation: \( E(aX + b) = aE(X) + b \)
(Everything affects the mean: adding, subtracting, multiplying, and dividing.)
2. Variance: \( \text{Var}(aX + b) = a^2 \text{Var}(X) \)
(Adding or subtracting a constant \(b\) does NOT change the spread. Multiplying by \(a\) changes the variance by \(a^2\).)

Analogy: Imagine a group of people standing on a bus. If the bus moves 10 meters forward (\(+b\)), the "average position" moves 10 meters, but the distance between the people (the spread) stays exactly the same!

5. Independent Random Variables

What happens if we have two different random variables, \(X\) and \(Y\), that don't affect each other? We can combine them!

Sum and Difference:
• \( E(aX \pm bY) = aE(X) \pm bE(Y) \)
• \( \text{Var}(aX \pm bY) = a^2 \text{Var}(X) + b^2 \text{Var}(Y) \)

Important Note: Notice that for Variance, we always add the components, even if we are subtracting the variables (\(X - Y\)). This is because combining two random events always increases the total uncertainty or "messiness."

Quick Review for Sums:
If you have many identical independent variables \(X_1, X_2... X_n\):
• \( E(\sum X_i) = \sum E(X_i) \)
• \( \text{Var}(\sum X_i) = \sum \text{Var}(X_i) \)

6. The Bernoulli and Binomial Distributions

These are special types of discrete distributions that follow very specific rules.

Bernoulli Distribution

This is the simplest experiment possible: there are only two outcomes, Success (1) or Failure (0).
Let \(p\) be the probability of success.
• \( E(X) = p \)
• \( \text{Var}(X) = p(1 - p) \)

Binomial Distribution

A Binomial Distribution happens when you repeat a Bernoulli trial \(n\) times (e.g., flipping a coin 10 times).
Conditions:
1. Fixed number of trials (\(n\)).
2. Only two outcomes (Success/Failure).
3. Probability of success (\(p\)) is constant.
4. Trials are independent.

Notation: \( X \sim B(n, p) \)

Mean and Variance of Binomial:
Mean: \( E(X) = np \)
Variance: \( \text{Var}(X) = np(1 - p) \)
Standard Deviation: \( \sigma = \sqrt{np(1 - p)} \)

Did you know? The word "Binomial" comes from "bi" (two) and "nomen" (name/term). It literally refers to the two possible outcomes of each trial!

Key Takeaway: If a question mentions "number of successes," "hits or misses," or "fixed number of trials," immediately check if it fits the Binomial criteria!

Summary Checklist

Before moving to the next chapter, make sure you can:
• Check if a probability distribution is valid (sum = 1).
• Calculate \(E(X)\) and \(\text{Var}(X)\) from a table.
• Apply linear transformation rules for \(E(aX+b)\) and \(\text{Var}(aX+b)\).
• Combine independent variables \(X\) and \(Y\).
• Identify a Binomial distribution and use the \(np\) and \(np(1-p)\) shortcuts.