Skip to content
Tutorials Center
My learning

Topics

Lesson 44 of 86 ยท Permutations, Combinations and Probability

Probability

Learn sample space, events and complements, then solve dice, coin, card and ball problems, and check the answers with a seeded simulation.

Probability measures how likely something is, on a scale from 0 (impossible) to 1 (certain). In aptitude tests it is the natural next step after counting: you count the outcomes you want, count all the outcomes that can happen, and divide. Almost every beginner question about dice, coins, cards and bags of balls works this way.

This lesson sets out the vocabulary, the one formula that covers equally likely outcomes, the complement trick, and the standard objects (dice, coins, a pack of cards). You will also run a small simulation, so you can watch the exact answers appear from random experiments. The counting tools come from Counting Principles and Permutations and Combinations.

Sample space and events

An experiment is any process with an uncertain result, such as rolling a die. Its sample space is the set of all possible outcomes. An event is a set of outcomes you care about.

  • Roll one die: sample space {1, 2, 3, 4, 5, 6}.
  • Event "even number": {2, 4, 6}.
  • Event "more than 6": {} (impossible).

When every outcome is equally likely (a fair die, a fair coin, a well-shuffled pack), the probability of an event E is

P(E) = number of outcomes in E รท number of outcomes in the sample space

Example 1. Probability of a prime number on a fair die. The primes are 2, 3, 5, so P = 3/6 = 1/2. (Note that 1 is not prime.)

Probabilities always lie between 0 and 1. If you get 7/5 or โˆ’0.2, something went wrong.

flowchart LR
    S["Sample space<br/>all outcomes"] --> E["Event E<br/>favorable outcomes"]
    S --> N["Not E<br/>all the others"]
    E --> F["P(E) = favorable / total"]
    N --> G["P(not E) = 1 - P(E)"]

An event and its complement together make up the whole sample space.

The complement rule

The complement of an event E is "E does not happen". Together E and not-E cover every outcome exactly once, so

P(not E) = 1 โˆ’ P(E)

This is a great shortcut whenever the phrase "at least one" appears, because "at least one" is the complement of "none".

Example 2. Three fair coins are tossed. What is the probability of at least one head? There are 2 ร— 2 ร— 2 = 8 outcomes. "No heads" is only TTT, so P(no head) = 1/8, and P(at least one head) = 1 โˆ’ 1/8 = 7/8.

Coins

For n coins, the sample space has 2โฟ outcomes. The number of outcomes with exactly r heads is the combination nCr, so

P(exactly r heads) = nCr รท 2โฟ

Example 3. Three coins, exactly two heads: 3C2 = 3 outcomes (HHT, HTH, THH), so P = 3/8.

Dice

One die has 6 outcomes. Two dice have 6 ร— 6 = 36 equally likely outcomes, and you should treat the dice as distinguishable: (2, 5) and (5, 2) are two different outcomes. Counting the ways to each sum is a standard exercise:

Sum 2 3 4 5 6 7 8 9 10 11 12
Ways 1 2 3 4 5 6 5 4 3 2 1

Example 4. The probability that the sum is 7 is 6/36 = 1/6, the most likely sum. The probability of a sum that is a multiple of 5 (5 or 10) is (4 + 3)/36 = 7/36.

JS Two dice by enumeration

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Playing cards

A standard pack has 52 cards: 4 suits (spades and clubs are black; hearts and diamonds are red) with 13 cards each: A, 2 to 10, J, Q, K. There are 12 face cards (J, Q, K in each suit), 26 red and 26 black cards, 4 cards of each rank.

When one card is drawn at random:

  • P(a king) = 4/52 = 1/13
  • P(a heart) = 13/52 = 1/4
  • P(a face card) = 12/52 = 3/13
  • P(not a king) = 1 โˆ’ 1/13 = 12/13
  • P(a red king) = 2/52 = 1/26

For several cards drawn together, use combinations. Example 5: the probability that two cards drawn together are both aces is 4C2 รท 52C2 = 6 รท 1,326 = 1/221.

Balls and bags

The same method handles colored balls. A bag has 4 red, 5 green and 3 blue balls (12 in all). One ball is drawn:

  • P(red) = 4/12 = 1/3
  • P(not green) = 1 โˆ’ 5/12 = 7/12
  • P(red or blue) = (4 + 3)/12 = 7/12

For two balls drawn together, count with combinations. Example 6: P(both green) = 5C2 รท 12C2 = 10 รท 66 = 5/33.

Odds versus probability

Odds compare "for" with "against". If P(E) = 3/8, then the odds in favor are 3 : 5 (three ways to succeed for every five ways to fail). Odds of a : b in favor correspond to probability a/(a + b). Many students mix these up: a probability of 1/2 corresponds to odds of 1 : 1, not 1 : 2.

Experiments and long-run frequency

The formula describes what happens on average. If you repeat an experiment many times, the fraction of trials in which the event occurs gets closer to P(E), although a short run can look quite different. The next TryIt uses a seeded random-number generator (so you see the same numbers every time) to roll two dice and flip three coins 100,000 times.

JS Simulation versus exact answer

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The simulated numbers land close to 0.1667 and 0.8750 but are not identical. A simulation estimates a probability; the counting formula gives it exactly.

Common mistakes

  • Treating outcomes as equally likely when they are not. "Sum is 7 or sum is 2" are not equally likely, even though each is one value: count the ways first.
  • Counting (2, 5) and (5, 2) as one outcome for two different dice.
  • Forgetting that 1 is not prime, and that 0 is even.
  • Computing "at least one" directly instead of with the complement.

If a question says "a fair coin", "a fair die" or "at random", you can assume equally likely outcomes. Without such words, check what the problem tells you before you divide.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. A fair die is rolled once. What is the probability of getting a prime number?

    The primes on a die are 2, 3 and 5, so 3 favorable outcomes out of 6 give 1/2.
  2. 2. A card is drawn at random from a standard pack of 52. What is the probability that it is not a king?

    P(king) = 4/52 = 1/13, so P(not a king) = 1 - 1/13 = 12/13.
  3. 3. A bag holds 4 red, 5 green and 3 blue balls. One ball is drawn at random. What is the probability that it is not green?

    There are 12 balls and 5 are green, so P(not green) = 7/12.
  4. 4. Two fair dice are rolled. What is the probability that the sum is a multiple of 5?

    Sum 5 can happen in 4 ways and sum 10 in 3 ways, so 7 favorable outcomes out of 36 give 7/36.
  5. 5. Four fair coins are tossed. What is the probability of at least one tail?

    No tails means HHHH, which has probability 1/16, so at least one tail has probability 1 - 1/16 = 15/16.

Summary

  • For equally likely outcomes, P(E) = favorable outcomes รท total outcomes, always between 0 and 1.
  • P(not E) = 1 โˆ’ P(E); use it for "at least one" questions.
  • Two dice have 36 outcomes, with the sum 7 the most likely (6 ways); n coins have 2โฟ outcomes.
  • A pack has 52 cards, 12 face cards and 4 of each rank; use combinations for several cards or balls drawn together.
  • Odds a : b in favor mean probability a/(a + b), and simulations estimate what counting gives exactly.

Next: Conditional Probability and Independent Events, where events are combined with "and" and "or".