Probability & Statistics

Study Sheet

Probability & Statistics

Counting, probability, and the shape of data --- one desk reference

The Fundamental Counting Principle

Concept
Multiply the Choices

If a task is made of several independent stages, and stage 11 can happen in mm ways, stage 22 in nn ways, and so on, then the whole task can happen in

m×n× ways.m \times n \times \cdots \ \text{ways.}

This is the engine behind every counting formula in this topic: whenever choices are made in sequence, you multiply.

Example
Worked Example: Building an Outfit

A wardrobe has 44 shirts, 33 pairs of pants, and 22 pairs of shoes. How many outfits (one of each) are possible?

4×3×2=24 outfits.4 \times 3 \times 2 = 24 \ \text{outfits.}

If a password uses 33 digits and repeats are allowed, there are 10×10×10=100010 \times 10 \times 10 = 1000 passwords.

Tip

Repeats allowed or not? If items can repeat, each stage keeps the full count (10×10×1010 \times 10 \times 10). If they cannot repeat, the pool shrinks by one each time (10×9×810 \times 9 \times 8).

Permutations and Combinations

Concept
Order Matters vs. Order Doesn't

Both count ways to choose rr items from nn distinct items.

  • [leftmargin=*,itemsep=1pt]
  • Permutation --- order matters (arrangements, rankings, seating): @@BLOCK0@@
  • Combination --- order does not matter (committees, teams, hands): @@BLOCK1@@

Because a combination ignores the r!r! orderings of each group, (nr)=P(n,r)r!\binom{n}{r} = \dfrac{P(n,r)}{r!}.

Example
Worked Example: Same Numbers, Different Question

From 55 students, form a line of 33 (permutation) versus a team of 33 (combination).

P(5,3)=5!2!=5×4×3=60(order matters)C(5,3)=(53)=5×4×33!=606=10(order doesn’t)\begin{aligned} P(5,3) &= \frac{5!}{2!} = 5 \times 4 \times 3 = 60 \quad\text{(order matters)}\\[2pt] C(5,3) &= \binom{5}{3} = \frac{5 \times 4 \times 3}{3!} = \frac{60}{6} = 10 \quad\text{(order doesn't)} \end{aligned}

There are exactly 3!=63! = 6 times as many lines as teams, because each team of 33 can be lined up in 66 ways.

Tip

Decision test: Ask “If I swap two chosen items, is it a different outcome?” Yes \Rightarrow permutation (order matters). No \Rightarrow combination.

Basic Probability

Concept
Theoretical, Experimental, Complement

For equally likely outcomes,

P(event)=number of favorable outcomestotal number of outcomes,0P1.P(\text{event}) = \frac{\text{number of favorable outcomes}}{\text{total number of outcomes}}, \qquad 0 \le P \le 1.

Theoretical probability comes from the model (a fair die gives 16\tfrac16). Experimental probability comes from data: times it happenedtrials\dfrac{\text{times it happened}}{\text{trials}}. The complement rule saves work:

P(not A)=1P(A).P(\text{not } A) = 1 - P(A).
Example
Worked Example: Marbles and a Complement

A bag holds 33 red and 55 blue marbles (88 total).

P(red)=38,P(not red)=138=58.P(\text{red}) = \frac{3}{8}, \qquad P(\text{not red}) = 1 - \frac{3}{8} = \frac{5}{8}.

Over many draws, the experimental fraction of reds should hover near 38=0.375\tfrac38 = 0.375 (the Law of Large Numbers).

Tip

“At least one” trick: It is almost always easier to compute 1P(none)1 - P(\text{none}) than to add up every “one or more” case.

Independent & Dependent Events; Conditional Probability

Concept
The Multiplication Rule

For the probability that both AA and BB happen:

P(A and B)=P(A)P(BA).P(A \text{ and } B) = P(A)\cdot P(B \mid A).
  • [leftmargin=*,itemsep=1pt]
  • Independent --- one outcome doesn't affect the other, so P(BA)=P(B)P(B \mid A) = P(B) and the rule becomes P(A)P(B)P(A)\cdot P(B). (Coin flips, drawing with replacement.)
  • Dependent --- the first outcome changes the second (drawing without replacement).

Conditional probability isolates P(BA)=P(A and B)P(A)P(B \mid A) = \dfrac{P(A \text{ and } B)}{P(A)}.

Example
Worked Example: Dependent Draw (No Replacement)

A deck of 5252 cards: draw two, without replacement. Find P(both hearts)P(\text{both hearts}). There are 1313 hearts.

P(both hearts)=13521251=141251=12204=1170.059.P(\text{both hearts}) = \frac{13}{52}\cdot\frac{12}{51} = \frac14 \cdot \frac{12}{51} = \frac{12}{204} = \frac{1}{17} \approx 0.059.

The second fraction uses 1212 and 5151 because one heart is already gone.

Example
Worked Example: Conditional Probability

In a class, 60%60\% play a sport and 25%25\% play a sport and an instrument. Given a student plays a sport, the chance they also play an instrument is

P(instrumentsport)=P(both)P(sport)=0.250.60=5120.417.P(\text{instrument}\mid\text{sport}) = \frac{P(\text{both})}{P(\text{sport})} = \frac{0.25}{0.60} = \frac{5}{12} \approx 0.417.
Tip

With vs. without replacement. “With replacement” \Rightarrow independent (denominators stay the same). “Without replacement” \Rightarrow dependent (denominator drops by 11 each draw).

Mutually Exclusive & Overlapping Events (Addition Rule)

Concept
The Addition Rule

For the probability that AA or BB happens:

P(A or B)=P(A)+P(B)P(A and B).P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B).
  • [leftmargin=*,itemsep=1pt]
  • Mutually exclusive (disjoint) --- can't both happen, so P(A and B)=0P(A \text{ and } B) = 0 and the rule is just P(A)+P(B)P(A)+P(B).
  • Overlapping --- can happen together, so subtract the overlap once (it was counted twice).
Example
Worked Example: Overlap in a Deck

Draw one card. Find P(king or heart)P(\text{king or heart}). There are 44 kings, 1313 hearts, and the king of hearts is in both.

P(king or heart)=452+1352152=1652=413.P(\text{king or heart}) = \frac{4}{52} + \frac{13}{52} - \frac{1}{52} = \frac{16}{52} = \frac{4}{13}.

If we had added without subtracting, the king of hearts would be double-counted.

Tip

Spot the overlap. If two categories can describe the same outcome, they overlap --- always subtract P(A and B)P(A \text{ and } B). If they never coincide, the overlap is 00.

Binomial Probability (Introduction)

Concept
Counting Successes in Repeated Trials

A binomial experiment has: (1) a fixed number of trials nn, (2) two outcomes per trial --- success or failure, (3) a constant success probability pp, and (4) independent trials. The probability of exactly kk successes is

P(k)=(nk)pk(1p)nk.P(k) = \binom{n}{k}\, p^{k}\,(1-p)^{\,n-k}.

Here (nk)\binom{n}{k} counts which trials succeed, pkp^k is their successes, and (1p)nk(1-p)^{n-k} the remaining failures.

Example
Worked Example: Exactly 3 Heads in 5 Flips

A fair coin, so p=12p = \tfrac12, n=5n = 5, k=3k = 3:

P(3)=(53)(12)3(12)2=10132=1032=516=0.3125.P(3) = \binom{5}{3}\left(\tfrac12\right)^{3}\left(\tfrac12\right)^{2} = 10 \cdot \frac{1}{32} = \frac{10}{32} = \frac{5}{16} = 0.3125.
Tip

“At least” means add up cases: P(k1)=1P(0)P(k \ge 1) = 1 - P(0) is usually the fastest route, using the complement again.

Measures of Center and Spread

Concept
Center, Then Spread
3456789

Center: the mean xˉ=xn\bar{x} = \dfrac{\sum x}{n}, the median (middle value when ordered), and the mode (most frequent). Spread: the variance σ2\sigma^2 is the average squared distance from the mean, and the standard deviation σ\sigma is its square root:

σ2=(xxˉ)2n,σ=σ2.\sigma^2 = \frac{\sum (x - \bar{x})^2}{n}, \qquad \sigma = \sqrt{\sigma^2}.

Standard deviation is in the same units as the data, so it measures “typical distance from the mean.”

One outlier drags the mean but not the median.

Example
Worked Example: Standard Deviation Step by Step

Data: 2, 4, 4, 4, 5, 5, 7, 92,\ 4,\ 4,\ 4,\ 5,\ 5,\ 7,\ 9 (n=8n = 8).

xˉ=2+4+4+4+5+5+7+98=408=5(xxˉ)2=(3)2+(1)2+(1)2+(1)2+02+02+22+42=9+1+1+1+0+0+4+16=32σ2=328=4,σ=4=2.\begin{aligned} \bar{x} &= \frac{2+4+4+4+5+5+7+9}{8} = \frac{40}{8} = 5\\[2pt] \sum (x-\bar{x})^2 &= (-3)^2 + (-1)^2 + (-1)^2 + (-1)^2 + 0^2 + 0^2 + 2^2 + 4^2\\ &= 9+1+1+1+0+0+4+16 = 32\\[2pt] \sigma^2 &= \frac{32}{8} = 4, \qquad \sigma = \sqrt{4} = 2. \end{aligned}

So a typical value sits about 22 units from the mean of 55.

Tip

Population vs. sample. Dividing by nn gives the population standard deviation (used here). Dividing by n1n-1 gives the sample standard deviation, used when the data is a sample of a larger group.

The Normal Distribution, the Empirical Rule & z-Scores

Concept
The Bell Curve
3456789

Many natural measurements (heights, test scores, errors) follow a normal distribution: a symmetric, bell-shaped curve centered at the mean μ\mu, with spread set by σ\sigma. For any normal distribution, the Empirical Rule (68--95--99.7) says:

  • [leftmargin=*,itemsep=1pt]
  • about 68%68\% of data lies within 1σ1\sigma of the mean,
  • about 95%95\% within 2σ2\sigma,
  • about 99.7%99.7\% within 3σ3\sigma.

One outlier drags the mean but not the median.

Concept
z-Scores: How Many Standard Deviations Out

A z-score rewrites any value xx as its distance from the mean, measured in standard deviations:

z=xμσ.z = \frac{x - \mu}{\sigma}.

A positive zz is above the mean, negative is below, and z=0z = 0 is exactly average. z-scores let you compare values from different distributions on one common scale.

Example
Worked Example: Empirical Rule & a z-Score

IQ scores are normal with μ=100\mu = 100, σ=15\sigma = 15.

  • [leftmargin=*,itemsep=1pt]
  • Between 8585 and 115115 (that is μ±1σ\mu \pm 1\sigma): about 68%68\% of people.
  • An IQ of 130130 has z=13010015=2z = \dfrac{130-100}{15} = 2, so it sits at μ+2σ\mu + 2\sigma. Only about 2.5%2.5\% of people score higher.
Tip

Symmetry shortcut. Because the curve is symmetric, 50%50\% lies below the mean and 50%50\% above. To find a one-sided tail, take half of what's left: above 2σ2\sigma is 100%95%2=2.5%\tfrac{100\% - 95\%}{2} = 2.5\%.

Going Deeper: Advanced Probability & Statistics

Concept
Counting with Restrictions: Circular & Identical Items
3456789

Not every arrangement is a plain permutation --- watch for two twists.

  • [leftmargin=*,itemsep=1pt]
  • Circular arrangements. Seating nn people around a round table has no “first” seat, so every arrangement can be rotated nn ways to look the same. Divide the overcount away: @@BLOCK0@@
  • Identical (repeated) items. Arranging nn objects where one kind repeats n1n_1 times, another n2n_2 times, and so on: @@BLOCK1@@ We divide by each ni!n_i! because swapping identical items produces no new word.

One outlier drags the mean but not the median.

Example
Worked Example: Arranging the Letters of MISSISSIPPI

The word MISSISSIPPI has 1111 letters: M (11), I (44), S (44), P (22). Distinct arrangements:

11!1!4!4!2!=399168001×24×24×2=399168001152=34650.\frac{11!}{1!\,4!\,4!\,2!} = \frac{39916800}{1 \times 24 \times 24 \times 2} = \frac{39916800}{1152} = 34650.

Without dividing out the repeats we would count 11!=39,916,80011! = 39{,}916{,}800 --- overcounting every rearrangement of identical letters.

Tip

Overcounting checklist. Whenever a symmetry makes different-looking arrangements “the same” (rotations of a circle, swaps of identical items, or reflections of a bracelet), divide the raw count by the number of ways that symmetry acts.

Concept
Complementary Counting and “At Least One”

When a direct count splits into many cases, count the opposite and subtract from the total. For probabilities this is the complement rule; for raw counts it is the same idea:

(ways with at least one A)=(total ways)(ways with no A).(\text{ways with at least one } A) = (\text{total ways}) - (\text{ways with no } A).

The phrase “at least one” is the signal: the negation “none” is almost always a single, clean computation.

Example
Worked Example: At Least One Six in Four Rolls

Roll a fair die four times. Find P(at least one 6)P(\text{at least one } 6). The complement “no sixes” means each roll lands on one of five faces:

P(no 6)=(56)4=6251296,P(at least one 6)=16251296=67112960.518.P(\text{no } 6) = \left(\frac{5}{6}\right)^{4} = \frac{625}{1296}, \qquad P(\text{at least one } 6) = 1 - \frac{625}{1296} = \frac{671}{1296} \approx 0.518.

Adding the “exactly one, exactly two, three, four” cases separately would take four binomial terms; the complement needs just one.

Concept
Bayes' Theorem: Reversing the Condition

Conditional probabilities are not symmetric: P(AB)P(BA)P(A \mid B) \ne P(B \mid A) in general. Bayes' theorem flips a known conditional into the one you want:

P(AB)=P(BA)P(A)P(B),P(B)=P(BA)P(A)+P(BAc)P(Ac).P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}, \qquad P(B) = P(B \mid A)\,P(A) + P(B \mid A^c)\,P(A^c).

