---
title: Problem set 1
heading: "Problem set 1: events, counting and conditioning"
eyebrow: A11 · Problem set 1
type: problems
---

::: hook
These problems use lessons 1 to 7: sample spaces and the axioms, counting, conditional probability, Bayes' rule, and independence with reliability. For each one, decide first what the outcomes are and whether they're equally likely, independent or neither.
:::

::: pool
pick: 12

::: check
kind: parts
given: n = 8 | 12; p = 0.01 | 0.02

## Each bit of an {n}-bit word flips independently with probability {p}.

::: part
answer: (1 - p)^n
tolerance: 0.1%

### What is the chance the word arrives with no errors?

::: misses
- [any] $(1 - p)^n$.
:::
:::

::: part
answer: n*p*(1 - p)^(n - 1)
tolerance: 0.5%

### Exactly one error?

::: misses
- [any] $\binom{n}{1}p(1 - p)^{n - 1}$.
:::
:::

::: part
answer: 1 - (1 - p)^n - n*p*(1 - p)^(n - 1)
tolerance: 0.5%

### Two or more errors, which a single-error-correcting code can't fix?

::: misses
- [any] One minus the first two answers.
:::
:::
:::

::: check
kind: parts
given: N = 20 | 30; D = 2 | 4; k = 4 | 5

## A tray of {N} capacitors holds {D} bad ones. You test {k} at random.

::: part
answer: (N - D)!*(N - k)!/((N - D - k)!*N!)
tolerance: 0.1%

### What is the chance all {k} are good?

::: misses
- [(1 - D/N)^k] That's with replacement.
- [any] $\binom{N - D}{k}/\binom{N}{k}$.
:::
:::

::: part
answer: 1 - (N - D)!*(N - k)!/((N - D - k)!*N!)
tolerance: 0.1%

### What is the chance you find at least one bad one?

::: misses
- [any] The complement.
:::
:::
:::

::: check
kind: parts
given: pa = 0.04 | 0.06; pb = 0.03 | 0.05; pab = 0.01 | 0.02

## A part fails test A with probability {pa}, test B with probability {pb}, and both with probability {pab}.

::: part
answer: pa + pb - pab
tolerance: 0.5%

### What is the chance it fails at least one test?

::: misses
- [any] Inclusion-exclusion.
:::
:::

::: part
answer: pab/pb
tolerance: 0.5%

### Given that it failed B, what is the chance it also failed A?

::: misses
- [any] $P(A \cap B)/P(B)$.
:::
:::
:::

::: check
kind: parts
given: s1 = 0.5 | 0.7; d1 = 0.01 | 0.02; d2 = 0.04 | 0.06

## Line 1 makes {s1} of the boards, with defect rate {d1}; line 2 makes the rest, with defect rate {d2}.

::: part
answer: s1*d1 + (1 - s1)*d2
tolerance: 0.5%

### What fraction of all boards is defective?

::: misses
- [any] Total probability.
:::
:::

::: part
answer: (1 - s1)*d2/(s1*d1 + (1 - s1)*d2)
tolerance: 0.5%

### A board is defective. What is the chance it came from line 2?

::: misses
- [any] Bayes' rule.
:::
:::
:::

::: check
kind: parts
given: q = 0.002 | 0.01; s = 0.98 | 0.995; f = 0.01 | 0.03

## A fault detector catches a fraction {s} of real faults and raises false alarms on a fraction {f} of healthy units. A fraction {q} of units are faulty.

::: part
answer: s*q/(s*q + f*(1 - q))
tolerance: 0.5%

### Given an alarm, what is the chance the unit is faulty?

::: misses
- [any] Bayes' rule.
:::
:::

::: part
answer: s^2*q/(s^2*q + f^2*(1 - q))
tolerance: 0.5%

### An independent second detector with the same rates also alarms. What is the chance now?

::: misses
- [any] The odds multiply by $s/f$ again.
:::
:::
:::

::: check
kind: parts
given: a = 0.4 | 0.5; e1 = 0.02 | 0.05; e0 = 0.01 | 0.03

## A link sends 1 with probability {a}. A sent 1 is read as 0 with probability {e1}; a sent 0 is read as 1 with probability {e0}.

::: part
answer: a*e1 + (1 - a)*e0
tolerance: 0.5%

### What is the overall bit error rate?

::: misses
- [any] Total probability.
:::
:::

::: part
answer: (1 - a)*(1 - e0)/((1 - a)*(1 - e0) + a*e1)
tolerance: 0.5%

### A 0 is received. What is the chance a 0 was sent?

::: misses
- [any] Bayes' rule with $P(\text{read }0)$ in the denominator.
:::
:::
:::

::: check
kind: parts
given: n = 20 | 50 | 100; r = 0.999 | 0.9995

