How many ways are there of rearranging the letters MATH such that each letter is replaced by a different one? How many ways are there of rearranging the letters MATH such that each letter is replaced by a different one?
In other words, no letters can be in the same place. So it starts as MATH. It could be THAM or AMHT. But it could not be MAHT because M and A are still in their initial positions.
I know that for any combination we would get 4!, but I'm not sure where to go from there.
 A: As you said, there are $4!$ ways of arranging the letters M, A, T, H.  Now, $3!$ of these begin with M.  Also, $3!$ of them have A in the second slot.  But, we have that $2!$ of them have both M in the first slot and A in the second.  So, a total of $3!+3!-2!$ have M in the first slot or A in the second slot, by the Inclusion-Exclusion Principle.  Now do the same with T and H.
A: The following is already not a good idea for even a $6$-letter word, but it will work nicely for MATH. The first letter can be any of A, T, H. We count the number of possibilities with first letter A, and multiply the answer by $3$.
So the first letter is A. Maybe the second letter is M. Then the last two have to be H and T, $1$ possibility.
If the second letter is not M, it is one of T or H. By symmetry we can assume it is T, and multiply the answer by $2$. So the first two letters are A and T. Then the third letter has to be H, and the fourth M, $1$ possibility. Now multiply by $2$, we get $2$.
Thus there are $1+2=3$ arrangements where the first letter is A. Multiply by $3$. We get $9$. 
Remark: There is a very nice theory of derangements, which will let us deal smoothly with HISTORY, or COMPUTING.
