Let $A=\left\{1,2,3,4,5,6,7\right\}$ and $f:A \to A$.What is the number of onto functions in which atleast $3$ elements of $A$ have self-images?
I could not solve this problem,I have no concrete idea how to solve it. Please help me.Thanks.
Let $A=\left\{1,2,3,4,5,6,7\right\}$ and $f:A \to A$.What is the number of onto functions in which atleast $3$ elements of $A$ have self-images?
I could not solve this problem,I have no concrete idea how to solve it. Please help me.Thanks.
Such an $f$ is automatically bijective, i.e., a permutation.
If $f$ has exactly three fixed points its cycle structure can be one of the following: $(1)(2)(3)(4567)$ or $(1)(2)(3)(45)(67)$. There are ${7\choose 3}$ ways to choose the three fixed points, $6$ ways to make a four-cycle of the remaining four points and three ways to pair them off to two transpositions, making a total of $35\cdot(6+3)=315$ such $f$'s.
If $f$ has exactly four fixed points its cycle structure has to be of the form $(1)(2)(3)(4)(567)$. There are ${7\choose 3}=35$ ways to choose the elements taking part in the three-cycle, and two ways to order this cycle, making a total of $70$ such $f$'s.
If $f$ has exactly five fixed points its cycle structure has to be of the form $(1)(2)(3)(4)(5)(67)$. There are ${7\choose2}=21$ such $f$'s.
There is no such $f$ with exactly six fixed points; and the identity leaves all seven points fixed.
My count gives $407$ functions fulfilling the conditions.
The first insight, here, is that since $A$ is finite, every surjection (onto function) $f : A \to A$ is a bijection (one-to-one correspondence). You can find a proof here, but it makes sense when you think about it: if you have only a bow and 7 arrows, and you must hit each of 7 targets at least once, you'll be out of arrows before you can ever hit a target twice – so all you can do is hit each target exactly once.
A bijection represents some way to permute the elements of $A$. Here is one $f$ that satisfies your condition:
$$f(1) = 4 \\f(2) = 2 \\f(3) = 1 \\f(4) = 3 \\f(5) = 5 \\f(6) = 6 \\f(7) = 7$$
It has four fixed points: $f(2)=2$, $f(5)=5$, $f(6)=6$, and $f(7)=7$.
There are $7! = 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot 7 = 5040$ permutations of $A$, or choices for a bijection $f$.
We wish to count how many of those 5040 bijections satisfy the property that there are at least 3 fixed points. To do this, we split the count up into parts: we count the bijections with $n$ points, for $n \in \{3,4,5,6,7\}$, and sum up the results.
How can we "construct" a bijection with exactly 3 fixed points?
First of all, we could choose which elements to fix. We are picking 3 elements out of a set of 7, and the order doesn't matter: the [binomial coefficients] tell us there are $\binom{7}{3}$ options here.
The remaining 4 elements may not get mapped to themselves. Call them $p, q, r, s$.
In total: $$\underbrace{\binom{7}{3}}_{\text{choices for fixed points}} \text{times} \underbrace{3}_{\text{choices for $f(p)$}} \text{times} \underbrace{(1 + 2)}_{\text{choices for remaining points}} = 315.$$
This time, how can we "construct" a bijection with exactly 4 fixed points?
Again, we have $\binom{7}{4}$ choices for the 4 fixed points.
Then, we call the remaining elements $p, q, r$. Again, they have to point to each other in some way; we can't have $f(p) = p$, $f(q) = q$, or $f(r) = r$.
Surprisingly, we have only two options: the clockwise cycle $p \mapsto q \mapsto r \mapsto p$ and the counter-clockwise cycle $p \mapsto r \mapsto q \mapsto p$. We can't make any "pairs" among $\{p,q,r\}$, or else the third element would be forced to point to itself.
In total: $$\underbrace{\binom{7}{4}}_{\text{choices for fixed points}} \text{times} \underbrace{2}_{\text{choices for cycle direction}} = 70.$$
There are $\binom{7}{5} = 21$ ways to pick the 5 fixed points, and then you're forced to pair the last two points up to point at each other.
In total: $$\underbrace{\binom{7}{5}}_{\text{choices for fixed points}} = 21.$$
There are none! If six of the elements are mapped to themselves, then the final one can't not map to itself; there's nowhere else to map to.
There is, of course, exactly one such function: $f(1) = 1, f(2) = 2 \dots f(7) = 7.$
Summing up all our previous results gives us the answer – the number bijections with at least 3 fixed points:
$$315 + 70 + 21 + 0 + 1 = 407.$$
We can take the number of all permutations of $\{1,\cdots,7\}$
and subtract the number of permutations with less than 3 elements with self-images.
If we let $D_n$ be the number of permutations of $\{1,\cdots,n\}$ with no fixed points
$\hspace{.4 in}$(the number of derangements of n elements), this gives
$\;\;\;7!-D_7-\dbinom{7}{1}D_6-\dbinom{7}{2}D_5=5040-1854-7(265)-21(44)=\color{red}{407}$
$\hspace{.3 in}$since there are $D_7$ permutations which leave no element fixed,
$\hspace{.3 in}\binom{7}{1}D_6$ permutations which leave exactly one element fixed, and
$\hspace{.3 in}\binom{7}{2}D_5$ permutations which leave exactly two elements fixed.
Alternatively, we could use
$\displaystyle\binom{7}{3}D_4+\binom{7}{4}D_3+\binom{7}{5}D_2+\binom{7}{6}D_1+\binom{7}{7}=35(9)+35(2)+21(1)+7(0)+1=\color{red}{407}$