Consider a machine whose job is to place 100 letters into 100 envelops.The machine is defective and makes mistakes.What is the probability that in a group of 100 letters no letter is put into the correct envelope?
I did like this.
Total ways of putting letters into envelops=$100!$
And there is only 1 way by which all letter go into correct envelope.
So, I thought my answer must be $\frac{100!-1}{100!}$
But the answer is given to be $\frac{D_{100}}{100!}$
Where $D_{100}$ represents derangement of 100 letters.
Why there is a disparity between my answer and given answer?
There are a great many possibilities between "all letters are in the right envelopes" and "no letters are in the right envelopes. For example, we could have five in the right places and the rest in the wrong places. You answered the wrong question there.
As for the derangement problem - I'm sure it's come up plenty of times on the site. See here:
Why is the Derangement Probability so Close to $\frac{1}{e}$?
for a good one, with multiple high quality answers.