The denominator is the law of total probability: it rebuilds P(B)P(B) by splitting across AA and its complement AcA^c.

Example
Worked Example: A Medical Test (Base Rates Matter)

A disease affects 1%1\% of people. A test is 99%99\% accurate both ways: P(+sick)=0.99P(+\mid\text{sick}) = 0.99 and P(healthy)=0.99P(-\mid\text{healthy}) = 0.99 (so P(+healthy)=0.01P(+\mid\text{healthy}) = 0.01). A patient tests positive --- what is P(sick+)P(\text{sick}\mid +)?

P(+)=P(+sick)P(sick)+P(+healthy)P(healthy)=(0.99)(0.01)+(0.01)(0.99)=0.0099+0.0099=0.0198P(sick+)=(0.99)(0.01)0.0198=0.00990.0198=12=50%.\begin{aligned} P(+) &= P(+\mid\text{sick})P(\text{sick}) + P(+\mid\text{healthy})P(\text{healthy})\\ &= (0.99)(0.01) + (0.01)(0.99) = 0.0099 + 0.0099 = 0.0198\\[2pt] P(\text{sick}\mid +) &= \frac{(0.99)(0.01)}{0.0198} = \frac{0.0099}{0.0198} = \frac{1}{2} = 50\%. \end{aligned}

