0

My attempt

The problem can be reduced as distributing 5 elements among 4 elements. The only way to do this is by making groups of $2,1,1,1$

So number of ways are $$\frac{ 5! \times 4!}{2!\times 1! \times 1! \times 1! \times 3!}$$ $$=240$$ But the answer is $44$

This was just my attempt, which is wrong. What is the correct way to solve it?

Aditya
  • 6,191
  • 2
    As stated, I would think the answer should be just $4^5 = 1024$. I would think the 44 answer would be if you also require $f$ to be a permutation (look up "derangements"). – Daniel Schepler Feb 18 '21 at 17:48
  • Such a function is called a derangement: here is the Wikipedia page: https://en.wikipedia.org/wiki/Derangement – Crostul Feb 18 '21 at 17:48
  • "The problem can be reduced as distributing $5$ elements among $4$ elements" I do not believe you understand what the problem is asking for at all. "groups of 2,1,1,1" You seem to have been thinking of a problem where you are counting the number of surjective functions from $[5]$ to $[4]$ which will indeed have the number you state. You seem to have ignored the actual statement though... $f(i)\neq i$ for all $i$. This has the variable as both the input and as the output. You answered the question $f(i)\neq 5$ for all $i$ and unnecessarily added the requirement of surjectivity. – JMoravitz Feb 18 '21 at 17:52
  • An example of such functions would be $f(i)=\begin{cases}2&\text{if }i=1\1&\text{otherwise}\end{cases}$ since here we have $f(1)\neq 1$ and $f(2)\neq 2$ and $f(3)\neq 3$ etc... Another example would be $f(i)=\begin{cases}i+1&\text{if }i\leq 4\ 1&\text{if }i=5\end{cases}$ since here again we have $f(i)\neq i$ for all $i$. Note that the first is not a bijection from $A$ to $A$ but the second is. – JMoravitz Feb 18 '21 at 17:55
  • As for counting where the functions need not be bijections... this is a straightforward application of rule of product. Choose the output for $1$. You have $4$ choices. Choose the output for $2$. You have $4$ choices. Continue in this fashion, $4$ options for each of the $5$ outputs, giving a total of $4^5$. For the more challenging question of counting derangements, see the linked question. – JMoravitz Feb 18 '21 at 17:56
  • @JMoravitz that might be true, because I attempted this question in relation to another one which involved finding number of surjective functions. I knew it was wrong but I tired it nonetheless – Aditya Feb 18 '21 at 18:13
  • @JMoravitz The number of dearragements are indeed 44. But I am still confused as to why number of dearrangements gives the right answer. Is it as simple as the fact $f(i)\not = i$ when in an ideal case it should be? – Aditya Feb 18 '21 at 18:19
  • I don't understand the question in that last comment. "Why number of derangements gives the right answer [to the problem of counting bijective functions $A\to A$ such that $f(i)\neq i$ for all $i$]" .... Because that is the definition of derangements. "Is it as simple as the fact $f(i)\neq i$ when in an ideal case it should be?" Ordinarily we don't have such a restriction. It is not that it should be that $f(i)=i$... it is that it can be $f(i)=i$ for some $i$ and $f(i)\neq i$ for others... we don't care! – JMoravitz Feb 18 '21 at 18:21
  • Why should the answer be derangements to the problem as written in your post? It isn't and the answer of $44$ is incorrect to the problem of counting functions in general from $A$ to $A$ satisfying $f(i)\neq i$ for all $i$, as mentioned in the very first comment. The answer of $44$ is for that question with the added stipulation that the functions must also be bijective. The answer where we did not include that unwritten stipulation is as mentioned already $4^5=1024$ – JMoravitz Feb 18 '21 at 18:25
  • @JMoravitz let’s assume we need the functions to be bijective. I didn’t understand what you meant by ‘it is that it can be $f(i)=i$...we don’t care!’. Derangements will be give ensure that no elements goes to it stipulated place. My question is, how does the formula know that $f(i)=i$ is the correct place for $i$ to go? Sorry for my rudimentary mathematical language but I really don’t know this topic well – Aditya Feb 19 '21 at 02:06
  • For ease of notation... I will write a function as a string. So, $12345$ corresponds to the function $f(x)=\begin{cases}1&\text{if }x=1\2&\text{if }x=2\\vdots\end{cases}$, i.e. $f(x)=x$. Meanwhile $23451$ corresponds to the function $f(x)=\begin{cases}2&\text{if }x=1\3&\text{if }x=2\\vdots\end{cases}$. Among the derangements are things like $23451,~53124,~31254,\dots$ where no number is in its corresponding position. $1$ is never in the first position, $2$ is never in the second position, etc... and further each number is used exactly once... – JMoravitz Feb 19 '21 at 02:25
  • Functions like $21111$ also satisfy that no number is in its corresponding position, however functions like this happen to not satisfy the property that every number is used exactly once. Functions like $12543$ are not derangements because $1$ happened to be in the first position. That is a perfectly valid function... just not one that we wanted to count in this problem – JMoravitz Feb 19 '21 at 02:27
  • "How does the formula know that $f(i)=i$ is the correct place for $i$ to go?" Nowhere did we ever talk about the functions where $f(i)=i$ for all $i$. There is only one such function... the identity function $12345$. "When in an ideal case it should be" Nowhere did anyone ever say that it should be that $f(i)=i$ for all $i$ or even for some $i$... just that in normal counting problems we might not care whether $f(i)=i$ or not for certain $i$. They might be, they might all be, some might not be, all might not be, there can be a mix and unless specified we don't care – JMoravitz Feb 19 '21 at 02:30

0 Answers0