Discrete variables, expectation and variance

Build probability distributions, check moments and transformations, and compare dependent and independent reward rules.

More
Reading settingsKeep track of this lesson

Read offline with Premium

Save lessons and their figures on this device to read without an internet connection. Offline saving is included with Premium.

Connect at least once every 30 days to confirm Premium. Topic checks, coaching and sync need a connection.

Find this activity in your course
On this page

Reading settings

Colour theme, text size, line spacing and reading width for your lessons.

Colour theme
Text size
Line spacing
Reading width
Revision Mode

Keep just the revision notes by hiding embedded questions and activities, including worked examples. Your choice follows your account across both subjects and devices. Turn off to show the full lesson again.

Checking Premium access…

Explore Premium

Live preview

Take a moment to read at your own pace. Choose the text size and spacing that feel comfortable for you.

Pause after each idea, then explain it in your own words before moving on.

Narrower lines take effect when the screen has room.

Enlarged diagram

Turn outcomes into a probability distribution

A random variable assigns a number to each outcome of an experiment. Several outcomes can give the same number. Suppose ten equally likely tickets carry points: two tickets show 0, five show 1 and three show 3. Let X be the points on one uniformly drawn ticket.

Value xNumber of ticketsP(X = x)
020.2
150.5
330.3

X is discrete: its possible values are separate numbers, here 0, 1 and 3. The points are not equally likely just because there are three different values. The probability of each value comes from all tickets giving that value.

A valid distribution gives non-negative probabilities that sum to one. List every possible value, combine outcomes giving the same value and check the total before calculating a mean. Here P(X ≥ 1) = 0.5 + 0.3 = 0.8, whereas P(X = 2) = 0 because no ticket has two points.

Check your understanding 1 Different groups can give the same value

Every ticket in the following four disjoint groups is equally likely to be drawn. The groups together contain all the tickets. Let X be the value on the selected ticket. Build the distribution of X, listing each distinct value with its probability.

GroupValue on a ticketNumber of tickets
A−12
B13
C−11
D24
Show answer

There are ten tickets. Groups A and C both give X = −1, so their counts combine: P(X = -1) = (2 + 1)/10 = 3/10. The other probabilities are P(X = 1) = 3/10 and P(X = 2) = 4/10 = 2/5. The probabilities sum to one. Counting four groups as four equally likely results would ignore their different numbers of tickets; listing −1 twice would not give one probability for each distinct value.

In a finite distribution, values with probability zero contribute nothing to an event probability or moment. If asked for values with positive probability, omit zero-probability entries. A table that explicitly asks for the probability at a listed value can still require a zero there.

Expectation is a probability-weighted mean

For values x with probabilities p(x),

E(X) = ∑ x p(x).

Multiply each possible value by its probability, then add. For the ticket variable,

E(X) = 0(0.2) + 1(0.5) + 3(0.3) = 1.4.

This is the mean of its distribution, not the most likely value and not a possible ticket value. The most likely value is 1; no single draw gives 1.4. If you repeatedly replace the drawn ticket, mix and draw uniformly again, the average points over many draws tends towards 1.4.

Probabilities are weights, so dividing 0 + 1 + 3 by three would describe an experiment choosing the three point values equally often. It would not describe the ten tickets. Also, E(X) = 1.4 is a count summary, not a probability: it need not lie between zero and one. A weighted mean must lie between the smallest and largest possible values, which is a useful first check.

Check your understanding 2 Resolve the probability before calculating

A variable T takes values −1, 0 and 2 with respective probabilities k, 2k and 1 − 3k. Find the full range of k making this a valid distribution. Then find k if E(T) = 0.6 and write the resulting probabilities.

Show answer

The probabilities already sum to one for every k, but that alone is insufficient. Non-negativity gives k ≥ 0 and 1-3k ≥ 0, hence 0 ≤ k ≤ 1/3. Within that range no individual probability exceeds one.

The mean is (-1)k + 0(2k) + 2(1-3k) = 2-7k. Setting this equal to 0.6 gives k = 0.2. The probabilities are 0.2, 0.4 and 0.4. Substitution checks both the total and the mean; k = 0.4 would sum to one but give a negative probability for T = 2.

Square deviations to measure spread

Let μ = E(X). Variance is the expected squared distance from that mean:

Var(X) = E[(X-μ)²].

For the tickets, the three squared distances are 1.96, 0.16 and 2.56. Weight them by the probabilities:

Var(X) = 1.96(0.2) + 0.16(0.5) + 2.56(0.3) = 1.24.

The signs of the deviations disappear when squared; all terms are non-negative. Simply averaging signed deviations would give zero and hide the spread.

An equivalent calculation uses the second moment E(X²):

Var(X) = E(X²)-[E(X)]².
xx²x²P(X = x)
000
110.5
392.7

Thus E(X²) = 3.2 and Var(X) = 3.2 − 1.4² = 1.24, agreeing with the squared-deviation calculation. Square each value before weighting it for E(X²); squaring the weighted mean gives the separate quantity [E(X)]² = 1.96.

The standard deviation is square root of 1.24 ≈ 1.114 points; variance is measured in points squared. Keep unrounded moments in the subtraction. A noticeably negative variance signals inconsistent data or a calculation error. If large nearly equal moments lose precision, the weighted squared-deviation form avoids that subtraction.

Check your understanding 3 Compute the second moment before subtracting

X takes values −1 and 2 with probabilities 0.4 and 0.6. Find E(X), E(X²), Var(X) and the standard deviation to three significant figures. Verify the variance using squared deviations from the mean.

Show answer

The mean is (-1)(0.4) + 2(0.6) = 0.8. The second moment is (-1)²(0.4) + 2²(0.6) = 2.8. Variance is 2.8-0.8² = 2.16, and standard deviation is square root of 2.16 ≈ 1.47.

The alternative is (-1-0.8)²(0.4) + (2-0.8)²(0.6) = 3.24(0.4) + 1.44(0.6) = 2.16. The negative value −1 contributes a positive square; using −1 instead of (−1)² in the second moment would be a sign error.

A transformed value comes from the same draw

Return to the original ticket distribution: X takes 0, 1 and 3 with probabilities 0.2, 0.5 and 0.3. Define Y = 2X − 1. Y takes −1, 1 and 5 with those same respective probabilities. Changing the value attached to a draw does not change which ticket was drawn.

For constants a and b,

E(aX + b) = aE(X) + b,
Var(aX + b) = a²Var(X).

So E(Y) = 2(1.4) − 1 = 1.8 and Var(Y) = 4(1.24) = 4.96. The shift moves the mean but does not change distances between values. Multiplying deviations by a multiplies their squares by a²; a negative multiplier reverses value order but cannot make variance negative.

For a general function h, use E[h(X)] = ∑ h(x)p(x). Do not replace this with h(E(X)). For example, E(X²) = 3.2 differs from [E(X)]² = 1.96. If a transformation sends two values to the same result, combine their probabilities in the new distribution.

Check your understanding 4 Build the transformed distribution

Using the original ticket variable, let H = X(X − 1). Find H’s distribution, expectation and variance. Compare E(H) with E(X)[E(X) − 1].

Show answer

X = 0 and X = 1 both give H = 0, so P(H = 0) = 0.2 + 0.5 = 0.7. X = 3 gives H = 6 with probability 0.3. These are H’s only two values.

Then E(H) = 0(0.7) + 6(0.3) = 1.8 and E(H²) = 36(0.3) = 10.8. Thus Var(H) = 10.8 − 1.8² = 7.56. By contrast, E(X)[E(X) − 1] = 1.4(0.4) = 0.56. As an alternative expectation calculation, E(X²-X) = E(X²)-E(X) = 3.2-1.4 = 1.8; linearity applies to the two terms, not to substituting a mean inside a product.

Distinguish a second variable from a second use of X

For any two variables X and W with finite expectations, whether dependent or independent,

E(aX + bW) = aE(X) + bE(W).

If X and W are independent with finite variances, their variances combine as

Var(aX + bW) = a²Var(X) + b²Var(W).

The second rule needs independence, or another justified reason for a zero dependence contribution. The first rule does not. A minus sign in b does not subtract variance: b is squared.