Despite a “99%99\% accurate” test, a positive result is only a coin flip --- because the disease is rare, false positives from the huge healthy group roughly equal the true positives.

Tip

Don't ignore the base rate. A test's accuracy is P(+sick)P(+\mid\text{sick}), but a patient cares about P(sick+)P(\text{sick}\mid +). When the condition is rare, that reversal can be dramatically smaller. Always run it through Bayes.

Concept
Expected Value: The Long-Run Average

The expected value of a numerical outcome XX weights each value by its probability:

E(X)=xiP(xi).E(X) = \sum x_i\, P(x_i).

It is the average you would approach over many repetitions --- not necessarily a possible single outcome. A game is fair when E(net gain)=0E(\text{net gain}) = 0.

Example
Worked Example: Is the Lottery Ticket Worth It?

A $22 ticket pays $100100 with probability 1200\tfrac{1}{200} and nothing otherwise. Find the expected net gain.

E(net)=(1002)1200win+(2)199200lose=98200398200=300200=$1.50.E(\text{net}) = \underbrace{(100 - 2)\cdot\frac{1}{200}}_{\text{win}} + \underbrace{(-2)\cdot\frac{199}{200}}_{\text{lose}} = \frac{98}{200} - \frac{398}{200} = -\frac{300}{200} = -\$1.50.

