Problem: Find a recurrence relation for the number of ternary strings of length n that contain at least one 0.
Ternary string only contains 0s, 1s, and 2s.
Approach: Assuming that the length n is equal or bigger than 3 (n >= 3) then:
- When n = 1, there is 1 possibility to obtain a string with at least a zero
- When n = 2, there is 5 possibilities to obtain a string with at
least a zero - When n = 3, there is 19 possibilities to obtain a string with at least a zero (Not sure if correct)
And from here I am completely lost on how to start forming the recurrence. Any help/hints? I been having a terrible semester with this class :(.
Two ways of solving this: