Let and . Then the number of elements in the setand is not one-one is ...
Solution
Core idea. When two conditions are combined, each subtraction must be made within the set already counted.
Concept refresher. The number of all functions from a set of elements to a set of elements is
and those that avoid one given value number .
Picture the situation. There are functions from to . The condition removes those that map into . "Not one-one" removes the functions with three different values, but only those among the functions already counted.
Approach. Count functions with 2 in the range, count the one-one functions among them, and subtract.
Step 1: Range contains 2
All functions number and those avoiding 2 number , so 37 functions take the value 2.
Step 2: One-one among them
The one-one functions number , and those avoiding 2 number , so 18 one-one functions take the value 2. Removing them leaves .
Answer. 19
Sanity check. Directly: the three values are all 2 in 1 way, two 2s with another value in ways, and one 2 with a repeated other value in ways, which is 19.
Common wrong answers
- 13: Removing all 24 one-one functions from 37 gives 13, but 6 of them never take the value 2.
- 40: Counting all functions that are not one-one gives .
Key takeaway
The trap. Some one-one functions avoid the given value and were never counted.
How toppers think. They confirm the count by listing the patterns of values.
Remember.