COMBINATORICS: Let A = {a1,a2,...,am} and B = {b1,b2,...,bn}. how many functions from A to B satisfy a)f(a1) = b1 and f(a2) = b2? b)f(a1) = f(a2)? c)f(a1) does not equal f(a2)? d)f(a1) is an element of {b1,b2,b3}??
Let's start with just asking the question: How many functions from A to B, without restrictions, are there?
n^m?
Right. Now when we specify that \(f(a_1)=b_1\) and \(f(a_2)=b_2\), all we're really doing is removing two elements from A. So then we just have a function from\[A=\{a_3,a_4,...,a_m\}\]to\[B=\{b_1,...,b_n\}.\]How many functions are there now?
n^m - 2?
or if were just taking 2 elements out of A, then (n-2)^m
The first way was correct. It should be \(\displaystyle n^{m-2}\).
oh yes I mixed that up. thanks.
The second question is a bit trickier. So first, we need to choose what \(f(a_1)\) is. How many options are there for this?
m
Actually, there are \(n\) choices since \(f(a_1)\in\{b_1,...,b_n\}\), and this set has \(n\) elements. But now, we also know that \(f(a_2)=f(a_1)\), so that means that there is only one choice for \(f(a_2)\). Finally, we just have to finish making the function from \(\{a_3,...,a_m\}\) to \(\{b_1,...,b_n\}\). From the previous question, there are \(n^{m-2}\) ways to do this. So in total, we have \(n\) choices for \(f(a_1)\) and \(f(a_2)\), and \(n^{m-2}\) choices for the rest. So all we do is multiply them together to get \(n\cdot n^{m-2}=n^{m-1}\) total choices. Did this all make sense?
yes that did make sense. ok so then if f(a1) ≠ f(a2) then there are n ways to choose f(a1) and n-1 ways to choose f(a2) then there are still m-2 choices for the rest right?
\(n^{m-2}\) ways to choose the rest, but yes, that seems right.
so it would be n·(n-1)·n^m-2
Looks right.
great. starting to make sense now.
And the last problem is similar. How many options for \(f(a_1)\) are there?
3: {b1,b2, b3}
Perfect. And how many choices for the rest of \(A\)?
m-1
\(n^{m-1}\). So the total number of choices is \[3\cdot n^{m-1}\]
ohh right ok. that makes makes sense. beautiful. thanks so much
You're welcome.
Join our real-time social learning platform and learn together with your friends!