Related questions with answers
a) Find a recurrence relation for the number of ternary strings of length n that do not contain two consecutive 0s or two consecutive 1s. b) What are the initial conditions? c) How many ternary strings of length six do not contain two consecutive 0s or two consecutive 1s?
Solution
Verified(a) Let represent the number of ternary strings of length that do not contain a pair of consecutive 0's nor a pair of consecutive 1's.
If the ternary string starts with a , then the ternary string of length (ignore the first 2) can start with a 0, 1 or 2 and thus there are such strings starting with a 2 followed by strings of length .
For each between 0 and , there could be string of alternating 0's and 1's which is followed by a 2 and then followed by no pair of consecutive 0's nor 1's, while there are then such strings ( for 0 and for 1).
The ternary string contains no 2's and thus contains only alternating 0's and 1's. There are 2 such possible strings (one starting with 0 and one starting with 1).
Adding the number of sequences of all three cases, we then obtain:
Similarly, we also have for :
Subtract the previous two equations:
Add to each side of the previous equation:
Create an account to view solutions
Create an account to view solutions
Recommended textbook solutions

Discrete Mathematics and Its Applications
7th Edition•ISBN: 9780073383095 (9 more)Kenneth Rosen

Advanced Mathematics: Precalculus with Discrete Mathematics and Data Analysis
ISBN: 9780395551899Brown
Discrete Mathematics and Its Applications
8th Edition•ISBN: 9781259676512Kenneth RosenMore related questions
- chemistry
1/4
- chemistry
1/7