Free preview

38 lessons

Essential Probability & Statistics for ML

Free preview

Essential Probability & Statistics for ML · 38 lessons

Master the fundamentals

No surprise gaps

Actually remember it

Skip what you know

One subscription. All learning paths included.

Our content is best on a larger screen

The naive definition of probability

Equally likely outcomes

Explanation

We've seen that two identical dice, once labelled, give 3636 outcomes. Grouping them by the numbers that appear gives 2121 events instead: "a 55 and a 66" holds (5,6)(5, 6) and (6,5)(6, 5), while "double 66" holds only (6,6)(6, 6).

Leibniz, one of the two founders of calculus, claimed that "it is equally likely to throw twelve points, than to throw eleven; because one or the other can be done in only one manner". He was wrong. A sum of 1111 comes from die 11 showing 55 and die 22 showing 66, or the other way round, while a sum of 1212 comes only from two 66s. Identical dice are still two separate dice; labelling them lets us count both ways.

This is where the difference between an outcome and an event matters. An outcome is one result the experiment can produce. An event is a set of outcomes, picked out by a description we choose: "a sum of 1111" is the event {(5,6),(6,5)}\{(5, 6), (6, 5)\}. Leibniz treated events as if they were outcomes.

Equally likely outcomes

Definition

The outcomes of a random experiment are equally likely when every outcome in the sample space Ω\Omega has the same chance of occurring.

The words fair, chosen at random, shuffled and dealt state that the labelled outcomes are equally likely. A stated bias, such as a die weighted towards 66, states that they are not.

For two fair dice, the 3636 outcomes are equally likely. An event's chance depends on how many of them it holds, so "a 55 and a 66" is twice as likely as "double 66", and the 2121 events are not equally likely.

Example

Two fair coins are tossed. Are 00 heads, 11 head and 22 heads equally likely?

Solution

We label the coins, coin 11 and coin 22, so that an outcome records what each coin shows. The coins are fair, so these labelled outcomes are equally likely:

Ω={HH,HT,TH,TT}.\Omega = \{HH, HT, TH, TT\}.

Each number of heads is an event, so we count the outcomes it holds:

  • 00 heads is {TT}\{TT\}, 11 outcome.
  • 11 head is {HT,TH}\{HT, TH\}, 22 outcomes.
  • 22 heads is {HH}\{HH\}, 11 outcome.

The three events hold different numbers of outcomes, so they are not equally likely: 11 head has a greater chance than 00 heads. The equally likely outcomes are the four labelled ones, HHHH, HTHT, THTH and TTTT.

Practice questions

6 questions

A jar holds 77 green counters and 33 yellow counters, identical apart from colour. One counter is drawn at random. Which statement is correct?

Select the correct answer:

+ 5 more questions

Probability as a ratio

Explanation

Once the outcomes of an experiment are equally likely, finding the chance of an event is a matter of counting. We picture this with pebble world, a framing from Blitzstein and Hwang's Introduction to Probability.

We draw the sample space Ω\Omega as a pile of pebbles, one per outcome. Every pebble has the same mass, and the whole pile has mass 11. An event is a handful of those pebbles, and its probability is the share of the mass that the handful holds.

On a fair die each of the six pebbles has mass 16\dfrac{1}{6}. The even faces 22, 44 and 66 are three of them, so the chance of an even roll is 36=12\dfrac{3}{6} = \dfrac{1}{2}.

123456
  • AA: shaded

Click or press Enter on a pebble to move it in or out of AA: the red ones are in.

∣A∣=3\lvert A \rvert = 3, ∣Ω∣=6\lvert \Omega \rvert = 6, P(A)=36=12.P(A) = \dfrac{3}{6} = \dfrac{1}{2}.

One pebble per face of a fair die.

The naive definition of probability

Definition

Let Ω\Omega be a finite sample space whose outcomes are equally likely, and let A⊆ΩA \subseteq \Omega be an event. The probability of AA is

P(A)=∣A∣∣Ω∣,P(A) = \dfrac{|A|}{|\Omega|},

the number of favourable outcomes, the outcomes in AA, divided by the number of outcomes in Ω\Omega.

So nothing here is new: a probability is one count divided by another, the number of outcomes in AA divided by the number in Ω\Omega, and we already know how to count.

We read P(A)P(A) as "the probability of AA" and give it as a fraction in lowest terms.

Example

Three fair coins are flipped and the sequence of results is recorded. Find the probability of getting exactly two heads.

Solution

The coins are fair, so every sequence of three results is equally likely, and each sequence is one outcome. We list them:

Ω={HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}∣Ω∣=8\begin{align*} \Omega &= \{HHH, HHT, HTH, HTT, THH, THT, TTH, TTT\} \\ |\Omega| &= 8 \end{align*}

The event AA is "exactly two heads", so we keep the sequences with two HHs and one TT. Reading down the list:

A={HHT,HTH,THH}∣A∣=3\begin{align*} A &= \{HHT, HTH, THH\} \\ |A| &= 3 \end{align*}

These are the favourable outcomes, so

P(A)=∣A∣∣Ω∣=38.P(A) = \dfrac{|A|}{|\Omega|} = \dfrac{3}{8}.

Practice questions

5 questions

A random experiment has 1212 equally likely outcomes, drawn as a pile of 1212 pebbles of equal mass. Five of the pebbles lie in the event AA. What is P(A)P(A)?

Select the correct answer:

+ 4 more questions