We havef:{1,2,3}->{1,2}f:{1,2,3}→{1,2} and g:{1,2,3}->{1,2,3,4}g:{1,2,3}→{1,2,3,4}.How many injective ff and gg funtions exist?
1 Answer
Explanation:
A function is injective if no two inputs provide the same output. In other words, something like
can't happen.
This means that, in the case of finite domain and codomain, a function can be injective if and only if the domain is smaller than the codomain (or, at most, equal), in terms of cardinality.
This is why
In other words, we must assing one of two possible ouputs to each of the three inputs. It should be evident that the inputs can't provide different outputs.
On the other hand
But in how many ways? Well, suppose we start again with
When it comes to
By the same logic, we have two choices for
So, we can define