Q&A

# Why is -1 needed to get 65,535 from a 2^16 binary power calculation?

+0
−6

It was stated in the Wikipedia article 65,535:

65535 occurs frequently in the field of computing because it is 2^16-1 (one less than 2 to the 16th power), which is the highest number that can be represented by an unsigned 16-bit binary number.

I didn't understand from this passage why is the -1 needed to get the number 65,535 from the power operation.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

+2
−0

The short answer: because 216 = 65536, it follows that 216 - 1 = 65535.

Remember how exponentials work: in is i multiplied by itself n times (for integer values of n ≥ 1).

Therefore, 216 = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2. (2 multiplied by itself 16 times.) Since the only distinct multiplicant is an even number, it follows that the result must also be an even number.

216 is the number of distinct values that can be represented with exactly 16 symbols each taking one of two values (in this case, traditionally 0 and 1). The more general form is mn where m is the size of the symbol set, and n is the number of symbols being used. The latter is why, for example, 216 = 164 (you can use 16 binary digits, or 4 hexadecimal digits, to represent the same value range).

When you include being able to represent the number 0, which is often useful and the lack of which would require some kind of special handling, the maximum number possible to represent within 216 distinct values is 216 - 1; you need to subtract 1 because the value 0 is one ("1") possible value.

Why does this post require moderator attention?
You might want to add some details to your flag.