Determine function Let $f :\Bbb N \to\Bbb N$ be the function where $f(n)$ is the number of bits needed to express the positive integer $n$ (in decimal notation) in binary notation. Since $10$ (in decimal notation) is $1010_2$, then $f(10) = 4$.
(Take $\Bbb N$ to be the set of positive integers.)
a)Determine $f(31), f(32)$, and $f(33)$.
could u correct it if i'm right 
answer -    (31) = 00011111 = f(31)= 8
 (32)= 00100000= f(32)=8
 (33)= 00100001= f(33)= 8
 A: What you need to do is to solve for $f(x)$ is the following:  


*

*Convert the argument (the number, $x$) from decimal to binary.  

*Count the number of digits.  

*Return the number of digits in decimal form.  


How to convert to binary? An excellent primer is from Math Is Fun. Below is a link to the graphic on their website.

You can convert a number to binary through inspection using this graphic, and learn more about what you are doing by reading the webpage. 
If you want a quick and dirty conversion (without understanding what you are doing, however) see this table. Reviewing that table may help you understand the pattern.  
In the example given, look for the number $10$ in the left-hand column of the table. You will find in the right-hand column the binary number $1010$. It has $4$ digits. Therefore $f(10)=4$.  
Can you repeat this process for $f(31), f(32) \text{ and } f(33)$?
A: Um, the function is $[\log_2 n ]  $ where [x] the least integer greater than  to x.  
Since $2^n$ in binary is 1000....0 (with n zeros) it takes $n + 1 = (\log_2 2^n) +1$ bits to represent it. $2^{n+1}$ in binary is 100....0 with n + 1 zeros and n+2 bits. If m is such $2^n < m < 2^{n+1}$ it will require n+1 bits to represent it.  As  $2^n < m < 2^{n+1}$ then $n < \log_2 n < n + 1$ so the bits to represent m would be [\log_2 m] = n + 1.
As $32 = 2^5$ it will take one 1 and 5 zeros to represent it.  So $f(32) = 6 = \log 32 + 1 = [\log 32]$.  31 will therefore take 5 bits.  $f(31) = 5 > \log 31 > 4$.  so $f(31) = [\log 31]$.  And so on.
Um, how can you know what binary is and not know how to express numbers in binary.
27  in binary, crash course:  Find highest power of 2 less than or equal to 27.  That is $2^4 = 16$.  Subtract from 27 to get $27 = 16 + 11 = 2^4 + 11$. Do the same for 11 to get $11 = 8 + 3 = 2^3 + 3$ so $27 = 2^4 + 2^3 + 3$.  Keep going to get $27 = 16 + 8 + 2 +1 = 2^4 + 2^3 + 2^1 + 2^0$.  You mark each power of 2 with a 1 and you mark every missing power of 2 with a zero.  So $27 = 11011_2$. 