## A system has {n} parts in series, each {r} reliable, independently.

::: part
answer: r^n
tolerance: 0.1%

### How reliable is the system?

::: misses
- [any] $r^n$.
:::
:::

::: part
answer: 1 - (1 - r^n)^2
tolerance: 0.1%

### Two whole copies of the system run in parallel. How reliable is that?

::: misses
- [any] Parallel of two systems.
:::
:::
:::

::: check
kind: parts
given: r = 0.9 | 0.95; c = 0.98 | 0.995

## Three sensors, each {r} reliable, feed a 2-of-3 voter that is {c} reliable.

::: part
answer: 3*r^2 - 2*r^3
tolerance: 0.1%

### How reliable are the three sensors under 2-of-3 voting?

::: misses
- [any] $3r^2 - 2r^3$.
:::
:::

::: part
answer: c*(3*r^2 - 2*r^3)
tolerance: 0.1%

### Including the voter, how reliable is the system?

::: misses
- [any] The voter is in series.
:::
:::
:::

::: check
kind: parts
given: n = 10 | 16; k = 2 | 3

## An {n}-bit register is set at random, all words equally likely.

::: part
answer: n!/(k!*(n - k)!)
tolerance: 0.01%

### How many words have exactly {k} ones?

::: misses
- [any] $\binom{n}{k}$.
:::
:::

::: part
answer: n!/(k!*(n - k)!)/2^n
tolerance: 0.5%

### What is the chance a random word has exactly {k} ones?

::: misses
- [any] Divide by $2^n$.
:::
:::
:::

::: check
kind: parts
given: p = 0.01 | 0.02; q = 0.004 | 0.01

## A link loses a fraction {p} of packets; a fraction {q} of consecutive pairs are both lost.

::: part
answer: q/p
tolerance: 0.5%

### Given one loss, what is the chance the next packet is lost?

::: misses
- [any] $q/p$.
:::
:::

::: part
answer: p^2
tolerance: 0.5%

### If losses were independent, what would the pair rate be?

::: misses
- [any] $p \times p$.
:::
:::
:::

::: check
kind: parts
given: n = 3 | 4 | 5; p = 0.1 | 0.2

## A packet is sent over {n} independent paths, each losing it with probability {p}.

::: part
answer: p^n
tolerance: 0.5%

### What is the chance every copy is lost?

::: misses
- [any] $p^n$.
:::
:::

::: part
answer: n*(1 - p)*p^(n - 1)
tolerance: 0.5%

### What is the chance exactly one copy gets through?

::: misses
- [any] $\binom{n}{1}(1 - p)p^{n - 1}$.
:::
:::
:::

::: check
kind: parts
given: m = 5 | 6; k = 2 | 3

## A tester runs {k} different test jobs on {k} of {m} boards, one job per board.

::: part
answer: m!/(m - k)!
tolerance: 0.01%

### In how many ways can the jobs be assigned?

::: misses
- [any] Order matters: $\frac{m!}{(m - k)!}$.
:::
:::

::: part
answer: m!/(k!*(m - k)!)
tolerance: 0.01%

### If the jobs were identical, how many ways would there be to choose the boards?

::: misses
- [any] $\binom{m}{k}$.
:::
:::
:::

::: check
kind: parts
given: n = 10 | 23 | 40

## In a group of {n} people, birthdays are independent and uniform over 365 days.

::: part
answer: 1 - exp(-n*(n - 1)/(2*365))
tolerance: 2%

### Using the approximation $1 - e^{-n(n-1)/730}$, what is the chance that two share a birthday?

::: misses
- [n*(n - 1)/730] That's the expected number of shared pairs; the chance is $1 - e^{-\text{that}}$.
- [any] $1 - e^{-n(n - 1)/730}$.
:::
:::
:::

::: check
kind: parts
given: q = 0.001 | 0.01; s = 0.95 | 0.99; f = 0.02 | 0.05

## A test catches {s} of faults and false-alarms on {f} of good units; {q} of units are faulty.

::: part
answer: s*q/(s*q + f*(1 - q))
tolerance: 0.5%

### What fraction of flagged units are faulty?

::: misses
- [s] That's $P(\text{flag} \mid \text{fault})$, not the reverse.
- [any] Bayes's rule.
:::
:::
:::

::: check
kind: parts
given: r = 0.7 | 0.8 | 0.9 | 0.95 | 0.98 | 0.99

## Three channels of reliability {r} vote 2-of-3.

::: part
answer: 3*r^2 - 2*r^3
tolerance: 0.5%

### How reliable is the system?

::: misses
- [r^3] Two working channels are enough.
- [any] $r^3 + 3r^2(1 - r)$.
:::
:::
:::
:::
