Back to homeMathematics · High School Year 3 · Physics-Math · Change subject
Start for free
Prep 3 Tech · Mathematics
Randomness and probability · Discrete distributions. Binomial distribution (BIN)

Random Variables

At the town fair there is a roulette wheel that costs $\$20$ per spin. Is it worth playing? Many real-life questions are numerical: how many breakdowns will the school photocopier have this week? How much can you win in a raffle? A random variable turns the outcome of a random experiment into a number so that we can calculate with it: average it and see how spread out it is.

What a random variable is

Diagram of a discrete random variable that assigns numerical values from 1 to 4 to the outcomes of an experiment. Experiment: generate a number from 1 to 4, equally likely outcome X (number) Here X is the generated number itself: 1, 2, 3, or 4. Discrete: isolated values.

This page works mostly with discrete variables; at the end the continuous case is introduced, which will be used with the normal distribution.

Practice★☆☆Not started
A random number app generates integers from $1$ to $4$, all with equal probability. Let $X$ be the number generated. a) Write down the probability function of $X$ in…

A random number app generates integers from $1$ to $4$, all with equal probability. Let $X$ be the number generated.

  1. a) Write down the probability function of $X$ in table form.
  2. b) Calculate the mean $\mu$.
  3. c) Calculate the standard deviation $\sigma$, rounding to two decimal places.
Solve

Probability function

To describe a discrete variable it is enough to say what probability each possible value has.

Bar chart representing the probability function of a discrete random variable. x₁x₂ x₃x₄ The sum of the heights must be exactly 1
Practice★☆☆Not started
A discrete random variable $X$ takes the values $1$, $2$, $3$ and $4$ with this incomplete probability function: | $x_i$ | $1$ | $2$ | $3$ | $4$ | |---|---|---|---|---|…

A discrete random variable $X$ takes the values $1$, $2$, $3$ and $4$ with this incomplete probability function:

$x_i$ $1$ $2$ $3$ $4$
$p_i$ $0.15$ $k$ $0.35$ $0.25$
  1. a) Calculate the value of $k$.
  2. b) Find $P[X \ge 3]$.
  3. c) Find $P[X < 2]$.
Solve
Practice★☆☆Not started
State, giving reasons, which of the following tables can represent the probability function of a discrete random variable: Table 1: values $1$, $2$, $3$ with…

State, giving reasons, which of the following tables can represent the probability function of a discrete random variable:

  • Table 1: values $1$, $2$, $3$ with probabilities $0.3$; $0.4$; $0.2$.

  • Table 2: values $1$, $2$, $3$, $4$ with probabilities $0.5$; $0.3$; $0.3$; $-0.1$.

  • Table 3: values $1$, $2$, $3$, $4$ with probabilities $0.25$; $0.25$; $0.25$; $0.25$.

In each case, state the condition (or conditions) that are satisfied or violated.

Solve
Practice★☆☆Not started
Two coins are flipped and the number of heads obtained, $X$, is counted. a) Write down the sample space of the experiment and deduce the probability function of $X$. b)…

Two coins are flipped and the number of heads obtained, $X$, is counted.

  1. a) Write down the sample space of the experiment and deduce the probability function of $X$.
  2. b) Calculate the mean $\mu$ and interpret it.
  3. c) Calculate $P[X \ge 1]$.
Solve

Distribution function

Sometimes a cumulative probability ("at most this much") is more useful than the probability of an exact value.

Step graph of the distribution function F(x) with jumps at each value of the variable. 01 23 F(x)
Practice★☆☆Not started
The cumulative distribution function of a discrete random variable $X$ is given by: $F(0) = 0.2 \qquad F(1) = 0.5 \qquad F(2) = 0.8 \qquad F(3) = 1$ a) Calculate…

The cumulative distribution function of a discrete random variable $X$ is given by:

$F(0) = 0.2 \qquad F(1) = 0.5 \qquad F(2) = 0.8 \qquad F(3) = 1$

  1. a) Calculate $P[X \le 2]$.
  2. b) Calculate $P[X = 2]$.
  3. c) Calculate $P[X > 1]$.
Solve
Practice★★☆Not started
The figure shows the cumulative distribution function $F(x)$ of a discrete random variable $X$ that takes the values $0$, $1$, $2$ and $3$. a) Deduce from the graph the…

The figure shows the cumulative distribution function $F(x)$ of a discrete random variable $X$ that takes the values $0$, $1$, $2$ and $3$.

