Random Variables Made Easy
Imagine you’re sitting in an exam hall for a multiple-choice test. The test has 10 questions, and each question has 4 options. The problem? The exam is on history, but you spent all your time studying political science. Completely clueless, you decide to guess on every question. Since you have no idea, each answer has an equal chance of being right or wrong.
Your total score is now uncertain. It could be 0, 1, 2 … all the way up to 10, depending entirely on luck. So, what are the chances of ending up with a particular score?
Since you’re just guessing, each question has a 1 in 4 chance of being correct and a 3 in 4 chance of being wrong. Your total score depends on how many questions you happen to get right out of 10. For example:
- There’s only one way to score 0. Getting every question wrong.
- There are many ways to score 3, because you could be right on questions 1, 4, and 7, or 2, 6, and 9, and so on.
Let’s consider a particular score, say 3 correct answers. First, we count the number of ways to choose 3 questions to get right out of 10. That is given by 10C3. Then we multiply by the probabilities of getting those questions right and the remaining ones wrong.
Introducing the Random Variable
Here, your total score is an example of a random variable. It qualifies as a random variable because:
- It assigns a numerical value (0, 1, 2 … 10) to each possible outcome of the random process (guessing on 10 questions).
- Its value is uncertain until the process is completed. You don’t know the total score in advance.
- We can compute probabilities for each possible score, like the probability of scoring 0, 3, or any other number of correct answers.
- The probabilities of all possible scores sum to 1, because one of the possible scores must occur.
We usually denote a random variable with a letter, like X, so here we write:
X = total number of correct answers on the test
Now, instead of calculating probabilities individually, we can use the general formula for any score k:
where,
· k is any possible score (0 through 10)
· 10Ck counts the number of ways to get exactly k correct answers.
· (1/4)^k is the probability of getting those k questions right
· (3/4)^(10-k) is the probability of getting the rest wrong
Get Abhiroop’s stories in your inbox
Join Medium for free to get updates from this writer.
This kind of setup, where we count the number of successes in a fixed number of independent trials with the same probability of success, is known in statistics as a binomial distribution.
Probability Mass Function:
Instead of getting stuck in the formula, let’s see for ourselves how the probabilities change for different scores. That’s exactly what a Probability Mass Function (PMF) does: it shows the probability of each possible score in a simple graph.
On the x-axis, we put all possible scores (0 to 10), and on the y-axis, we put their corresponding probabilities. Looking at the graph, we can quickly spot which scores are most likely and which are rare.
So, why did we go through all this?
The goal is simple: to give you a realistic idea of what to expect. By looking at the probabilities and the PMF, you can see that if you’re just guessing on a test, you’re most likely to get around 2 or 3 questions right.
Instead of blindly hoping for a high score, this approach helps you set realistic expectations and understand the shape of luck when outcomes are random.
Expected Score: The Long-Run Average
We’ve seen which scores are most likely from the PMF. Now let’s ask a bigger-picture question: what score would you get on average if you kept taking this exam, always guessing?
This is what expectation, or expected value, tells us: the long-run average of a random process.
To make this concrete, imagine taking the 10-question guessing exam 1,000 times. Each time, you randomly guess all the answers and record your total score. Let’s plot the running average of score for 1000 trials.
If you observe the graph, you’d notice:
- In the initial trails, the deviations of the running average were drastic.
- After some repetitions, the running average just hovers near a particular score close to 2.5.
This visualization gives a feel for what expectation is, but we don’t need to simulate and plot every time. Mathematicians have a neat formula to calculate the expected score directly from the probabilities of each outcome.
where, P(X=k) is the probability of scoring exactly k points.
Intuitively, you can think of this as a kind of weighted average. Each possible score contributes to the overall average in proportion to how likely it is. Common scores like 2 or 3 pull the average toward them more strongly, while rare scores like 9 or 10 barely nudge it.
By plugging in the values into the formula, the expected score comes out to be 2.5, which matches exactly what we saw in the long-run average plot.
Final Thoughts
We started with guessing in a simple MCQ test and saw how probability can make sense of uncertainty. By looking at the total score as a random variable, we could figure out the probability of each possible score, visualize it with a PMF, and even estimate the long-run average score using expectation.
But the total score isn’t the only way to define a random variable. For the same 10-question test, we could also look at the number of wrong answers, the number of consecutive correct answers, or even the number of correct answers in the first half of the test. Random variables are just a way to turn different aspects of a random process into numbers we can reason about.





