Sub topic 3
Probability Distributions
Assume you know basic probability, fractions, percentages, and averages. This chapter uses a random variable, a numerical value produced by a random process. A probability distribution lists the possible values of a random variable and the probability of each value.
For a valid discrete distribution:
- Every probability is between 0 and 1.
- The probabilities add to 1.
- Each probability describes how likely its corresponding value is.
For example, let \(X\) be the number of questions a student answers correctly on a short quiz.
| Value of X | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Probability | 0.10 | 0.20 | 0.30 | 0.40 |
The probabilities add to \(0.10+0.20+0.30+0.40=1\), so this is a valid distribution.
Reading a distribution
A distribution is more than a list of possible outcomes. It tells you how probability is spread across those outcomes. Here, larger scores are more likely than smaller scores.
A random variable can be:
- Discrete, meaning it has separate, countable values, such as 0, 1, 2, or 3 correct answers.
- Continuous, meaning it can take any value in an interval, such as a person’s height or the exact time needed to finish a test.
For a continuous variable, the probability of one exact value is usually 0. Probabilities come from intervals, such as the probability that a test time is between 30 and 40 minutes. Later, the normal distribution will describe continuous variables with a bell-shaped curve.
Expected value from a distribution
The expected value, written \(E(X)\), is the long-run average value. It is a weighted average, so more likely values have more influence:
\[ E(X)=\sum xP(X=x) \]
For the quiz distribution:
\[ E(X)=0(0.10)+1(0.20)+2(0.30)+3(0.40)=2.0 \]
The expected score is 2 correct answers. This does not mean every student scores exactly 2. It means the average score would approach 2 over many similar quizzes.
from fractions import Fraction
values = [1, 2, 3, 4]
probs = [Fraction(1, 10), Fraction(2, 10), Fraction(3, 10), Fraction(4, 10)]
mean = sum(v * p for v, p in zip(values, probs))
variance = sum((v - mean) ** 2 * p for v, p in zip(values, probs))
print(mean, variance) # 3 1Common GRE errors
Do not calculate the ordinary average of the possible values unless all values are equally likely. In the code example, the values average to 2.5, but the expected value is 3 because larger values have larger probabilities.
Also distinguish \(P(X=x)\), the probability of one value, from \(P(X\leq x)\), the probability of that value or anything smaller. A question asking for “at most 3” includes every value through 3.
Exercise
A random variable X has values 2, 4, and 10 with probabilities 0.5, 0.3, and 0.2. What is E(X)?
Show answer
E(X) = 2(0.5) + 4(0.3) + 10(0.2) = 4.2.