Skip to main content
Statistics LibreTexts

3.7: Counting Rules

  • Page ID
    36659
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Learning Objectives
    • Use the Fundamental Counting Rule
    • Compute factorials, permutations and combinations
    • Understand when to use each method
    • Find probabilities using counting rules

    There are times when the sample space is very large and is not feasible to write out. In that case, it helps to have mathematical tools for counting the size of the sample space. These tools are known as counting techniques or counting rules.

    Fundamental Counting Rule

    Definition: Fundamental Counting Rule

    Fundamental Counting Rule: If event 1 can be done m1 ways, event 2 can be done m2 ways, and so forth to event n being done mn ways, then the number of ways to do event 1, followed by event 2,…, followed by event n together would be to multiply the number of ways for each event: m1·m2···mn.

    Example \(\PageIndex{1}\)

    A menu offers a choice of 3 salads, 8 main dishes, and 5 desserts. How many different meals consisting of one salad, one main dish, and one dessert are possible?

    Solution

    There are three events: choosing a salad, a main dish, and a dessert. There are 3 choices for salad, 8 choices for the main dish, and 5 choices for dessert. The ways to choose a salad, main dish, and dessert are: \(\underset{\overline{\text { salad }}} {3} \times \underset{\overline{\text { main dish }}}{8} \times \underset{\overline{\text{ dessert }}}{5}\) = 120 different meals.

    Example \(\PageIndex{2}\)

    How many 4-digit debit card personal identification numbers (PIN) can be made?

    Solution

    There are four events in this example. The events are picking the first number, then the second number, then the third number, and then the fourth number. The first event can be done 10 ways since the choices are the numbers 1 through 9 and 0. We can use the same numbers over again (repeats are allowed) for the second number, so it can also be done 10 ways. The same with the third and fourth numbers, which also have 10 choices.

    There are \(\underset{\overline{\text { first number }}}{10} \times \underset{\overline{\text { second number }}}{10} \times \underset{\overline{\text { third number }}}{10} \times \underset{\overline{\text { fourth number }}}{10} \) = 10,000 possible PINs.

    Example \(\PageIndex{3}\)

    How many ways can the three letters a, b, and c be arranged with no letters repeating?

    Solution

    There are three events in this case. The events are to pick the first letter, then the second letter, and then the third letter. The first event can be done 3 ways since there are 3 letters. The second event can be done 2 ways, since the first event took one of the letters (repeats are not allowed). The third event can be done 1 way, since the first and second events took 2 of the letters.

    There are \(\underset{\overline{\text { first letter }}}{3} \times \underset{\overline{\text { second letter }}}{2} \times \underset{\overline{\text { third letter }}}{1} \) = 6 ways to arrange the letters.

    You can also use the tree diagram in Figure \(\PageIndex{1}\) to visualize the arrangements. There are 6 different arrangements of the letters, which can be found by multiplying 3·2·1 = 6.

    Tree diagram.  First choice a, branches to second choice b and third choice c for outcome abc.  First choice a, branches to second choice c and third choice b for outcome acb.  First choice b, branches to second choice a and third choice c for outcome bac.  First choice b, branches to second choice c and third choice a for outcome bca.  First choice c, branches to second choice a and third choice b for outcome cab.  First choice c, branches to second choice b and third choice a for outcome cba.

    Figure \(\PageIndex{1}\)

    Factorials, Permutations and Combinations

    If we have 10 different letters for, say, a password, the tree diagram would be very time-consuming to make because of the length of options and tasks, so we have some shortcut formulas that help count these arrangements.

    Many counting problems involve multiplying a list of decreasing numbers, which is called a factorial. The factorial is represented mathematically by the starting number followed by an exclamation point, in this case 3! = 3·2·1 = 6. There is a special symbol for this and a special button on your calculator for the factorial.

    Formula: Factorial Rule

    Factorial Rule: The number of different ways to arrange n distinct objects is

    \(n! = n \cdot (n – 1) \cdot (n – 2) \ldots \cdot 3 \cdot 2\cdot 1\), where repetitions are not allowed.

    0 factorial is defined to be 0! = 1 and 1 factorial is defined to be 1! = 1.

    TI-84 Plus: Enter the number of which you would like to find the factorial. Press [MATH]. Use cursor keys to move to the PRB (or PROB) menu. Press 4 (4:!). Press [ENTER] to calculate.

    Excel: In an empty cell type in =FACT(n), where n is the number of which you would like to find the factorial. Thus 4! would be =FACT(4).

    Example \(\PageIndex{4}\)

    How many ways can you arrange 5 people standing in line?

    Solution

    No repeats are allowed since you cannot reuse a person twice in the line. Order is important since the first person is first in line and will be selected first. This meets the requirements for the factorial rule. There are 5! = 5·4·3·2·1 = 120 ways to arrange 5 people standing in line.

    Sometimes we do not want to select the entire group but only select r objects from n total objects. The number of ways to do this depends on if the order you choose the r objects matters or if it does not matter. As an example, if you are trying to call a person on the phone, you have to have the digits of their number in the correct order. In this case, the order of the numbers matters. If you were picking random numbers for the lottery, it does not matter which number you pick first since they always arrange the numbers from the smallest to largest once the numbers are drawn. As long as you have the same numbers that the lottery officials pick, you win. In this case, the order does not matter.

    A permutation is an arrangement of items with a specific order. You use permutations to count items when the order matters.

    Formula: Permutation Rule

    Permutation Rule: The number of different ways of picking r objects from n distinct total objects when repeats are not allowed and order matters is \({ }_{n} P_{r} = P(n, r) = \dfrac{n !}{(n-r) !}\).

    When the order does not matter, you use combinations. A combination is an arrangement of items when order is not important. When you do a counting problem, the first thing you should ask yourself is “Are repeats allowed?”, then ask yourself “Does order matter?”

    Formula: Combination Rule

    Combination Rule: The number of ways to select r objects from n distinct total objects when repeats are not allowed and order does not matter is \({ }_{n} C_{r} = C(n, r) = \dfrac{n !}{r !(n-r) !}\).

    TI-84 Plus: Enter the number of total objects (n). Press [MATH]. Use cursor keys to move to the PRB (or PROB) menu. Press 2 for permutation (2: nPr), or 3 for combination (3: nCr). Enter the number of objects to be selected (r). Press [ENTER] to calculate.

    Excel: In a blank cell, type the formula =COMBIN(n, r) or =PERMUT(n, r) where n is the total number of objects and r is the number of objects that you are selecting. For example, =COMBIN(8, 3).

    The following flow chart in Figure \(\PageIndex{2}\) may help with deciding which counting rule to use.

    Start at the top: ask yourself if the same item can be repeated. For instance, a person on a committee cannot be counted as two distinct people; however, a number on a car license plate may be used twice. If repeats are not allowed, then ask, does the order in which the item is chosen matter? If it does not, then use a combination. If it does, then ask if you are ordering the entire group. If so, use a factorial. If only ordering some from the total, use a permutation.

    Flow chart.  Are repeats allowed?  Yes, then use the Fundamental Counting Rule (multiply the total number of outcomes in each event).  No, then does the order matter?  Yes, then how many are you ordering?  If r out of n, use a permutation.  If ordering all of n, use n!.  If the order does not matter, use a combination.

    Figure \(\PageIndex{2}\)

    Example \(\PageIndex{5}\)

    Circle K International, a college community service club, has 15 members this year. How many ways can a board of officers consisting of a president, vice-president, secretary and treasurer be elected?

    Solution

    In this case, repeats are not allowed since the same member cannot hold more than one position. The order matters because if you elect person 1 for president and person 2 for vice-president, there would be different members in those positions than if you elect person 2 for president, person 1 for vice-president. Thus, this is a permutation problem with n = 15 and r = 4. There are \({ }_{15} P_{4}=\dfrac{15 !}{(15-4) !}=\dfrac{15 !}{11 !}=32,760 \) ways to elect the 4 officers.

    In general, if you were selecting items that involve rank, a position title, 1st, 2nd, or 3rd place or prize, etc., then the order in which the items are arranged is important and you would use permutation.

    Example \(\PageIndex{6}\)

    Circle K International, a college community service club, has 15 members this year. They need to select 2 members to be representatives for the school's Inter-Club Council. How many ways can the 2 members be chosen?

    Solution

    In this case, repeats are not allowed, since there must be 2 different members as representatives. The order in which the representatives are selected does not matter since they have the same position. Thus, this is a combination problem with n = 15 and r = 2. There are \({ }_{15} C_{2} =\dfrac{15 !}{2 !(15-2) !}=\dfrac{15 !}{2 ! \cdot 13 !} = 105\) ways to select 2 representatives.

    The counting rules can be used in the probability rules to calculate the number of ways that an event can occur.

    Example \(\PageIndex{7}\)

    An iPhone has a 6-digit numerical password to unlock the phone. What is the probability of guessing the password on the first try?

    Solution

    In this case, repeats are allowed for the password. The order in which the numbers are entered into the phone matters. Thus, the Fundamental Counting Rule must be used to find the total number of possible passwords. There are 10LaTeX: \times10LaTeX: \times10LaTeX: \times10LaTeX: \times10LaTeX: \times10 = 106 = 1,000,000 possible passwords. There is only one correct password, so the number of ways to correctly guess is 1. Thus, the probability of guessing the password correctly on the first try is \(P(\text{correct guess}) = \dfrac{\text{Number of ways to guess correctly}}{\text{Number of possible passwords}} = \dfrac{1}{1,000,000} = 1 \times 10^{-6} = 0.000001\).

    Example \(\PageIndex{8}\)

    What is the probability of winning the jackpot in the Powerball Lottery? To play, you must pick 5 numbers between 1 and 69, and pick one Power Number between 1 and 26. You must match all 6 numbers to win the jackpot. (https://www.calottery.com/draw-games/powerball)

    Solution

    In this case, repeats are not allowed for the 5 numbers since there must be 5 different numbers selected. The Power Number is selected separately, and may be the same as one of the first 5 numbers selected. Since the order that the 5 numbers are selected does not matter, the total number of different ways to pick 5 is a combination. There are \({}_{69} C_{5} = \dfrac{69!}{5!(69-5)!} = \dfrac{69!}{5! \cdot 64!}\) = 11,238,513 ways to pick 5 numbers from 1 to 69. There are \({}_{26} C_{1}\) = 26 ways to pick a Power Number. By the Fundamental Counting Rule, there are 11,238,513 LaTeX: \times 26 = 292,201,338 ways to pick 5 numbers plus a Power Number. There is only one winning combination, so the number of ways to win is 1. Thus, the probability of winning is \(P(\text{win}) = \dfrac{\text{Number of ways to win}}{\text{Number of different ways to play}} = \dfrac{1}{292,201,338} = 3.42 \times 10^{-9} \approx 0.00000000342\). This is an astronomically small chance of winning the jackpot!

    Example \(\PageIndex{9}\)

    What is the probability of getting a full house if 5 cards are randomly dealt from a standard deck of cards?

    Solution

    A full house consists of 3-of-a-kind and a pair. For example, 3 queens and a pair of 2s. There are \({}_{13} C_{1}\) ways to choose a card between ace, 2, 3, … king for the 3-of-a-kind. Once a card is chosen, there are 4 cards with that rank and there are \({}_{4} C_{3}\) ways to choose a 3-of-a-kind from that rank. Since the card chosen for the 3-of-a-kind cannot be chosen for the pair, there are \({}_{12} C_{1}\) ways to choose a card for the pair. Once a card is chosen for the pair, there are \({}_{4} C_{2}\) ways to choose a pair from that rank. All together there are \({}_{52} C_{5}\) ways to randomly deal 5 cards from a deck. Using the Fundamental Counting Rule, the probability of getting a full house is \(P(\text{full house}) = \dfrac{ {}_{13} C_{1} \times {}_{4} C_{3} \times {}_{12} C_{1} \times {}_{4} C_{2} }{ {}_{52} C_{5} } = \dfrac{13 \times 4 \times 12 \times 6}{2,598,960} = \dfrac{3744}{2,598,960} = 0.00144\).


    This page titled 3.7: Counting Rules is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Rachel Webb via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.