−1 0 1 2 3 4 x 0.2 0.5 0.8 1 y F(x)
  1. a) Deduce from the graph the probability function of $X$ (the values $p_i = P[X = x_i]$) and write it down in table form.
  2. b) Calculate $P[1 \le X < 3]$ using the cumulative distribution function.
  3. c) Find the mean of $X$.
Solve

Mean, variance, and standard deviation

Just as a data table has a mean and a standard deviation, a random variable has its own, calculated with probabilities instead of frequencies.

The mean or expected value as the balance point of a discrete distribution. μ the mean may not match any value of X
Practice★★☆Not started
In a bag for a board game there are $20$ point cards: $6$ cards with a $1$, $4$ cards with a $2$ and $10$ cards with a $3$. A card is drawn at random and its score $X$…

In a bag for a board game there are $20$ point cards: $6$ cards with a $1$, $4$ cards with a $2$ and $10$ cards with a $3$. A card is drawn at random and its score $X$ is noted.

  1. a) Write down the probability function of $X$ in table form.
  2. b) Calculate the mean $\mu$ and interpret it: what average score per card can be expected in the long run?
  3. c) Calculate the standard deviation $\sigma$, rounding to two decimal places.
Solve
Practice★★☆Not started
A discrete random variable $X$ takes the values $1$, $2$, $3$ and $4$ with probabilities proportional to the value itself: $P[X = x] = k \times x$. a) Calculate the…

A discrete random variable $X$ takes the values $1$, $2$, $3$ and $4$ with probabilities proportional to the value itself: $P[X = x] = k \times x$.

  1. a) Calculate the value of the constant $k$.
  2. b) Find the mean $\mu$.
  3. c) Verify that the variance is exactly $1$ and deduce the standard deviation.
Solve
Practice★★★Not started
Amina is studying the variable $X$ = "number of weekly breakdowns of a photocopier", with this probability distribution: | $x_i$ | $0$ | $1$ | $2$ | $3$ |…

Amina is studying the variable $X$ = "number of weekly breakdowns of a photocopier", with this probability distribution:

$x_i$ $0$ $1$ $2$ $3$
$p_i$ $0.1$ $0.3$ $0.4$ $0.2$

She has calculated the mean, $\mu = 1.7$, and then wrote:

«$\sigma^2 = \sum p_i \times x_i^2 - \mu = 3.7 - 1.7 = 2 \implies \sigma = \sqrt{2} \approx 1.41$»

  1. a) Check her calculation of $\sum p_i \times x_i^2$ and confirm that it is correct.
  2. b) Locate the error in the formula she applied for the variance and correct it.
  3. c) Calculate the correct standard deviation.
Solve

Expected value as a criterion: games and raffles

Expected value tells you what happens "on average, if it is repeated many times." It is useful for deciding whether a game, a raffle, or a bet is worthwhile.

Fairness criterion in games of chance depending on whether the expected gain is less than, equal to, or greater than zero. E(G) < 0 E(G) = 0 E(G) > 0 Unfavorable you lose on average in the long run Fair you neither win nor lose Favorable you win on average in the long run
Practice★★☆Not started
The PTA of a high school organizes a charity raffle: it sells $200$ tickets at $\$40$ each, with one prize of $\$2\,000$, four prizes of $\$500…

The PTA of a high school organizes a charity raffle: it sells $200$ tickets at $\$40$ each, with one prize of $\$2\,000$, four prizes of $\$500$ and ten prizes of $\$100$.

  1. a) Write down the probability function of the variable $G$ = "net winnings from buying a ticket" (value of the prize minus the $\$40$ it costs).
  2. b) Calculate the expected value of $G$.
  3. c) Interpret the sign of the result: if the expected value is negative, where does that money go? Does that contradict the charitable purpose of the raffle?
Solve
Practice★★☆Not started
A roulette wheel at a fair has $8$ equal sectors with the prizes shown in the figure: one sector with $\$10$, two with $\$5$, three with $\$2…

A roulette wheel at a fair has $8$ equal sectors with the prizes shown in the figure: one sector with $\$10$, two with $\$5$, three with $\$2$ and two with no prize.

$10 $5 $2 $0 $2 $5 $2 $0 8 equal sectors
  1. a) Write down the probability function of the variable $X$ = "prize obtained in a spin".
  2. b) Calculate the average prize per spin, $\mu$.
  3. c) Playing costs $\$3$ per spin. Define the variable $G$ = "player's net winnings" (prize minus amount paid), calculate its expected value and decide, giving reasons, whether it is advisable to play.
Solve
Practice★★★Not started
At a fairground stall, a game is played with two cubic dice: you win $\$240$ if you roll doubles (both dice the same), $\$120$ if the sum is $7$, and nothing in any…

