Probability and random variables
🖨 Print a self-study sheet Why print?
Probability is the bridge from describing data to drawing conclusions from them: inference asks how likely a result would be if chance alone were at work. On the revised exam one set of three multiple-choice questions is about probability, random variables and distributions. Combining random variables and the geometric distribution have been removed from the course.
Probability as long-run relative frequency
The probability of an outcome is the proportion of times it would occur in a very long series of repetitions of the chance process. In a short run the proportion can be far from the probability, but as the number of repetitions grows it settles down near it; this is the law of large numbers. A simulation imitates a chance process with random numbers, so that probabilities that are hard to compute can be estimated by the relative frequency of the outcome over many simulated trials. When you describe a simulation on the exam, say how the random numbers represent the outcomes, what you record in each trial, and how you use the results.
Probability rules
For events and :
| Rule | Formula |
|---|---|
| Complement | |
| General addition | |
| Conditional probability | |
| General multiplication |
and are mutually exclusive if they cannot happen together, . They are independent if knowing that one happened does not change the probability of the other: , or equivalently .
Discrete random variables
A random variable takes numerical values determined by a chance process. For a discrete random variable X with values x_i and probabilities p_i (which sum to 1): \mu_X=\sum x_ip_i,\qquad \sigma_X=\sqrt{\sum(x_i-\mu_X)^2p_i}. The mean \mu_X is the long-run average value of X over many repetitions; \sigma_X is the typical distance of the values from that mean.
Binomial distributions
A binomial setting has four conditions (BINS): Binary outcomes (success or failure), Independent trials, a fixed Number n of trials, and the Same probability p of success on every trial. The number of successes X then has a binomial distribution: P(X=k)=\binom nk p^k(1-p)^{n-k},\qquad \mu_X=np,\qquad \sigma_X=\sqrt{np(1-p)}. When sampling without replacement, trials are treated as independent if the sample is less than 10\% of the population.
Similar exercises
A fair die is rolled 4 times. Find the probability of getting at least one six.
What you need: the complement of "at least one six" is "no sixes".
Show solution
The complement of "at least one six" is "no sixes in 4 rolls". The rolls are independent, so P(\text{no sixes})=\left(\dfrac56\right)^4\approx0.4823.
Hence P(\text{at least one six})=1-\left(\dfrac56\right)^4\approx0.5177.
So the probability of at least one six is about 0.5177.
Answer. About 0.5177.
For events A and B, P(A)=0.45, P(B)=0.35 and P(A\text{ and }B)=0.15. Find P(A\text{ or }B) and decide whether A and B are mutually exclusive.
What you need: the general addition rule; mutually exclusive means P(A\text{ and }B)=0.
Show solution
By the general addition rule, P(A\text{ or }B)=0.45+0.35-0.15=0.65.
Since P(A\text{ and }B)=0.15\ne0, the events can happen together, so they are not mutually exclusive.
So P(A\text{ or }B)=0.65, and the events are not mutually exclusive.
Answer. 0.65; no.
For events A and B, P(A)=0.4, P(B)=0.5 and P(A\text{ and }B)=0.2. Are A and B independent?
What you need: compare P(A\text{ and }B) with P(A)P(B).
Show solution
Two events are independent exactly when the probability of both equals the product of their probabilities. If the events were independent, we would have P(A\text{ and }B)=P(A)P(B)=0.4\times0.5=0.2.
The given value P(A\text{ and }B)=0.2 matches, so equivalently P(A\mid B)=\dfrac{0.2}{0.5}=0.4=P(A).
So A and B are independent.
Answer. Yes, independent.
A random variable X takes the values 1,2,3,4 with probabilities 0.1, 0.3, 0.4 and 0.2. Find \mu_X and P(X\ge3).
What you need: \mu_X=\sum x_ip_i; add the probabilities of 3 and 4.
Show solution
The mean is the sum of each value times its probability: \mu_X=1(0.1)+2(0.3)+3(0.4)+4(0.2)=0.1+0.6+1.2+0.8=2.7.
The event X\ge3 means X=3 or X=4, so P(X\ge3)=0.4+0.2=0.6.
So \mu_X=2.7 and P(X\ge3)=0.6.
Answer. \mu_X=2.7; 0.6.
A binomial random variable has n=50 and p=0.2. Find its mean and standard deviation.
What you need: \mu=np and \sigma=\sqrt{np(1-p)}.
Show solution
The number of successes is a binomial random variable, so we use the binomial formulas. The mean is \mu=np=50\times0.2=10.
The standard deviation is \sigma=\sqrt{50\times0.2\times0.8}=\sqrt8\approx2.828.
So the mean is 10 successes and the standard deviation is about 2.828.
Answer. \mu=10, \sigma\approx2.828.
Applied exercises
A machine produces parts, 5\% of which are defective, independently. An inspector checks 20 parts.
a) Find the probability that none is defective.
b) Find the probability that at most one is defective.
What you need: binomial with n=20, p=0.05; "at most one" means 0 or 1.
Show solution
The number of defective parts X is binomial with n=20 and p=0.05, since parts are defective or not, independently, with a fixed number of checks.
a) P(X=0)=(0.95)^{20}\approx0.3585.
b) P(X=1)=\dbinom{20}{1}(0.05)(0.95)^{19}\approx0.3774, so P(X\le1)=P(X=0)+P(X=1)\approx0.7358 (the calculator's binomial cumulative probability gives the same value without rounding errors).
So the probabilities are about 0.3585 and 0.7358.
Answer. a) 0.3585; b) 0.7358.
A disease affects 2\% of a population. A test is positive for 95\% of people who have the disease and for 10\% of people who do not. A randomly chosen person tests positive. What is the probability that the person has the disease?
What you need: P(\text{disease}\mid\text{positive})=\dfrac{P(\text{disease and positive})}{P(\text{positive})}.
Show solution
By the multiplication rule, P(\text{disease and positive})=0.02\times0.95=0.019 and P(\text{no disease and positive})=0.98\times0.10=0.098.
So P(\text{positive})=0.019+0.098=0.117, and P(\text{disease}\mid\text{positive})=\frac{0.019}{0.117}\approx0.1624.
So only about 16\% of people who test positive have the disease, because the disease is rare and false positives are common.
Answer. About 0.1624.
A game costs 2 dollars to play. With probability 0.15 you win a prize of 10 dollars; otherwise you win nothing. Let X be your net gain. Find \mu_X and interpret it.
What you need: the net gain is 10-2=8 when you win and -2 when you lose.
Show solution
The net gain is 8 dollars with probability 0.15 and -2 dollars with probability 0.85.
So \mu_X=8(0.15)+(-2)(0.85)=1.2-1.7=-0.5.
So over many plays, a player loses 0.50 dollars per game on average.
Answer. \mu_X=-0.5 dollars.
A student guesses randomly on 10 multiple-choice questions, each with 4 options. Find the probability that she gets at least 5 correct.
What you need: binomial with n=10, p=0.25; P(X\ge5)=1-P(X\le4).
Show solution
The number of correct answers X is binomial with n=10 and p=0.25, because each guess is right or wrong, guesses are independent, and p=\dfrac14 for each question.
By the complement rule and a calculator, P(X\ge5)=1-P(X\le4)\approx1-0.9219=0.0781.
So the probability of at least 5 correct by pure guessing is about 0.0781.
Answer. About 0.0781.
Marked like the Vietnamese graduation exam: Part I 0.25 points per question; Part II up to 1 point per question (1, 2, 3, 4 correct statements give 0.1, 0.25, 0.5, 1 point); Part III 0.5 points per question.
Part I. Multiple choice
1-0.35=0.65.
0.3\times0.4=0.12.
np=20\times0.3=6.
The number of trials is not fixed.
Part II. True or false
| a) The probabilities sum to 1. | ||
| b) P(X\ge1)=0.5. | ||
| c) \mu_X=0.7. | ||
| d) \mu_X must be one of the values of X. |
The mean 0.7 is not a possible value.
Part III. Short answer
\dfrac{0.2}{0.5}=0.4.
\dfrac{0.12}{0.4}=0.3.
Show answers and explanations
- Part I, question 1: B. 1-0.35=0.65.
- Part I, question 2: C. 0.3\times0.4=0.12.
- Part I, question 3: A. np=20\times0.3=6.
- Part I, question 4: D. The number of trials is not fixed.
- Part II, question 1: a) True; b) True; c) True; d) False. The mean 0.7 is not a possible value.
- Part III, question 1: 0.4. \dfrac{0.2}{0.5}=0.4.
- Part III, question 2: 0.3. \dfrac{0.12}{0.4}=0.3.