
Section 07: Probability & Statistics
Test your understanding of Combinatorics
Calculate \(\binom{8}{3}\)
How many ways can 5 people line up in a row?
A committee of 3 is chosen from 10 people. How many ways?
What’s the probability of getting exactly 3 heads in 5 coin flips? (Use combinations)
Let’s resolve any confusion before conditional probability.
Conditional probability is heavily tested on the Feststellungsprüfung!
Question: A card is drawn from a deck. What’s the probability it’s a king?
\[P(\text{King}) = \frac{4}{52} = \frac{1}{13}\]
Question: Given the card is a face card, what’s the probability it’s a king?
The condition changes the sample space!
\[P(\text{King} | \text{Face card}) = \frac{4}{12} = \frac{1}{3}\]
Definition: Conditional Probability
The probability of A given that B has occurred where \(P(B) > 0\).
\[P(A|B) = \frac{P(A \cap B)}{P(B)}\]
Read “\(P(A|B)\)” as “probability of A given B”

In a company: 60% work full-time, 30% work full-time AND have a degree.
Question: What’s the probability an employee has a degree, given they work full-time?
Let D = has degree, F = full-time
\[P(D|F) = \frac{P(D \cap F)}{P(F)} = \frac{0.30}{0.60} = 0.50\]
Given that someone works full-time, there’s a 50% chance they have a degree.
Rearranging the definition of the Multiplication Rule:
\[P(A \cap B) = P(A|B) \cdot P(B)\]
or equivalently:
\[P(A \cap B) = P(B|A) \cdot P(A)\]
Both formulas give the same result!
A box contains 5 red and 3 blue balls. Two balls are drawn without replacement.
Question: What’s the probability both are red?
Let \(R_1\) = first ball red, \(R_2\) = second ball red
\[P(R_1 \cap R_2) = P(R_2|R_1) \cdot P(R_1)\]
\[= \frac{4}{7} \times \frac{5}{8} = \frac{20}{56} = \frac{5}{14}\]
For three or more events:
\[P(A \cap B \cap C) = P(A) \cdot P(B|A) \cdot P(C|A \cap B)\]
Example: Drawing 3 cards without replacement of a deck of 52 cards. What’s the probability of getting 3 aces?
\[P(\text{3 aces}) = \frac{4}{52} \times \frac{3}{51} \times \frac{2}{50} = \frac{24}{132,600} = \frac{1}{5,525}\]
Do you get the idea? We can extend this to any number of events.
Tree diagrams help visualize the multiplication rule.
Example: A machine produces items that pass through 2 inspections.

These diagrams are a great way to visualize the multiplication rule!
From the previous example:
P(item passes both inspections): Follow Pass-Pass path \[0.90 \times 0.95 = 0.855\]
P(item passes inspection 2): Add all paths ending with Pass I2 \[0.855 + 0.060 = 0.915\]
P(passed I1 | passed I2): (We’ll use Bayes for this later!) \[P(I_1|I_2) = \frac{P(I_1 \cap I_2)}{P(I_2)} = \frac{0.855}{0.915} \approx 0.934\]
Same setup, different dependency structure:
Suppose a bag has 3 red and 2 blue marbles, draw two marbles.
With replacement:
Without replacement:
Work individually
Given \(P(A)=0.4\), \(P(B)=0.5\), and \(P(A \cap B)=0.2\):
Definition: Law of Total Probability
If events \(B_1, B_2, ..., B_n\) partition the sample space (mutually exclusive and exhaustive):
\[P(A) = \sum_{i=1}^{n} P(A|B_i) \cdot P(B_i)\]
Common case with two partitions:
\[P(A) = P(A|B) \cdot P(B) + P(A|B') \cdot P(B')\]
A company sells to three market segments:
Question: What percentage of all customers buy premium?
\[P(\text{Premium}) = 0.20(0.50) + 0.35(0.30) + 0.50(0.20)\] \[= 0.10 + 0.105 + 0.10 = 0.305\]
30.5% of customers buy premium products.
Definition: Independence Test
Events A and B are independent if and only if:
\[P(A|B) = P(A)\]
Learning B occurred doesn’t change the probability of A!
Equivalently: \(P(B|A) = P(B)\) or \(P(A \cap B) = P(A) \cdot P(B)\)
Survey data shows:
Question: Are “exercise regularly” and “healthy weight” independent?
Definition of the Expected Value
For a discrete random variable \(X\) with values \(x_i\) and probabilities \(p_i\):
\[E[X]=\sum_i x_i p_i\]
Interpretation: long-run average outcome with \(p_i=P(X=x_i)\).
Although it looks formally difficult, the expected value is something you might feel that has to be true. It simply states that the average outcome is the weighted average of all possible outcomes.
You already know these from Session 07-01:
| Descriptive Statistics | Random Variable Notation |
|---|---|
| \(s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1}\) | \(\mathrm{Var}(X) = E[(X - \mu)^2]\) |
| \(s = \sqrt{s^2}\) | \(\sigma_X = \sqrt{\mathrm{Var}(X)}\) |
Same idea, new notation: instead of averaging squared deviations from a sample, we take the expected value of squared deviations from \(\mu = E[X]\).
A project has outcomes for weekly profit (in kEUR):
| \(x\) | 10 | 20 | 30 |
|---|---|---|---|
| \(P(X=x)\) | 0.2 | 0.5 | 0.3 |
\[E[X]=10(0.2)+20(0.5)+30(0.3)=2+10+9=21\]
So the expected weekly profit is 21 kEUR.
Definition: High-Value Rules
For constants \(a,b\):
\[E[aX+b]=aE[X]+b\]
\[\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)\]
Adding a constant shifts the mean but does not change variance.
Makes intuitive sense: if you add 100 to every outcome, the mean increases by 100, but the spread of outcomes does not change.
If \(X\) and \(Y\) are independent:
\[E[X+Y]=E[X]+E[Y]\]
\[\mathrm{Var}(X+Y)=\mathrm{Var}(X)+\mathrm{Var}(Y)\]
Example: If \(E[X]=10\), \(\mathrm{Var}(X)=4\) and \(E[Y]=6\), \(\mathrm{Var}(Y)=3\):
Expectation always adds. Variance adds only under independence.
A and B have random profit contributions \(X\) and \(Y\), independent.
For total \(T=X+Y\):
Work individually
Given a random variable with \(E[X]=12\) and \(\mathrm{Var}(X)=5\):
Work in pairs
Problem 1: 70% of students study math, 60% study economics, and 45% study both.
Problem 2: Draw a tree diagram for: A bag has 3 red and 2 blue marbles. Two marbles are drawn without replacement. Find \(P(\text{both same color})\).
Work individually, then compare
Given \(P(A)=0.50\), \(P(B)=0.30\), and \(P(B|A)=0.60\):
Think individually then work in groups
A company has two suppliers. Let: \(A\) = order from Supplier A and \(O\) = order arrives on time. Given: \(P(A)=0.6\), \(P(O|A)=0.9\), \(P(O|A')=0.75\)
Work individually, then compare
Homework
Complete Tasks 07-04, focus on tree diagrams and conditional probability!
Session 07-04 - Conditional Probability | Dr. Nikolai Heinrichs & Dr. Tobias Vlćek | Home