Permutations, combinations and probability
A-Level Mathematics · Probability & Statistics 1
Counting
- Arrangements of $n$ distinct objects: $n!$;
- arrangements of $n$ objects with repeats: divide by the factorial of each repeat count;
- ordered selections of $r$ from $n$: $^{n}P_{r}=\dfrac{n!}{(n-r)!}$;
- unordered selections: $^{n}C_{r}=\dfrac{n!}{r!(n-r)!}$.
The single question that decides which formula to use: does the order matter? A committee is unordered; a queue, a code, a set of prizes for 1st and 2nd place are ordered.
Probability rules
$$P(A\cup B)=P(A)+P(B)-P(A\cap B)$$$$P(A\mid B)=\frac{P(A\cap B)}{P(B)}\quad\Longrightarrow\quad P(A\cap B)=P(A\mid B)P(B)$$Independent versus mutually exclusive
- Independent: $P(A\cap B)=P(A)P(B)$ — one happening tells you nothing about the other;
- Mutually exclusive: $P(A\cap B)=0$ — they cannot both happen.
These are not the same idea, and two events with non-zero probabilities can never be both.
Worked example: choosing a committee with a constraint
A committee of $4$ people is chosen from $6$ men and $5$ women, so that the committee has exactly $2$ women. How many ways are there?
Solution
Step 1 — ask the deciding question. The committee members have no distinct roles, so order does not matter: use combinations.
Step 2 — split by gender and multiply. Exactly $2$ women means $2$ women and $2$ men:
$$\binom{5}{2}\times\binom{6}{2}=10\times 15=150$$Why multiply, not add. Each way of choosing the women can be paired with every way of choosing the men, so the total is the product. Adding is used only when the two cases are mutually exclusive — for example if the question asked for "at least $2$ women" you would add the three cases of $2$ women, $3$ women and $4$ women.
Sanity check: the total number of ways to choose any $4$ people is $\dbinom{11}{4}=330$, so the answer must be less than $330$. We got $150$ — about $45\%$, which is reasonable because "exactly two women" is the most balanced case.
Worked example: reversed conditional probability
A factory has two production lines: $A$ makes $60\%$ of the output, $B$ makes $40\%$. The defect rate of $A$ is $3\%$, of $B$ is $5\%$. One item is chosen at random and found to be defective. Calculate the probability that it was made by line $B$.
Solution
Step 1 — probability of each path. Multiply along the branches:
$$P(B\cap\text{defective})=0.4(0.05)=0.020$$$$P(A\cap\text{defective})=0.6(0.03)=0.018$$Step 2 — total probability. Add all the paths leading to "defective":
$$P(\text{defective})=0.018+0.020=0.038$$Step 3 — reverse the condition.
$$P(B\mid\text{defective})=\frac{P(B\cap\text{defective})}{P(\text{defective})}=\frac{0.020}{0.038}=\frac{10}{19}=0.526$$Note that the question is the reverse of the given data: the question gives "if it is $B$, the probability of a defect", but asks "if it is defective, the probability it is $B$". The two numbers are completely different — $0.05$ versus $0.526$ — and confusing them is the worst error in probability.
The result $0.526$ is greater than $B$'s output share of $0.4$, as intuition predicts: $B$ is more often defective so it takes a larger share of the pool of defective items.