[Math] Proof of formula of the number of strings of length n for the alphabet ${a,b,c,d}$

combinatoricsinduction

Suppose I want to prove that the amount of strings of length $n$ for the alphabet ${a,b,c,d}$, where every string has an even amount of $a$ satisfies the formula $f(n+1)= 2 f(n) + 4^n$. I wish to do this via induction, for the base cases we know that $f(0)=1$ since the empty string contain an even amount of strings. Also we know that for $f(1)=3$. Since the set would be $\{b,c,d\}$. we thus have our base case: $f(1)=2+1=3 $. Check. I know wish to do the inductive step, so given it holds for $k$, I want to prove it holds for $k+1$, I probably need to find a way to use the fact that we have an even amount of $a$. Every other letter we can just add randomly to every single word on $k+1$ positions, not quite sure how to use this yet….

Best Answer

HINT

There are $4^n$ different strings of length $n$ using $a$, $b$, $c$, or $d$.

So, if there are $f(n)$ strings of length $n$ with have an even number of $a$'s, then that means that there are $4^n-f(n)$ strings of length $n$ with an odd number of $a$'s.

I don't want to give it completely away, but this is a big hint ... I think with this you'll be able to complete the inductive step no problem ...