Random variables

Toss two coins and you cannot predict the outcome, but you can predict, with total precision, how often each number of heads will show up over many repeats. That is the trick a random variable performs: it converts a messy, unpredictable experiment into a plain number, and then a probability distribution tells you exactly how the chances are spread across the values that number can take. This closes the Probability unit of the ISC Class 12 syllabus, sitting right after Bayes' Theorem. The two skills examined here are building a distribution table from a sample space, and computing its mean E(X)E(X) — the single number that summarises the whole table as a long-run average. Variance, standard deviation and named distributions like the binomial sit outside this Paper I scope; this article stays inside the boundary and goes deep on the two ideas that are actually tested: the distribution table and the mean.

The core insight

A random variable turns each outcome of a chance experiment into a number, its probability distribution assigns a probability pi≥0p_i \ge 0 (summing to 11) to every value xix_i, and the mean E(X)=∑xipiE(X) = \sum x_i p_i is the probability-weighted average that summarises the distribution in one number.

The core idea

A random variable is a rule, not a guess. Formally, XX is a function that assigns a real number to every outcome of a random experiment — it does not itself involve any chance; the chance lives in which outcome occurs, and XX just reads off a number for whichever one does. When two coins are tossed, defining XX = "number of heads" is a choice: you could equally define YY = "1 if both coins match, else 0" on the same sample space. Once the rule is fixed, every possible value of XX inherits a probability from the underlying sample space.

The distribution table is the complete description of XX. For a discrete random variable taking values x1,x2,…,xnx_1, x_2, \dots, x_n, list every value against its probability pi=P(X=xi)p_i = P(X = x_i):

pi≥0 for all i,∑ipi=1p_i \ge 0 \text{ for all } i, \qquad \sum_i p_i = 1

where: pip_i is the probability of the ii-th value, and the two conditions are non-negotiable — any table violating either one is not a valid probability distribution. Checking ∑pi=1\sum p_i = 1 is the standard sanity check on a given table, and it is also the tool used to solve for an unknown constant buried inside a table, since it produces one equation in that unknown.

The mean condenses the whole table into one number. It is the probability-weighted average of the values XX can take:

E(X)=∑ixi piE(X) = \sum_i x_i\, p_i

where: xix_i are the possible values and pip_i their probabilities. E(X)E(X) is also called the expected value. It need not be a value XX can actually take — a mean of 1.51.5 heads is a perfectly sensible expected value even though no single toss ever shows "1.51.5 heads." Read it as: if you repeated the experiment a huge number of times and averaged the observed values of XX, that average would settle down close to E(X)E(X).

Figure
Bar chart of the probability distribution for the number of heads in two coin tosses showing bars of height one quarter one half and one quarter at X equals zero one and two
Probability distribution of X = number of heads, two coins value of X (heads) P(X) 1/4 X = 0 1/2 X = 1 1/4 X = 2 Bar heights are the probabilities; they sum to 1, and the mean E(X) equals 1
Derivation AWhy the mean formula E(X) = sum of x times p is the right average

The goal is to show that E(X)=∑ixipiE(X) = \sum_i x_i p_i is not an arbitrary formula handed down by a textbook but the exact long-run average you would compute yourself by tallying real repeated trials, so that the formula and the everyday idea of "average" are provably the same number. We derive this using nothing beyond the ordinary arithmetic-mean formula from statistics, applied to a large number of repeated experiments.

Step 1. Suppose the experiment is repeated NN times, where NN is very large, and record the value of XX on every single trial. Let fif_i be the number of times the value xix_i actually occurred among those NN trials, so f1+f2+⋯+fn=Nf_1 + f_2 + \cdots + f_n = N. The ordinary arithmetic mean of all NN recorded values, grouping repeats together, is xˉ=x1f1+x2f2+⋯+xnfnN=∑ixi(fiN)\bar{x} = \dfrac{x_1 f_1 + x_2 f_2 + \cdots + x_n f_n}{N} = \sum_i x_i \left(\dfrac{f_i}{N}\right), exactly as you would compute a class average from a frequency table.

Step 2. Look closely at the ratio fi/Nf_i/N inside that sum. It is the relative frequency of the value xix_i — the fraction of trials on which XX came out equal to xix_i. As the number of repetitions NN grows very large, relative frequency is precisely what probability means in the long run: the empirical proportion fi/Nf_i/N settles down closer and closer to the theoretical probability pi=P(X=xi)p_i = P(X = x_i).

Step 3. Substitute this long-run identification fi/N→pif_i/N \to p_i back into the averaging formula from Step 1. The observed sample average xˉ=∑ixi(fi/N)\bar{x} = \sum_i x_i (f_i/N) then converges to ∑ixipi\sum_i x_i p_i, which is exactly the definition E(X)=∑ixipiE(X) = \sum_i x_i p_i. So the "expected value" formula is nothing more than the ordinary average, written in terms of theoretical probabilities instead of observed frequencies — it is what the average of infinitely many repeated trials would converge to.

