The number of bit strings of length 8 that will either start with 1 or end with 00 is?
(I) Number of 8 bit strings starting with 1 : 1 _ _ _ _ _ _ _ = 27 = 128
(II) Number of 8 bit strings ending with 00 : _ _ _ _ _ _ 00
It has 2 possibilities:
if the string starts with 0 then total strings = 25 = 32
and if the string starts with 1 then total strings = 32 but they are already covered in all the strings starting with 1
So, total number of strings = 128 + 32 = 160
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.