197k views
3 votes
How many 8-bit strings are there that have at least one zero? a) 256 b) 255 c) 128 d) 127

User Bummzack
by
8.5k points

1 Answer

5 votes

Explanation:

1 bit = 0 or 1.

8-bit string is a combination of 8 of such bits.

for each position we have 2 possibilities.

that means we have

2×2×2×2×2×2×2×2 = 2⁸ = 256

different possibilities.

how many have at least one 0 ?

only the combination of

11111111

has no 0s.

all others (= 256 - 1 = 255) must therefore have at least one 0.

so,

b) 255 is correct

FYI :

128 would be all possible combinations with 7 bits (2⁷).

127 would mean all combinations of 7 bits with at least one bit being 0.

256 is the total number of different combinations with 8 bits from 00000000 to 11111111.

User Oddmeter
by
8.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories