26.0k views
5 votes
A bit is a 0 or a 1. A bit string of length 8 is a sequence of 8 digits, all of which are either 0 and 1.

(a) How many bit strings of length 8 are there?

(b) How many bit strings of length 8 or less are there?

User JWD
by
5.5k points

1 Answer

0 votes

Answer:

a) N = 2^8 = 256

b)N = 2^8 + 2^7 +2^6 +2^5 +2^4 +2^3 +2^2 +2^1

Explanation:

Given;

String of length 8, with two options (0 or 1) each.

a) for the number of bits of strings of length 8.

Each digit of the 8 digit string has 2 options.

For 8 digit, we have

N = 2×2×2.... = 2^8 =256

b) for bit of strings of length 8 or less.

For n string = 2^n

For n < 8

The number of bit strings for length 8 or less are;

N = N8 +N7 + N6 + ... +N1

N = 2^8 + 2^7 +2^6 +2^5 +2^4 +2^3 +2^2 +2^1

User Bharatsing Parmar
by
5.2k points