Free preview

23 lessons

Essential Probability & Statistics for ML

Free preview

Essential Probability & Statistics for ML · 23 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 multiplication principle

Counting sequential choices

Explanation

Suppose we pick one of 22 shirts, white or blue, and one of 33 pairs of trousers: jeans, chinos or shorts. The white shirt can go with any of the 33 pairs, which gives 33 outfits. The blue shirt also gives 33. So there are 3+3=2×3=63 + 3 = 2 \times 3 = 6 outfits.

A tree diagram draws a choice like this. It starts at a single point and splits into one branch for each shirt, and each of those branches splits into one branch for each pair of trousers. The endpoints on the bottom row are the leaves, and each leaf is one outcome: the leaf reached through white and then jeans is the outfit (white,jeans)(\text{white}, \text{jeans}).

Taking the trousers first instead gives 3×23 \times 2, the same 66 outfits. The order in which we take the stages does not change the count.

ShirtTrousersStartwhitebluejeanschinosshortsjeanschinosshorts
Click an outcome on the bottom row to follow its route.

Each of the 22 branches splits into 33, so the bottom row has 2×3=62 \times 3 = 6 outcomes.

The same reasoning applies to a choice made in any number of stages.

The multiplication principle

Theorem

A process carried out in kk stages, with nin_i options at stage ii, has

n1×n2×⋯×nkn_1 \times n_2 \times \cdots \times n_k

possible outcomes.

Example

An ice cream shop offers cake cones and waffle cones, and chocolate, vanilla and strawberry ice cream. One cone is ordered with one flavour. Count the possible cones, taking the cone first and then taking the flavour first.

Solution

Taking the cone first, the choice has two stages:

  • Stage 11, the cone: cake or waffle, so n1=2n_1 = 2.
  • Stage 22, the flavour: whichever cone we take, chocolate, vanilla or strawberry, so n2=3n_2 = 3.

The multiplication principle gives

n1×n2=2×3=6.n_1 \times n_2 = 2 \times 3 = 6.

The tree shows the 66 cones on its bottom row.

Stage 1Stage 2Startcakewafflechocolatevanillastrawberrychocolatevanillastrawberry
Click an outcome on the bottom row to follow its route.

Each of the 22 branches splits into 33, so the bottom row has 2×3=62 \times 3 = 6 outcomes.

Taking the flavour first, the stages swap:

  • Stage 11, the flavour: n1=3n_1 = 3.
  • Stage 22, the cone: whichever flavour we take, n2=2n_2 = 2.

The multiplication principle gives

n1×n2=3×2=6,n_1 \times n_2 = 3 \times 2 = 6,

the same 66 cones in a tree of a different shape.

Practice questions

4 questions

A set lunch has 22 starters, 33 main courses and 44 puddings. A diner takes one of each. How many different set lunches are possible?

Select the correct answer:

+ 3 more questions

When multiplication applies

Explanation

The multiplication principle only requires each stage to offer the same number of options whatever was chosen before it, not the same options. For example, a bike shop sells a road frame in red, black or silver, and a mountain frame in green, blue or orange. The colours differ between the frames, but each frame offers 33 of them. In the tree of choices, each frame splits into 33 leaves, one per bike, so the tree has 2×3=62 \times 3 = 6 leaves and there are 66 bikes.

Now suppose the mountain frame comes in green or blue only. We are still counting the leaves of the tree, but the road frame splits into 33 and the mountain frame into 22, so no single number describes the second stage and there is no product to form. Instead, we count the leaves under each frame and add the counts:

3⏟road+2⏟mountain=5.\underbrace{3}_{\text{road}} + \underbrace{2}_{\text{mountain}} = 5.

There are 55 bikes. Whenever the branches in a row split unevenly, we count the leaves under each branch and add them.

FrameColourStartroadmountainredblacksilvergreenblueorange
Click an outcome on the bottom row to follow its route.

The options differ from branch to branch, but each of the 22 branches splits into 33, so the bottom row has 2×3=62 \times 3 = 6 outcomes.

Example

A car hire firm offers a hatchback and an estate. The hatchback comes in red, white or grey, and the estate in black, blue or silver. The hatchback can be hired with a manual or an automatic gearbox, but the estate is automatic only. Does the multiplication principle count the possible hires? How many are there?

Solution

We take the stages in turn and ask of each whether it offers the same number of options whatever was chosen before it.

  • Stage 11, the car: hatchback or estate, so n1=2n_1 = 2.
  • Stage 22, the colour: the colours differ between the cars, but each car offers 33, so n2=3n_2 = 3.
  • Stage 33, the gearbox: 22 for the hatchback but 11 for the estate, so there is no single n3n_3.

The third stage fails the check, so the multiplication principle does not apply, and 2×3×2=122 \times 3 \times 2 = 12 is not the number of hires. We count car by car and add. The hatchback gives 3×2=63 \times 2 = 6 hires and the estate gives 3×1=33 \times 1 = 3, so

6+3=9.6 + 3 = 9.

There are 99 possible hires.

Practice questions

4 questions

A phone shop sells two tariffs. The monthly tariff can be taken with any of 44 handsets, and the yearly tariff can be taken with any of 44 different handsets. Does the multiplication principle count the tariff-and-handset pairs on sale, and if so, how many are there?

Select the correct answer:

+ 3 more questions