Step 4. This also explains why E(X)E(X) need not be one of the actual values xix_i: an ordinary average of a frequency table routinely lands between the listed values (a class average of 6060, 7070, 8080 can easily be 71.571.5, a mark nobody scored), and E(X)E(X) behaves identically, since it is built by the same weighted-average machinery.

Worked example

A random variable XX has the distribution shown below, where kk is a constant to be found.

XX1234
P(X)P(X)kk2k2k3k3k4k4k

Step 1. Use the normalisation condition ∑pi=1\sum p_i = 1 to pin down kk: k+2k+3k+4k=1  ⟹  10k=1  ⟹  k=110k + 2k + 3k + 4k = 1 \implies 10k = 1 \implies k = \tfrac{1}{10}.

Step 2. Write out the actual probabilities: P(X=1)=110P(X{=}1) = \tfrac{1}{10}, P(X=2)=210P(X{=}2) = \tfrac{2}{10}, P(X=3)=310P(X{=}3) = \tfrac{3}{10}, P(X=4)=410P(X{=}4) = \tfrac{4}{10}. All are positive since k>0k > 0, and they sum to 1+2+3+410=1\tfrac{1+2+3+4}{10} = 1, confirming a valid distribution.

Step 3. Compute the mean directly from E(X)=∑xipiE(X) = \sum x_i p_i: E(X)=(1)(110)+(2)(210)+(3)(310)+(4)(410)=1+4+9+1610=3010=3E(X) = (1)\left(\tfrac{1}{10}\right) + (2)\left(\tfrac{2}{10}\right) + (3)\left(\tfrac{3}{10}\right) + (4)\left(\tfrac{4}{10}\right) = \dfrac{1+4+9+16}{10} = \dfrac{30}{10} = 3.

Final answer: k=110k = \tfrac{1}{10} and the mean of XX is 33.

Competitive stretch

Using the same table, find P(X≥3)P(X \ge 3). This is a plain sum of the relevant row entries, not a new formula: P(X≥3)=P(X=3)+P(X=4)=310+410=710P(X \ge 3) = P(X{=}3) + P(X{=}4) = \tfrac{3}{10} + \tfrac{4}{10} = \tfrac{7}{10}. Notice this is bigger than the "half the values" guess of 24\tfrac{2}{4} — because X=3X = 3 and X=4X = 4 carry more probability weight than X=1X = 1 and X=2X = 2, exactly the same weighting idea behind E(X)E(X) itself.

Common traps

  • Forgetting to check (or use) ∑pi=1\sum p_i = 1 — it both validates a given table and is the standard way to solve for an unknown constant like kk.
  • Confusing the mean E(X)E(X) with the mode (the value of highest probability) — in the two-coin example the mean is 11 and the mode is also 11, but they need not coincide in general, and they answer different questions.
  • Counting probabilities by the number of possible values rather than the number of underlying equally-likely outcomes that map to each value — with two coins, X=1X=1 has probability 12\tfrac12 (two outcomes, HTHT and THTH), not 13\tfrac13 (one of three listed values).
  • Reaching for variance, standard deviation, or the binomial formula (nr)prqn−r\binom{n}{r}p^r q^{n-r} — these are boundary/project-only extensions, not core Paper I material for this topic.

Ask the tutor: if setting up a probability distribution table from a fresh word problem (like rolling two dice or drawing balls from a bag) feels tricky, ask the AI tutor to walk through one with you step by step.

Why is E(X) called the mean if it is computed with probabilities instead of a plain average of numbers?

Because it is a plain average — just one written in the language of long-run frequency instead of a finite list of recorded numbers. If you repeated the experiment enormously many times and averaged every observed value of XX the ordinary way (sum of values divided by count), that average would converge to ∑xipi\sum x_i p_i, since relative frequency fi/Nf_i/N approaches the true probability pip_i as NN grows. E(X)E(X) is simply that limiting average, computed in advance using the known probabilities rather than by actually running the trials.

Can the mean of a random variable be a value X never actually takes?

Yes, routinely. In the two-coin example E(X)=1E(X)=1 happens to be an achievable value, but that is a coincidence of that particular table. Consider a fair die roll used as XX: E(X)=3.5E(X) = 3.5, and no roll of a die ever shows 3.53.5. The mean is a weighted average across all possible values, not a prediction of what any single trial will show, so it is completely normal for it to land strictly between two listed values, or even outside the pattern you might intuitively expect.

How do I know when a probability distribution problem wants variance instead of just the mean, and should I compute it anyway?

At the ISC Class 12 Paper I level, variance and standard deviation of a random variable are boundary/project-work material, not core examinable theory for this topic — so unless a question explicitly names variance or standard deviation, stick to the distribution table and E(X)=∑xipiE(X) = \sum x_i p_i. If a question only says "find the probability distribution and its mean," computing extra unrequested quantities wastes time without earning marks; save that effort for questions that actually ask for it.

Before this