Ask your own question, for FREE!
Mathematics 19 Online
OpenStudy (anonymous):

How many bits are needed to express the integer n?

OpenStudy (anonymous):

Start with a simple table.

OpenStudy (anonymous):

Seems like we get a pattern \[ \lfloor\log_2(n+1)\rfloor \]

OpenStudy (p0sitr0n):

count in base 2. since each bit represents the exponent of a power of 2

OpenStudy (anonymous):

\[ \begin{array}{c|c|c} n_{10}& n_2 & \#\text{ of bits}\\ 0 &0&1\\ 1&1&1\\ 2&10&2\\ 3&11&2\\ 4&100&3\\ 5&101&3\\ 6&110&3\\ 7&111&3\\ 8&1000&4 \end{array} \]

OpenStudy (anonymous):

wio wouldn't you just add 1 after taking the floor instead including + 1 in the floor function?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!