A bit is a 0 or a 1 A bit string of length 6 is a sequence o
A bit is a 0 or a 1. A bit string of length 6 is a sequence of 6 digits, all of which are either 0 and 1.
(a) How many bit strings of length 6 are there?
(b) How many bit strings of length 6 or less are there?
(Count the empty string of length zero also.)
Solution
well, we have the choice of 0 or 1. So 2^7=128 for a. (2^6=64 if we assume it must start with a 1) For b, it could be 2^7+2^6+2^5+2^4+2^3+2^2+2^1=254 or 2^6+2^5+2^4+2^3+2^2+2^1+2^1=128 depending on if it needs to start with a 1 (besides the empty string