Hamming Distance, Bit message My professor told us to try and remember the equation used for an upcoming exam, however I'm struggling to fit the equation into the question:

http://i.stack.imgur.com/RoPYG.png
(need a high reputation to post image)

From the above information can anyone tell me how I'm supposed to slot in values in order to work out the following practise question:

Sixteen-bit messages are transmitted using a Hamming code. How many check bits are needed to ensure that receiver can detect and correct single-bit errors?

Answer given to us is "5 check bits for a total of 21 bits". 

Can anyone help me out with this please, as I expect it will come up on the exam, bu with another bit message size.
The professor is asking you to find the lowest r such that the equation is true. At $r=1$, $2^1&lt;17+1$,
$r=2$, $2^2=4&lt;17+2=19$...
$r=4$, $2^4=16&lt;17+4=21$
 and finally $r=5$, $2^5=32\geq17+5=22$.