Colorblind test with cards An investigator wants to test people if they are colorblind. For this, he use 4 cards , all different color, 
and let the people put them in 4 different boxes with the same colors as the cards. 
For the investigator, somebody is colorblind if he can not place all cards in the associated colored boxes.
The assumption is that somebody who is not colorblind will not make a mistake.
The second assumption is that, he who is colorblind, will place the cards randomly in one of the boxes.
The subject must put exactly one card in each box.
Test:
Somebody ,who is colorblind, does the test. Call Y the total number of cards , the guy will place
correctly , by guessing, in the correct boxes. 
Question:
Derive the formula of the probability function of Y and then calculate the expected value of Y.
What I know (from my gut feeling):
4 correct : chance is 1/24
3 correct : chance is 0/24
What is the chance to have 0,1,2 correct ?
I need the formula...
 A: Putting the four cards into the four boxes amounts to a bijective map $\pi:\>[4]\to[4]$, i.e., to a permutation $\pi\in {\cal S}_4$. We have to compute th probability $p(k)$ that a random such $\pi$ has exactly $k$ fixed points for $0\leq k\leq 4$.
There are $6$ permutations consisting of  a $4$-cycle. These have no fixed points.
There are $8$  permutations consisting of a $3$ cycle and one fixed point.
There are three permutations consisting of two $2$-cycles. These have no fixed points.
There are are $6$ permutations consisting of a $2$-cycle and two fixed points.
There is the identity, having four fixed points.
It follows that
$$p(0)={9\over24},\quad p(1)={8\over24},\quad p(2)={6\over24},\quad p(3)=0,\quad p(4)={1\over24}\ .$$
The expected number of fixed points therefore is $$E(Y)=\sum_{k=0}^4 k\,p(k)=1\ .$$
A: As said in the comment by Alex for a formula you must have a look at the concept known as derangements.
A formula is:$$\mathbb{P}\left(Y=k\right)=\frac1{4!}\times\binom{4}{k}\times!\left(4-k\right)=\frac{!\left(4-k\right)}{k!\left(4-k\right)!}$$
where $!m$ stands for the number of derangements of set $\{1,\dots,m\}$.
Note that for a not too small $m$ we have $!m\simeq \frac{m!}{e}$.
With inclusion-exclusion we can find the formula:$$!m=m!\sum_{k=0}^m\frac{(-1)^k}{k!}$$
Things are more easy when it comes to calculating the expectation of $Y$.
If we give the colors numbers $1,2,3,4$ and let $Y_i$ take value $1$ if color $i$ is placed correctly and $0$ otherwise, then: $$Y=Y_1+Y_2+Y_3+Y_4$$ and with linearity of expectation and symmetry we find: $$\mathbb EY=4\mathbb EY_1=4\mathbb P(\text{color }1\text{ is placed correctly})=4\times\frac14=1$$
