James's Math Hub
Statistics & Probability

Lesson 4 / 13 · 12 min read

Probability Basics

Sample spaces, independence, conditional probability, expected value.

Sample spaces and events

The sample space SS is the set of all possible outcomes. An event is a subset of SS.

If all outcomes are equally likely:

P(event)=number of outcomes in eventtotal outcomes in SP(\text{event}) = \frac{\text{number of outcomes in event}}{\text{total outcomes in } S}

Example. Roll a fair 6-sided die. S={1,2,3,4,5,6}S = \{1, 2, 3, 4, 5, 6\}. The event "even" is {2,4,6}\{2, 4, 6\}, so P(even)=3/6=1/2P(\text{even}) = 3/6 = 1/2.

Probability axioms (the rules of the game)

  • 0P(A)10 \leq P(A) \leq 1
  • P(S)=1P(S) = 1
  • If AA and BB are mutually exclusive: P(A or B)=P(A)+P(B)P(A \text{ or } B) = P(A) + P(B)

Complements

P(not A)=1P(A)P(\text{not } A) = 1 - P(A)

Often easier to compute the complement than the event itself.

Independent events

Events AA and BB are independent if knowing one happened doesn't change the probability of the other. For independent events:

P(A and B)=P(A)P(B)P(A \text{ and } B) = P(A) \cdot P(B)

Example. Flip a fair coin twice. P(HH)=1212=14P(\text{HH}) = \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}.

Conditional probability

The probability of AA given BB already happened:

P(AB)=P(A and B)P(B)P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}

Example. Draw one card from a standard deck. What's the probability it's a king given it's a face card? There are 12 face cards, 4 of which are kings: P(KingFace)=4/12=1/3P(\text{King} \mid \text{Face}) = 4/12 = 1/3.

Expected value

For a random variable XX taking values x1,x2,x_1, x_2, \ldots with probabilities p1,p2,p_1, p_2, \ldots:

E[X]=ixipiE[X] = \sum_i x_i \cdot p_i

Example — a $1 bet on a die roll. You pay $1 to play. If you roll a 6, you win $5 (net +4+4). Otherwise you lose your $1 (net 1-1).

E[profit]=(1/6)(4)+(5/6)(1)=4/65/6=1/6E[\text{profit}] = (1/6)(4) + (5/6)(-1) = 4/6 - 5/6 = -1/6

You lose about 17 cents per play on average — don't take this bet.

Key takeaways

  • Probability for equally likely outcomes = favorable / total.
  • P(not A)=1P(A)P(\text{not } A) = 1 - P(A) — the complement trick saves time.
  • Independent: multiply. Mutually exclusive (and not both can happen): add.
  • Expected value tells you the average outcome over many trials.