How many bit sequences of length seven contain an even number of 0s?
I’m trying to solve this using recurrence relation
Is my approach correct?
Let T(n) be the string having even number of 0s
T(1)=1 {1}
T(2)=2 {00, 11}
T(3)=4 {001, 010, 100, 111}
Case 1-we add 1 to strings of length n-1 having even number of 0s
T(n)=T(n-1)
Case 2-we add 0 to strings of length n-1 having odd number of 0s
T(n)=T(n-1)
Hence, we have T(n)=2T(n-1)