A large number of people, $N$, go to a convention at a hotel. Each person is assigned one of the $N$ hotel rooms. Before going to the convention, everyone gives their room key to the doorman. On the way out, the doorman hands the keys back at random. What is the probability that at least one person is given his/her original key?
The general equation I have worked out should be,
$$P(X \geq 1) = 1 - P(X=0)$$
$$P(X=0) = (1-(1/N))^N$$
Adding up all the probabilities that one person gets the right key. I have checked with the answer key and this is a solution. However, it does not work for the case where $N = 2$.
The probability that at least one person gets the right key should be $50% $ ,but this equation returns $75%$ . Can anyone explain what logical error I am making?
The error in your method lies in the fact that you treat "$A$ getting the wrong key " and "$B$ getting the wrong key" as independent events. They aren't. For instance, if you only have two people then knowing that the first one gets the wrong key makes it certain that the second also gets the wrong key.
To solve the problem, use Derangements. The keys people are given can be thought of as a permutation of the names, so your question becomes "what is the probability that a (uniformly) randomly chosen permutation is a derangement?" for which the answer is clearly $$\frac {!n}{n!}$$
Note that for large $n$ this approaches $\frac 1e$ so, again for large $n$, the numerical probability is about $36.79\%$