JavaScript is required

Có bao nhiêu chuỗi bít có độ dài nhỏ hơn hoặc bằng 6?

A.

64

B.

124

C.

126

D.

62

Trả lời:

Đáp án đúng: C


The number of bit strings of length $n$ is $2^n$. Therefore, the number of bit strings of length less than or equal to 6 is the sum of the number of bit strings of length 0, 1, 2, 3, 4, 5, and 6. The number of bit strings of length 0 is $2^0 = 1$. The number of bit strings of length 1 is $2^1 = 2$. The number of bit strings of length 2 is $2^2 = 4$. The number of bit strings of length 3 is $2^3 = 8$. The number of bit strings of length 4 is $2^4 = 16$. The number of bit strings of length 5 is $2^5 = 32$. The number of bit strings of length 6 is $2^6 = 64$. Thus, the total number of bit strings is $1 + 2 + 4 + 8 + 16 + 32 + 64 = 127$.

Câu hỏi liên quan