Montmorts Problem on random arrangements 
So given 
A = "neither student 1 nor student 2 gets put in their own desk"
X = indicator function for A
Y = the number of students do not get put back on their own desk
part 1
lets assume n = 10 so there were 10 students and 10 chairs
Sample space would be = {(Sn,Cn)} where n is ranged from 1 t0 10
i dont know how to find the range 
and i have problems with part 2 
 A: To show formally that $X$ and $Y$ are not independent, consider the event $(X=1)\cap (Y=0)$.  This event has probability  $0$, since if $Y=0$, then everybody gets put back at her/his own
But neither $\Pr(X=1)$ nor $\Pr(Y=0)$ is $0$.  Thus 
$$\Pr((X=1)\cap (Y=0))\ne \Pr(X=1)\Pr(Y=0).$$
As to the first question, there is some unexplained notation that I would not hazard a guess about. But on the assumption that $f_X$, as usual, represents the distribution function of $X$, we can proceed as follows. The random variable $X$ only takes on the values $1$ and $0$. We find $f_X(1)$, the probability that $X=1$. If $X=1$, then either (i) Student 1 got moved to 2's desk or (ii) to someone else's.
The probability that Student 1 got moved to 2's desk is $\frac{1}{n}$. If that happened, then for sure 2 will not end up at her own desk.
The probability Student 1 got "moved" to a desk other than her own or 2's is $\frac{n-2}{n}$, Given that happened, the probability that 2 doesn't get moved to her own desk is $\frac{n-2}{n-1}$. Thus
$$\Pr(X=1)=\frac{1}{n}+\frac{n-2}{n}\cdot \frac{n-2}{n-1}.$$