At a fairground stall, a game is played with two cubic dice: you win $\$240$ if you roll doubles (both dice the same), $\$120$ if the sum is $7$, and nothing in any other case.

  1. a) Calculate the probability of winning each prize and the probability of winning nothing. (Note that rolling doubles and having a sum of $7$ are mutually exclusive events; why?)
  2. b) Find the expected value of the prize per game and deduce what the price of the stake should be for the game to be fair.
  3. c) If the stall charges $\$80$ per game, who does the game favour? How much is a player who plays $100$ games expected to win or lose?
Solve

Linear transformations

Effect of a linear transformation Y = aX + b on the mean and the standard deviation. μX, σX Y = a·X + b μY = a · μX + b σY = |a| · σX

Why do they hold?

If $X$ takes the values $x_i$ with probabilities $p_i$, then $Y=aX+b$ takes the values $a x_i+b$ with those same probabilities $p_i$.

Practice★★★Not started
A discrete random variable $X$ takes the values $0$, $1$, $2$ and $4$, and its cumulative distribution function satisfies:…

A discrete random variable $X$ takes the values $0$, $1$, $2$ and $4$, and its cumulative distribution function satisfies:

$F(0) = 0.1 \qquad F(1) = 0.5 \qquad F(2) = a \qquad F(4) = 1$

  1. a) Knowing that the mean of the distribution is $\mu = 2.2$, set up the equation that allows you to find $a$ and calculate its value.
  2. b) Write down the complete probability function of $X$.
  3. c) Calculate the variance and standard deviation of $X$, rounding to two decimal places.
Solve
Practice★★★Not started
Let $X$ be a discrete random variable with mean $\mu$ and standard deviation $\sigma$, and let $Y = a \times X + b$ be a new variable obtained by applying a linear…

Let $X$ be a discrete random variable with mean $\mu$ and standard deviation $\sigma$, and let $Y = a \times X + b$ be a new variable obtained by applying a linear transformation to $X$.

  1. a) Prove, from the definition of the mean, that $\mu_Y = a \times \mu + b$.
  2. b) Prove that $\sigma_Y = |a| \times \sigma$. Why does the constant $b$ not affect the spread?
  3. c) Application: in an exam, the marks have a mean of $6.2$ and a standard deviation of $1.4$. The teacher decides to transform each mark $X$ into $Y = 0.9 \times X + 1$. Calculate the new mean and the new standard deviation.
Solve

Continuous random variables

When a quantity can take any value in an interval (a time, a length, a weight), a continuous variable is used. Instead of a table, a density function $f(x)$ is used, and the probability of an interval is the area under $f$ between its endpoints. The total area is $1$, just like $\sum p_i=1$ in the discrete case.

Continuous density function: the probability between a and b is the area under the graph. ab area = P(a≤X≤b) f(x) in the continuous case there are no bars: there is area under a curve
Practice★★☆Not started
The waiting time $X$ (in minutes) for the school bus at a stop is uniformly distributed between $0$ and $10$ minutes, that is, its probability density function is…

The waiting time $X$ (in minutes) for the school bus at a stop is uniformly distributed between $0$ and $10$ minutes, that is, its probability density function is constant: $f(x) = k$ for $x \in [0, 10]$ and $f(x) = 0$ elsewhere.

  1. a) Calculate the value of $k$ knowing that the area under the probability density function must be $1$.
  2. b) Find the probability of waiting between $2$ and $5$ minutes.
  3. c) Find the probability of waiting more than $8$ minutes and explain why $P[X = 8] = 0$ even though waiting for exactly $8$ minutes is not impossible.
Solve
Practice★★★Not started
The time (in minutes) it takes for a server to boot after a restart is a continuous random variable $X$ with probability density function $f(x) = k \times x$ for…

The time (in minutes) it takes for a server to boot after a restart is a continuous random variable $X$ with probability density function $f(x) = k \times x$ for $x \in [0, 4]$ and $f(x) = 0$ elsewhere, represented in the figure.

x y 0 1 2 3 4 ? h = ? f(x) = k · x Area = 1
  1. a) Calculate the value of $k$ knowing that the total area under the probability density function must be $1$.
  2. b) Find the probability that the server takes less than $2$ minutes to boot.
  3. c) Calculate the median of $X$ (the value $m$ such that $P[X \le m] = \frac{1}{2}$) and the mean $\mu$. Which of the two is greater? What do you think is the reason for this?
Solve

Back to the beginning: the fair's roulette wheel can't be predicted spin by spin, but the expected value of the net gain $E(G)$ tells you what to expect in the long run, and if it is negative, it's better not to play.

Summary

See all the exercises in this section