One one function set S

32 Views Asked by At

Consider the set $A ={1,2,3,4,5, \cdots ,n} .$ Let $S$ be the set of all one one function f from $A$ to $A$, such that

$|f(1)-1|=|f(2)-2|=|f(3)-3|=.....=|f(n)-n|$

I need to find number of elements of $S$ if $n=4$.

My attempt: I could only realise that the sum of the terms (if I take each of them to be positive or negative K where K is an integer) then K necessarily has to be zero if n is odd that is each term has to be zero inside the modulus function. Nothing else can I make out. Any help appreciated .

If someone could generalise this , say, to any natural number , would be great. Say what happens if n=any natural number and at what value of n we will not get any function.

1

There are 1 best solutions below

1
On

Let $k=|f(1)-1|\leq 3$

  • If $k=0$ then $f=id$ so only 1 such function.
  • If $k=1$ then $f(1)=2$ and $f(4)=3$ so $f(2)=1$ and $f(3)=4$, so again only 1 function.
  • If $k=2$ then $f(1)=3$ and $f(4)=2$, so $f(2) = 4$ and $f(3)=1$, so again only 1 function.
  • If $k=3$ then $f(1)=4$ and $f(4)=1$, so $f(2) = /$ and $f(3)=/$, so no function.

So we have only 3 such functions.