Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So my professor gave us an HW assignment which includes this question:

"How many bit strings consist of 1 through 5 bits. (Note 10 and 00010 are considered distinct even though they are both representations for 2)"

My answer is 62. Is this correct? Thanks

share|cite|improve this question

There are $2^1 = 2$ bit strings consisting of exactly $1$ bit.

There are $2^2 = 4$ bit strings consisting of exactly $2$ bits.

There are $2^3 = 8$ bit strings consisting of exactly $3$ bits.

So, following this pattern, you have $2+4+8+16+32 = 62$ bit strings.

Looks like your answer is correct, assuming you've interpreted the question correctly!

share|cite|improve this answer
Or you could just say it's 111110 in binary ($= 1\cdot2^5 + 1\cdot2^4 + 1\cdot2^3 + 1\cdot2^2 + 1\cdot2^1 + 0\cdot2^0$). ;)) – r.e.s. Dec 8 '11 at 3:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.