On average you lose $1.501.50 per ticket, so the game is not fair (it favors the seller).

Concept
Binomial Threshold Probabilities (“At Least kk”)

For a binomial with nn trials and success probability pp, a threshold question sums several exact-kk terms:

P(Xk)=j=kn(nj)pj(1p)nj.P(X \ge k) = \sum_{j=k}^{n} \binom{n}{j} p^{j}(1-p)^{n-j}.

When kk is small, the complement is faster: P(X1)=1P(X=0)P(X \ge 1) = 1 - P(X = 0), and P(X2)=1P(X=0)P(X=1)P(X \ge 2) = 1 - P(X=0) - P(X=1).

Example
Worked Example: At Least 2 Defects in 6 Parts

Each part is defective with probability p=0.1p = 0.1, independently, n=6n = 6. Find P(X2)P(X \ge 2) using the complement:

P(X=0)=(60)(0.1)0(0.9)6=(0.9)60.5314P(X=1)=(61)(0.1)1(0.9)5=6(0.1)(0.9)50.3543P(X2)=10.53140.35430.1143.\begin{aligned} P(X = 0) &= \binom{6}{0}(0.1)^0(0.9)^6 = (0.9)^6 \approx 0.5314\\[2pt] P(X = 1) &= \binom{6}{1}(0.1)^1(0.9)^5 = 6(0.1)(0.9)^5 \approx 0.3543\\[2pt] P(X \ge 2) &= 1 - 0.5314 - 0.3543 \approx 0.1143. \end{aligned}

So there is about an 11%11\% chance of two or more defects --- found with two terms instead of five.

Concept
Linear Transformations of Data: y=ax+by = ax + b

Shifting and scaling every data value changes center and spread in predictable ways. If y=ax+by = ax + b:

  • [leftmargin=*,itemsep=1pt]
  • Mean shifts and scales: yˉ=axˉ+b\bar{y} = a\bar{x} + b.
  • Standard deviation scales but does not shift: σy=aσx\sigma_y = |a|\,\sigma_x.
  • Variance scales by the square: σy2=a2σx2\sigma_y^2 = a^2\,\sigma_x^2.

Adding a constant bb slides all data together, so spread is unchanged; multiplying by aa stretches the gaps by a|a|.

Example
Worked Example: Converting Celsius to Fahrenheit

A week of temperatures in Celsius has mean xˉ=20\bar{x} = 20^\circ and standard deviation σx=3\sigma_x = 3^\circ. Convert with F=1.8C+32F = 1.8\,C + 32 (a=1.8a = 1.8, b=32b = 32):

Fˉ=1.8(20)+32=68σF=1.83=5.4(the +32 has no effect on spread).\begin{aligned} \bar{F} &= 1.8(20) + 32 = 68^\circ\\ \sigma_F &= |1.8|\cdot 3 = 5.4^\circ \quad(\text{the } +32 \text{ has no effect on spread}). \end{aligned}

