Math101learn.math101.caRandom Variables
A random variable assigns a numerical value to each outcome of a random process, creating a probability distribution.
A random variable turns outcomes into numbers so probability questions can be analyzed with algebra and statistics.
Definition
A random variable $X$ is a function that assigns a real number to each outcome in a sample space. The capital letter names the variable; lowercase values such as $x$ represent possible outcomes of that variable.
For two coin tosses, $X$ might count heads. Then outcomes TT, HT, TH, HH map to $0,1,1,2$.
Discrete and continuous variables
A discrete random variable has countable possible values, such as number of absences or goals. A continuous random variable can take any value in an interval, such as time, height, or temperature under an idealized model.
Discrete probabilities are assigned to points; continuous probabilities are represented by areas over intervals.
Probability mass function
For a discrete variable, the probability mass function gives
It must satisfy
and
A table of values and probabilities is a valid distribution only when both conditions hold.
Worked example: number of heads
The value $1$ has higher probability because two sample outcomes map to it.
Cumulative probability
The cumulative distribution function is
For a discrete variable, it adds all probabilities at or below $x$. It never decreases and eventually approaches $1$.
Questions using “at most” correspond to $\le$, while “at least” corresponds to $\ge$ and may be easier through a complement.
Expected value
The mean or expected value of a discrete random variable is
It is the long-run average over many repetitions, not necessarily a value the variable can actually take.
For the two-coin example, $E[X]=0(1/4)+1(1/2)+2(1/4)=1$.
Variance and spread
Variance measures average squared distance from the mean:
Standard deviation is its square root. Two random variables can share the same expected value while differing greatly in risk or variability.
Transforming a random variable
If $Y=aX+b$, then
Variance satisfies
Adding a constant shifts outcomes without changing spread; scaling multiplies standard deviation by $|a|$.
Building a model
Define exactly what $X$ measures, list its possible values, and combine sample outcomes that produce the same value. Assign probabilities from equally likely outcomes, observed frequencies, or a stated model.
The validity of conclusions depends on whether the probability model matches the process.
Common mistakes
Treating the random variable as the random process itself. It is a numerical mapping of outcomes.
Assigning equal probabilities to variable values because sample outcomes are equal. Multiple outcomes may map to one value.
Accepting probabilities that do not total $1$. Check the distribution.
Interpreting expected value as a guaranteed next outcome. It is a long-run average.
Confusing discrete point probability with continuous probability. Continuous models use interval area.
Quick self-check
- What numerical quantity does $X$ represent?
- Is it discrete or continuous?
- Have all possible values and their probabilities been included?
- Are probabilities nonnegative and total $1$?
- Do “at least” and “at most” translate to correct inequalities?
- Are mean and spread interpreted as model summaries rather than guarantees?
Related topics
Explore the idea
Probability sampler
Change one quantity at a time and connect what moves to Random Variables.
success other outcome
Try it yourself
Hints are part of learning. Open one whenever it makes the next step feel possible.
Two fair coins are tossed and X counts heads. What is P(X ≥ 1)?
- Only TT has zero heads.
- P(X ≥ 1) = 1 − 1/4 = 3/4.
End of lesson
Nice work making it this far.
Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.
