Count number of functions

139 Views Asked by At

Given $A=\bigl\{f\mid f:\{1,2,3\} \rightarrow \{1,2,3,4\}\bigr\},\; f$ is a function.

How many elements of $A$ satisfy $f(3)>f(2)$?

I know that the total amount of functions is $4^3$, I am not sure how to proceed with the sets needed. Can you help me define the sets I need to work with?

1

There are 1 best solutions below

0
On BEST ANSWER

Hint: Each two-element subset of $\{1,2,3,4\}$ can be uniquely assigned to the values of $f(2),f(3)$ such that $f(2)<f(3)$ and vice versa. For example $\{2,4\}$ would correspond with $f(2)=2$ and $f(3)=4$, while $\{4,1\}$ would correspond with $f(2)=1$ and $f(3)=4$. (Remember $\{4,1\}=\{1,4\}$, that order within a /set/ is irrelevant)

How many ways are there to choose a two-element subset of a four-element set? This is then the number of ways of selecting the values for $f(2)$ and $f(3)$. Couple this as well with the number of ways of selecting the value of $f(1)$ and apply the rule of product to arrive at a final answer.

Your answer in the (now deleted) comments of the other answer: "I think I got it. Is it possible to add 4(3)+4(2)+4(1)? First choosing the element for f(2) and counting the numbers that make f(3)>f(2)?" This is correct and $4(3)+4(2)+4(1)$ is indeed the correct answer... However... it feels a bit too much like brute force and does not as easily generalize as it otherwise could. What if we were asking for $f(3)<f(4)<f(5)<\dots<f(100)$ and our codomain were $\{1,2,3,4,\dots,1000\}$. Your method would not have been feasible, but the method I am trying to lead you to above is still straightforward and easy to calculate.