Standardizing to a z-score is the special case z=xμσz = \dfrac{x-\mu}{\sigma}, i.e. a=1σa = \tfrac{1}{\sigma}, b=μσb = -\tfrac{\mu}{\sigma}, which forces mean 00 and standard deviation 11.

Tip

Add vs. multiply. Adding a constant moves the center but leaves the spread alone. Multiplying rescales both. This is why σ\sigma never changes when you merely shift data.

Concept
Combining Two Groups' Means and Variances

To pool two groups of sizes n1,n2n_1, n_2, the combined mean is the weighted average --- never the plain average of the two means unless the groups are the same size:

xˉcombined=n1xˉ1+n2xˉ2n1+n2.\bar{x}_{\text{combined}} = \frac{n_1\bar{x}_1 + n_2\bar{x}_2}{n_1 + n_2}.

Variance must be pooled about the combined mean. Using each group's sum of squared deviations Si=niσi2S_i = n_i \sigma_i^2 and combined mean xˉc\bar{x}_c:

σcombined2=n1(σ12+(xˉ1xˉc)2)+n2(σ22+(xˉ2xˉc)2)n1+n2.\sigma_{\text{combined}}^2 = \frac{n_1(\sigma_1^2 + (\bar{x}_1 - \bar{x}_c)^2) + n_2(\sigma_2^2 + (\bar{x}_2 - \bar{x}_c)^2)}{n_1 + n_2}.

The extra (xˉixˉc)2(\bar{x}_i - \bar{x}_c)^2 terms account for how far each group's center sits from the shared center.

Example
Worked Example: Pooling Two Classes

Class A: n1=20n_1 = 20, xˉ1=80\bar{x}_1 = 80, σ12=25\sigma_1^2 = 25. Class B: n2=30n_2 = 30, xˉ2=90\bar{x}_2 = 90, σ22=16\sigma_2^2 = 16. Combined:

xˉc=20(80)+30(90)50=1600+270050=430050=86σc2=20(25+(8086)2)+30(16+(9086)2)50=20(25+36)+30(16+16)50=20(61)+30(32)50=1220+96050=218050=43.6.\begin{aligned} \bar{x}_c &= \frac{20(80) + 30(90)}{50} = \frac{1600 + 2700}{50} = \frac{4300}{50} = 86\\[2pt] \sigma_c^2 &= \frac{20\big(25 + (80-86)^2\big) + 30\big(16 + (90-86)^2\big)}{50}\\ &= \frac{20(25 + 36) + 30(16 + 16)}{50} = \frac{20(61) + 30(32)}{50}\\ &= \frac{1220 + 960}{50} = \frac{2180}{50} = 43.6. \end{aligned}

So σc=43.66.60\sigma_c = \sqrt{43.6} \approx 6.60 --- larger than either group's own spread, because the two centers (8080 and 9090) are pulled apart.

Tip

Weighted, not averaged. A combined mean weights by group size, and combined variance adds a “spread between the groups” correction. Never just average the two means or the two variances unless n1=n2n_1 = n_2 and the means coincide.

Formulas, Proofs & Tips

Tip
Standard deviation
σ=(xixˉ)2n\sigma=\sqrt{\frac{\sum (x_i-\bar{x})^{2}}{n}}

What it means. The typical distance of a value from the mean.

Example. For 2,4,62,4,6: mean 44, so σ=4+0+43=831.63\sigma=\sqrt{\tfrac{4+0+4}{3}}=\sqrt{\tfrac83}\approx1.63.

Why it works. Raw deviations xixˉx_i-\bar x sum to zero, so they are squared to stop cancellation, averaged to get a typical squared distance, then square-rooted to return to the original units.

Tip. Adding a constant to every value leaves σ\sigma unchanged; multiplying every value by kk multiplies σ\sigma by k|k|.