Finding the leading exponent of a binary number Let's say that the binary representation of a number k is 2^(X_n)+2^(X_(n−1))+...+2^(X_0) with each term in this polynomial having a 1 or 0 multiplied to it (I just haven't showed them here). Now, given only k, and no other information, is there a way that I can find the number X_n(which is the highest degree of the binary representation of k)?

Emmy Swanson

Emmy Swanson

Answered question

2022-10-23

Finding the leading exponent of a binary number
Let's say that the binary representation of a number k is 2 X n + 2 X n 1 + + 2 X 0 with each term in this polynomial having a 1 or 0 multiplied to it.
Now, given only k, and no other information, is there a way that I can find the number X n (which is the highest degree of the binary representation of k)?

Answer & Explanation

Reese Hobbs

Reese Hobbs

Beginner2022-10-24Added 13 answers

Suppose the highest power of 2 that appears is 2 n . Then the smallest k could be is 2 n , which would happen if all the lower binary digits of k were 0. On the other hand, the largest k could be is if all the other digits were 1, which is the value 2 n + 1 1 (that's because if you add 1 2 to 1111 1 2 , you get 1000 0 2 ). Thus
2 n k < 2 n + 1
Taking logs with base 2, this gives
n log 2 k < n + 1
Since n is integral, this means
n = log 2 k
This says that k has 1 + log 2 k necessary digits in its binary expansion (assuming k 0 is integral).

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?