Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



The number of bit strings of length 10 that contain either five consecutive 0’s or five consecutive 1’s is





Solution

We count bit strings of length 10 that contain at least one run of five identical bits.

Case 1: Exactly one block of five consecutive 0’s.
The block $00000$ can start at positions 1 to 6, so 6 choices.
The remaining 5 positions can be filled freely with 0 or 1, except they should not create another block of five 0’s.
Valid fillings = $2^5 - 1 = 31$.
So number of strings with exactly one block of five 0’s is
$6 \times 31 = 186$

Case 2: Exactly one block of five consecutive 1’s.
By symmetry, the count is the same.
$186$

Case 3: One block of five 0’s and one block of five 1’s.
This is possible only when the blocks do not overlap.
The only such strings are
$0000011111$ and $1111100000$

So total such strings = $2$.
Using inclusion–exclusion principle:
$186 + 186 + 2 = 222$
Final Answer: $222$


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...