Let an represent the number of bit sequences of length n with an evennumber of 0's
First case. The sequence starts with a 1, then the remaining sequence of length n-1 needs to contain an even number of 0's and there are an-1 such strings.
Second case. The sequence starts with a 0, then the remaining sequence of length n-1 needs to contain an odd number of 0's. There are 2n-1 possible bit strings of which an have an even number of 0's, thus 2n-1-an strings have an odd number of 0's.
an=an-1+2n-1-an-1=2n-1
Comments
Leave a comment