Take the 2-minute tour ×
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.

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|improve this question
add comment

1 Answer 1

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|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
add comment

Your Answer

 
discard

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.