Combinatorics question involving permutations 6 people each leave one bag each in a cloakroom.
(i)how many ways can their bags be returned to them?
(ii)How many ways can their bags be returned to them so that none of then get their own bags back
(iii)How many ways can their bags be returned to them so that exactly one of them gets their own bag back?
I got (i) the answer is 6!, but I'm having trouble with the other two parts any help would be appreciated.
*changed 7 to 6
 A: $(i)$ Your answer is correct.
$(ii)$ This involves  a derangement: an arrangement with no object in its proper place.
Denoting a derangement of $n$ objects as $D_n$, applying inclusion-exclusion,
and without bothering to further simplify the formula,
$D_6 = 6! -$ at least one gets right bag + at least two get right bag - ....
$= 6! - \dbinom61\cdot5! + \dbinom62\cdot4! -\dbinom63\cdot3! + ...... + \dbinom66\cdot0!$ 
$(iii)$
This is what is called a partial derangement, here simply $\binom61\cdot D_5$
PS
A simple formula for $D_n$ is to compute $\dfrac{n!}{e}$ and round to nearest  integer.
A: The key here is PIE, or the principle of inclusion/exclusion. If we let A be the set of all possible ways to return bags, which, you correctly listed, has size 6!. Then let $p_1$ be the property that the first person gets their own bag, and define $p_i$ for i from 2 to 6 similarly. The actual proof of PIE is a little more involved, but the idea is that we include the cardinalities of whole set, which we call the ambient set, then exclude the cardinalities of sets containing at least one of those properties for each property, then include the pairwise intersections, and so on, in order to find the cardinality set with none of those properties. You can read about PIE here.
To do this, we find $\sum_{i=0}^{6} (6-i)!\binom{6}{i}(-1)^i = \sum_{i=0}^{6} (-1)^i 6!/i!$. i goes from 0 to 6 to go through how many of the given properties we have. $\ (6-i)!$ counts how many ways to order the rest of the bags after we assume that i of them have already been given to their rightful owner. $\binom{6}{i}$ counts how many ways we can pick i properties of our 6.
Now that I've given you this slice of PIE, can you figure out how to do the second problem?
