Example 22: Number of one-one functions on {1, 2, 3}
Find the number of all one-one functions from set to itself.
For a one-one function , can be chosen in 3 ways, then in 2 ways, and , different from both, in 1 way.
Required number .
Want the reason behind every step, the basics and the checks?
A function from to itself is fixed by three choices: the value , the value and the value . "One-one" says no value may be used twice. So the three outputs are three different numbers taken from , which means they are in some order. A one-one function here is nothing more than an arrangement (permutation) of the three symbols, and there are arrangements.
- Given
- The set . We consider functions .
- To find
- How many of these functions are one-one.
- Plan
- (1) Describe a function by the list . (2) Translate "one-one" into "the three entries are all different". (3) Count the lists by choosing the entries one at a time (multiplication principle). (4) List all of them to see the count is right, and compare with the total number of functions.
Basics you need
A function assigns to every element of exactly one element of . For a finite , knowing the value at each element tells you the whole function. Basics: what a function is
is one-one when different inputs give different outputs: , or equivalently . Basics: one-one and onto
If a task is done in stages, with ways for the first stage and, whatever happened there, ways for the second, then the task can be done in ways. This extends to any number of stages. Basics: counting choices
An arrangement of different objects in a row is a permutation. There are of them. So . (Class XI, Permutations and Combinations.)
Solution
Describe every function by a list of three values
A function is completely known once we know , and . So we can record it as the ordered list
Each entry is chosen from . For example, the list means . Different lists give different functions, and every list gives a function. Since each of the three entries can be any of 3 values, there are functions from to itself altogether.
Turning a function into a list of values changes a question about "functions" into a question about "lists", and lists are easy to count. Nothing is lost: two functions on the same domain are equal exactly when they agree at every point, which is exactly when their lists are equal.A function must give one output for each input (Basic 1). That is why the list has exactly one entry per input, and why every entry must be filled in.Translate "one-one" into a condition on the list
One-one means no two different inputs share an output. With inputs 1, 2, 3 this says
So the three entries of the list must all be different. Three different numbers taken from the three-element set must use up every element, so the list is just written in some order: a permutation of the three symbols. For instance is not one-one (), while is.
The definition of one-one is about pairs of inputs. A set of three inputs has exactly three pairs, , so checking those three inequalities is a complete check. This is the textbook's observation that a one-one function from to itself "is simply a permutation on three symbols".One-one: (Definition 5, Basic 2). On a finite set, "all outputs different" and "one-one" are the same statement.Count the lists one entry at a time
Build a one-one function by choosing its values in order.
- Choose : any of 1, 2, 3. That is 3 ways.
- Choose : it must differ from , so one value is ruled out. Whatever was, 2 values remain.
- Choose : it must differ from both and , which are two different values. Exactly 1 value remains, so is forced.
By the multiplication principle,
Each path from "start" to the bottom is one one-one function, read as . The tree splits 3 ways, then 2 ways under each branch, then does not split at all, so it has paths. The multiplication principle needs the number of choices at each stage to be the same no matter what was chosen before. It is: after any choice of there are always exactly 2 values left for , and after any two different values there is always exactly 1 left for . The tree shows this: every blue node has two children, every gold node has one.Multiplication principle (Basic 3) and (Basic 4). Counting arrangements of different objects gives because the first place has options, the next , and so on down to 1.List all six to confirm
Function Description 1 2 3 the identity 1 3 2 swaps 2 and 3 2 1 3 swaps 1 and 2 2 3 1 cycles 3 1 2 cycles 3 2 1 swaps 1 and 3 Each row uses 1, 2 and 3 exactly once, so each is one-one, and no permutation of 1, 2, 3 is missing (there are only 6). Hence there are exactly 6 one-one functions from to itself.
The count from Step 3 is an argument; the list is an independent confirmation. Writing them in "dictionary order" (by , then ) makes it easy to see that none is repeated and none is left out. It also shows each one is onto: every element of appears as an output, which matches Example 14 (one-one on forces onto).On a finite set, a one-one function from the set to itself is automatically onto, hence bijective. So these 6 functions are exactly the bijections of . Lesson: types of functionsCompare with all 27 functions
Of the 27 functions in Step 1, the other are not one-one. They split into two kinds:
- Constant functions (all three outputs equal): . That is 3 functions.
- Exactly two different outputs, such as : the remaining functions.
Sorting all 27 functions by how many different outputs they use accounts for every function exactly once, and the three groups add up to the total. That is a strong check that 6 is right. It also shows how restrictive "one-one" is: only 6 of the 27 functions qualify.Every function uses 1, 2 or 3 different output values, never anything else, so these three groups cover all cases without overlap.
A one-one function from to itself is a permutation of the symbols 1, 2, 3, so the number of such functions is . (This agrees with the textbook's answer of 6.)
A computer check (in the site's verification script) runs through all lists and keeps those with three different entries. It finds exactly 6, and they are exactly the six permutations listed in Step 4. The same test on a 4-element set finds one-one functions out of , as the pattern predicts.
- Answering 27. That counts all functions from to (), not just the one-one ones.
- Writing or . The choices shrink (3, then 2, then 1) and are multiplied, not added.
- Thinking the order of the list does not matter. and are different functions: in the first , in the second .
- Forgetting the identity. is one-one and must be counted.
- A function on a finite set is a list of values. Counting functions means counting lists.
- One-one functions from an -element set to itself are the permutations of the set, so there are of them. They are also onto, so they are exactly the bijections.
- The same reasoning gives onto functions from to itself: see Miscellaneous Q4.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| A function gives one output for each input | Step 1 | Definition of a function (Class XI; Lesson: types of functions) |
| One-one (injective) | Step 2 | Definition 5, Section 1.3 |
| Multiplication principle; permutations of objects | Steps 1, 3, 5 | Class XI, Permutations and Combinations (Lesson: counting functions and relations) |
| One-one on implies onto | Step 4 | Example 14, Section 1.3; onto is Definition 6 |
| Counts 6, 21, 18, 3, 27 and | Steps 3–5, Check | Brute force over all functions in the site's verification script |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →