Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

20.3: Multiplication Rule

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

Example 20.3.1: Counting a small Cartesian product.

What is |A×B| for A={0,1,2,3} and B={1,0,1}?

Solution

We can solve this by just writing out the elements of A×B and counting them.

A×B={(0,1),(0,0),(0,1),(1,1),(1,0),(1,1),(2,1),(2,0),(2,1),(3,1),(3,0),(3,1)}
So |A×B|=12.

Example 20.3.2: Counting a large Cartesian product.

What is |C×D| for C={a,b,c,,z} and D={0,1,2,,99}?

Solution

Writing out all the elements of C×D and then counting them all seems like a lot of work. Instead, using our experience from Worked Example 20.3.1, notice that we usually perform the task of writing the elements of a Cartesian product in a pattern to make sure we get them all. One-by-one we pick a single element of the first set C, and pair it up with every element of the second set D. From this pattern we see that for each cC, there are |D| elements of C×D with c as the first coordinate, and there are |C| such groupings of elements from C×D. So we arrive at

|C×D|=|C||D|=26100=2600.

Checkpoint 20.3.1

For sets X and Y, define an equivalence relation on X×Y whose equivalence classes partition X×Y in the manner described in the provided solution to Worked Example 20.3.2. Then describe how the number of classes and the number of objects in each class correspond to |X| and |Y|.

Theorem 20.3.1: Multiplication Rule.

If there are m ways to perform task S and n ways to perform task T, then there are mn ways to perform task S followed by task T.

Warning 20.3.1

The Multiplication Rule only applies to consecutive tasks S,T such that the number of ways of performing task T is independent of the choice made in performing task S.

Example 20.3.3: Counting Cartesian product elements by constructing an arbitrary element.

To create a specific example of an element from A×B, we must first choose an element of A to be the first coordinate (task S), then choose an element of B to be the second coordinate (task T). There are m=|A| ways to perform task S and n=|B| ways to perform task T. Therefore, the Multiplication Rule says there are mn ways to construct an element of A×B, which means |A×B|=mn.

Example 20.3.4: Choosing candidates.

Suppose you are a casting director and need to select both a primary actor and an understudy for the lead role in a play. If n actors audition for the role, then there are n different ways to select the primary actor. Once this choice is made, there remain n1 different ways to the select the understudy. Hence there are n(n1) ways to cast the role.

Now, the actual pool of candidates for understudy will differ based on which actor is offered the lead role. However, no matter who is chosen for the lead, the number of remaining candidates for understudy is the same.

Note 20.3.1

We may extend the Multiplication Rule to any (finite) number of consecutive tasks.

Example 20.3.5: Cardinality of Cartesian product of many sets.

If A1,A2,,Am are finite sets with |Aj|=mj, then

|A1×A2××A|=m1m2m.

Example 20.3.6: Words of a given length.

Recall that, given alphabet Σ and number nN, Σn is the set of words of length n. If |Σ|=m, what is |Σn|?

Solution

To construct a specific example word wΣn, there are:

  • m ways to choose the first letter,
  • m ways to choose the second letter,
  • …,
  • m ways to choose the nth letter.

So there are

mmmmn factors=mn
ways to construct w. We conclude |Σn|=mn.

Example 20.3.7: Words with no repeated letters.

Suppose |Σ|=5. How many words in |Σ5| have no repeated letters? (That is, in which no two letters are the same?)

Solution

To construct a specific example word wΣ5 in which no two letters are the same, there are

  • 5 ways to choose the first letter,
  • 4 remaining ways to choose the second letter,
  • 3 remaining ways to choose the third letter,
  • 2 remaining ways to choose the fourth letter, and
  • only 1 remaining way to choose the last letter.

So there are

54321=120
ways to construct w.

Similar to Example 20.3.4, while the actual pool of candidates for the next letter at each step will differ based on which letters have been chosen already, the number of remaining letters is always independent of which letters have actually been chosen so far. So the Multiplication Rule can be applied to this problem exactly as we have applied it.

Example 20.3.8: Palindromes.

Let Σ={a,b,c,,y,z}. How many palindromes w with 3|w|6 are there in Σ?

Solution

Break into cases based on the length of w.

Case |w|=3.
Once we choose the first letter, the last is chosen for us, but we are still free to choose the middle letter. So there are 262 palindromes of length 3.

Case |w|=4.
Once we choose the first two letters, the last two are chosen for us. So there are also 262 palindromes of length 4.

Case |w|=5.
Once we choose the first two letters, the last two are chosen for us, but we are still free to choose the middle letter. So there are 263 palindromes of length 5.

Case |w|=6.
Once we choose the first three letters, the last three are chosen for us. So there are also 263 palindromes of length 6.

Total.
Applying the Addition Rule to these non-overlapping cases, we obtain

262+262+263+263=262(1+1+26+26)=54262=36,504
as the number of palindromes length 3 to 6.

Example 20.3.9

Set A={a,b,c} and B={0,1,2,3,4}. How many functions AB exist? How many of these are injections? How many are surjections?

Solution

Number of functions.
A function f:AB can be constructed in three steps: choose f(a), then choose f(b), then choose f(c). Each of the steps can be carried out in |B|=5 ways. So the number of functions is 53=125.

Number of injections.
An injection f:AB can be constructed in three steps: choose f(a), then choose f(b) to be different from f(a), then choose f(c) to be different from both f(a) and f(b). First step has |B|=5 choices. Second step has |B{f(a)}|=4 choices. Third step has |B{f(a),f(b)}|=3 choices. So the number of injections is 543=60.

A look ahead.

Notice that the number of injections has turned out to be

|B|!(|B||A|)!.
We will understand better how this formula arises in Section 21.4.

Number of surjections.
Suppose f:AB. Since |A|=3, the largest that |f(A)| can be is 3, which occurs when f is injective. However, even in such a largest case it is still smaller then |B|, so no surjections exist. That is, the number of surjections is 0.

 
 

This page titled 20.3: Multiplication Rule is shared under a GNU Free Documentation License 1.3 license and was authored, remixed, and/or curated by Jeremy Sylvestre via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?