For example, Y = 2X − 1 is determined by X, so X and Y are not independent here. Instead of adding their variances as though they came from separate draws, rewrite X + Y = 3X-1. Its variance is 9(1.24) = 11.16, not 1.24 + 4.96 = 6.20.

If W is the points from a fresh uniform draw after replacing and mixing the ticket, X and W are independent and have the same distribution. Then X + W has mean 2.8 and variance 2.48. By contrast, 2X has the same mean 2.8 but variance 4.96. Paying twice the points from one draw is not the same random experiment as adding points from two fresh draws.

Check your understanding 5 Check a sum rule against actual outcomes

For independent ticket draws X and W, find E(X − W), Var(X − W) and P(X − W > 0). Explain why subtracting the equal variances or assigning probability 1/2 to a positive difference would each be wrong.

Show answer

The mean is 1.4 − 1.4 = 0. Independence gives variance 1.24 + (-1)²(1.24) = 2.48. Both draws vary, so their difference is not fixed at zero merely because their means agree.

For a positive difference, the ordered pairs (X,W) are (1,0), (3,0) and (3,1). Their probabilities add to 0.5(0.2) + 0.3(0.2) + 0.3(0.5) = 0.31. Symmetry gives P(X − W < 0) = 0.31 too, but ties have probability 0.2² + 0.5² + 0.3² = 0.38. The positive and negative probabilities add to 0.62, not one. A zero mean neither eliminates spread nor excludes a tie.

Try it yourself 1

Compare two reward rules

Minimal support

Problem

Use the ten-ticket experiment from this lesson. One draw gives X points; a second draw after replacement and mixing gives independent W with the same distribution. Rule A pays 3X credits. Rule B pays 2X + W credits: the first draw’s points are used twice, and the second draw’s points once.

Find the entry fee that makes expected net profit zero for each rule. At that fee, calculate each net profit’s variance and the probability of a strictly positive net profit. Compare the rules using these results, and explain why a fair fee does not guarantee breaking even on a single play.

Write your answer, then compare it with the solution

Hints

Hint 1

Keep track of which points came from which draw

Subtract the fixed fee from each reward to define net profit. For spread, combine repeated uses of the same draw before using independence. For a positive profit, list the point pairs satisfying the reward inequality.

Show full solution
  1. Choose a fee from expected reward

    Method

    Set each reward’s mean minus its fee equal to zero.

    Reason

    A fair fee in this question means zero expected net profit, rather than an equal probability of winning and losing.

    Working

    Answer

    E(3X) = 3(1.4) = 4.2 and E(2X + W) = 2(1.4) + 1.4 = 4.2. The fee is 4.20 credits for either rule. The net profits are A = 3X − 4.2 and B = 2X + W − 4.2.
  2. Calculate the spread of net profit

    Method

    Square each coefficient of an independent draw; the fixed fee changes no variance.

    Reason

    Rule A repeats one draw three times. Rule B repeats the first draw twice and adds one independent second draw.

    Working

    Answer

    Var(A) = 9(1.24) = 11.16 credits squared. For B, independence gives Var(B) = 4(1.24) + 1.24 = 6.20 credits squared. Treating three terms as three independent draws would give 3.72 for either rule, which describes neither experiment.
  3. Count strictly profitable outcomes

    Method

    Test each rule against its fee, using the original value probabilities.

    Reason

    A mean and a variance do not by themselves give the chance of a positive profit.

    Working

    Answer

    For A, 3X > 4.2 holds only for X = 3, so P(A > 0) = 0.3. For B, 2X + W > 4.2 holds for X = 3 with any W, or for X = 1 and W = 3. These disjoint events have total probability 0.3 + 0.5(0.3) = 0.45. Rule B has lower variance and a larger positive-profit probability here, with the same zero expected net profit. Neither rule guarantees a non-negative result: X = 0 loses under A, and (X,W) = (0,0) loses under B. A fair expectation describes repeated play; it is not a promise for an individual play.

Keep track of this lesson

Mark the lesson done when you have worked through it.

Lesson progress is optional and kept on this device.

Your lesson mark records your own study. Checks are kept separately in My Learning.