liveBook · Manning

Multiplication rule

As explained in Statistics Every Programmer Needs

The multiplication rule of counting determines the number of outcomes formed by successive choices by multiplying the numbers of options at each stage.

The multiplication rule counts outcomes formed by choices made together or in sequence. If there are n₁ options for the first choice, n₂ for the second, and so on, multiply them: total outcomes = n₁ × n₂ × … × nᵢ. Use this form when each choice leaves the stated number of options available at the other stages. section 2.2.1

Count outcomes before calculating probability

Two six-sided dice produce 6 × 6 = 36 ordered outcomes: (3, 2) and (2, 3) are different. To find the probability that the first die shows 1, 2, or 3 and the second shows 4, 5, or 6, count 3 × 3 = 9 successful outcomes. The probability is 9/36 = 25%. section 2.2.1 section 3.2.3

The same reasoning gives 26 × 26 × 26 × 10 × 10 × 10 = 17,576,000 plates with three letters followed by three numerals. When every position has the same options and reuse is allowed, exponentiation shortens the product: a three-digit lock has 10³ = 1,000 settings. If reuse is not allowed, later positions have fewer options; do not keep multiplying by the original count. section 2.2.1 section 2.2.3

>>> num_permutations = n ** r
>>> print(f'Number of permutations with replacement: {num_permutations}')
Number of permutations with replacement: 125

The Python listing computes 5³ as `n ** r` and prints 125 permutations with replacement: five available choices at each of three positions. section 2.2.3

Choose the rule to match the question. Multiply counts for combined independent choices; add counts for mutually exclusive alternatives, such as flipping a coin *or* rolling a die. For independent events, a related probability rule multiplies their individual probabilities—for example, the probabilities of rolling a 4 on each of two dice. section 2.2.2 section 3.2

How Statistics Every Programmer Needs covers it

How deep it goes
Defines the product formula, works through dice and repeated-position counts, and flags independent choices and changing options.
Examples
Uses ordered dice rolls, license plates, three-digit locks, and a Python calculation of 5³ = 125.
What it assumes
Assumes basic multiplication while defining the independent-choice condition and demonstrating probability from outcome counts.
What you can do after
Apply it to count combined outcomes and calculate probabilities from successful and total outcome counts.
How it connects
Links to the addition rule, independent-event probability, theoretical probability, and permutations with replacement.

Also explained in

Compare how 2 books explain multiplication rule →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.