Find a recurrence relation for the number of ternary strings of length n that after 1 there is no 0 nor 2.
Don't know how to approach these kinds of problems.
Find a recurrence relation for the number of ternary strings of length n that after 1 there is no 0 nor 2.
Don't know how to approach these kinds of problems.
HINT: Let $S_n$ be the set of such strings of length $n$. Notice that if $\sigma=s_1\ldots s_n\in S_n$, and there is a $k$ such that $s_k=1$, then $s_i=1$ for $k\le i\le n$. That is, if a string in $S_n$ has a $1$, every element after that $1$ must also be a $1$.
Every member of $S_n$ must be of the kind described in the last bullet point.