StatisticsSciPy 1.18 · pandas 3.0 · statsmodels 0.15 · Python 3.12 or 3.13
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
57 small wins to finish your pathNext lesson →

Multiplication rule and independent events

The multiplication rule of probability is the formula for P(A and B), the chance that two events both happen: P(A) × P(B | A), which becomes P(A) × P(B) when the events are independent.

Last updated: 07 Oct, 2026 · SciPy 1.18

The Addition rule of probability answers "or" questions. "And" questions, such as a 5 and then a 4, or a queen and then an ace, need the multiplication rule, and the first step is to ask whether the events are independent.

Recognising independent events

Roll a die again and again and you might see 1, 1, 2, and so on. The die has no memory: a 1 on the first roll does not change the chances on the second, which are still 1/6 for every face. Events like these are independent: the outcome of one does not change the probability of the other.

Independence is about this "does not change" idea, not about the outcomes being equally likely. A loaded die that lands on 6 half the time still gives independent rolls, because each roll has the same loaded chances whatever came before. In symbols, A and B are independent when P(B | A) = P(B), which is the same as P(A and B) = P(A) × P(B).

Dependent events with marbles, and rolling a 5 then a 4 · from the Complete Statistics for Data Science in 6 Hours video · 2:44:53 to 2:48:23

Drawing marbles without replacement

The video's bag holds 3 red marbles and 2 green marbles. The chance of drawing a red one first is 3/5. Suppose a red one is drawn and kept out. The bag now holds 2 red and 2 green, so the chance of a green on the next draw is 2/4.

Top, three die rolls 1, 1, 2, where each roll has probability 1/6 for every face whatever came before. Bottom, a bag of 3 red and 2 green marbles gives P(red) = 3/5; after a red marble is drawn and not replaced the bag holds 2 red and 2 green, so P(green) = 2/4.

The first draw changed the bag, so it changed the probability of the second draw. These are dependent events. What makes them dependent is drawing without replacement. If the red marble went back into the bag, the second draw would again be green with probability 2/5, and the draws would be independent.

Multiplying independent probabilities

The video's first question: what is the probability of rolling a 5 and then a 4? The rolls are independent, so the chances multiply:

The multiplication rule for independent events

There are 6 × 6 = 36 equally likely pairs of rolls and (5, 4) is one of them, which gives the same 1/36.

Multiplying dependent probabilities

For dependent events the second factor is a conditional probability, P(B | A), read "the probability of B given A": the chance of B once A has happened.

The multiplication rule for any two events

For the marbles, P(red then green) = 3/5 × 2/4 = 6/20 = 3/10.

The board's second question: what is the probability of drawing a queen and then an ace from a deck, without putting the queen back? There are 4 queens in 52 cards. After a queen is drawn, 51 cards are left and all 4 aces are still among them:

A queen and then an ace, without replacement

If the queen goes back and the deck is shuffled, the draws are independent and the answer is (4/52)² = 1/169 ≈ 0.00592. The general rule P(A) × P(B | A) always holds; for independent events P(B | A) = P(B) and it becomes the simple product.

Checking the rule by listing every draw

The code lists every ordered pair of draws and counts the pairs the question asks for, so each answer is checked against the rule.

ExampleFrom the video, run on Python 3.12
from fractions import Fraction
from itertools import permutations, product

# two rolls of a die: 36 equally likely ordered pairs
pairs = list(product(range(1, 7), repeat=2))
print("P(5 then 4) =", Fraction(pairs.count((5, 4)), len(pairs)))

# marbles: 3 red, 2 green, two draws without replacement
bag = ["R1", "R2", "R3", "G1", "G2"]
draws = list(permutations(bag, 2))               # 20 ordered draws
red_green = [d for d in draws if d[0][0] == "R" and d[1][0] == "G"]
print("P(red then green) =", Fraction(len(red_green), len(draws)), "  rule:", Fraction(3, 5) * Fraction(2, 4))

# a queen and then an ace, without replacement
deck = [(r, s) for r in "A23456789TJQK" for s in "SHDC"]
two = list(permutations(deck, 2))                # 52 * 51 = 2652 ordered draws
qa = sum(1 for c1, c2 in two if c1[0] == "Q" and c2[0] == "A")
print("P(Q then A) =", Fraction(qa, len(two)), "=", round(qa / len(two), 5), " (", qa, "of", len(two), ")")
print("with replacement:", Fraction(4, 52) ** 2, "=", round((4 / 52) ** 2, 5))

# a 1 and a 2 on the SAME roll: mutually exclusive, so not independent
print("same roll: P(1 and 2) = 0, but P(1) x P(2) =", Fraction(1, 6) * Fraction(1, 6))

What the listed draws show

  • P(5 then 4) = 1/36: one pair out of 36, the same as 1/6 × 1/6.
  • P(red then green) = 3/10: 6 of the 20 ordered draws, matching 3/5 × 2/4.
  • P(Q then A) = 4/663 ≈ 0.00603: 16 of the 2,652 ordered pairs, matching 4/52 × 4/51.
  • With replacement the answer is 1/169 ≈ 0.00592: slightly smaller, because the ace is again one of 4 in 52 cards instead of 4 in 51.
  • A 1 and a 2 on one roll: the true chance is 0, while the product of their chances is 1/36. Mutually exclusive events are not independent.

Independent vs mutually exclusive

IndependentMutually exclusive
MeaningOne event does not change the other's probabilityThe events cannot happen together
P(A and B)P(A) × P(B)0
Rule it feedsMultiplication rule, "and"Addition rule, "or"
ExampleA 5 on the first roll, a 4 on the secondA 1 and a 2 on the same roll

Two events that both have a positive probability cannot be mutually exclusive and independent at once: if they are mutually exclusive, knowing that A happened makes B impossible, which is the opposite of "does not change its probability".

Where you use the multiplication rule

  • Systems in series: two independent servers each up 99% of the time are both up 0.99 × 0.99 = 98.01% of the time.
  • Sampling without replacement: drawing a committee, quality-checking items from a small batch, dealing cards.
  • Naive Bayes: the classifier multiplies the probabilities of the words in an email as if they were independent; see Naive Bayes.
Watch out. Multiplying P(A) × P(B) for events that are not independent. Draws without replacement, or two measurements on the same person, change each other's chances; use P(A) × P(B | A) instead.
Try it yourself
  • Change the bag to 3 green and 2 red, the board's second bag, and count P(green then red). Is it 3/5 × 2/4 = 3/10 again?
  • Count P(two aces in a row) without replacement. Is it 4/52 × 3/51 = 1/221?
  • Count P(a 6 on both rolls) from pairs. Is it 1/36, and is P(no 6 on either roll) 25/36?

Slow is fine. Stopping is the only problem.