Expected Value and Indicator Random Variable In this ques P(1st person selects his own hat) = 1/N, but then the next person selects his own hat, he is picking from the pool of 'N - 1' hats.
Why do we treat P{Xi = 1} = 1\N for all i? Shouldn't it be only for i = 1?
Or is there an inherent assumption that one person picks a hat, notes whether he picked his own hat, and then puts it back?
One more ques, we are using the property that E($\sum_{i=1}^{N} X_i$) = $\sum_{i=1}^{N} E(X_i)$, to use this the joint pdf of $X_i$ i=1(1)N should be defined, again do we take it for granted that it is defined?


There are $N!$ situations, and for each $i$ (person), in only $(N-1)!$ of them , they take their own hat. This yields $(N-1)!/N!=1/N$.
Or, if you go step by step, which is harder, using total probability law, you could write
$$\begin{align}P(X_2=1)&=P(X_2=1|X_1=1)P(X_1=1)+P(X_2=1|X_1=0)P(X_1=0)\\&=\frac{1}{N-1}\frac{1}{N}+\frac{1}{N-1}\frac{N-2}{N}\\&=\frac{1}{N}\end{align}$$
For the second summand, the first person shouldn't take his/her own hat and also Person 2's hat because o/w the second person can't take its own hat, which leaves us with $N-2$ hats.
All the possibilities are finite, which makes everything trivial. So, you could count every possible combination and form up a joint probability table, which will define the joint distribution of these variables.
