Question

Find a recurrence relation for an, the number of sequences of length n formed by u's,...

Find a recurrence relation for an, the number of sequences of length n formed by u's, v's, and w's with the subsequence vv not allowed.

b) (5 pts) Repeat part a) but now with the requirement that there is no subsequence uwv.


edit: thats all i have for this question
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a)

According to Question:-

No two subsequence vv not allowed so,

A) ends with v or w or

B) ends with u

The Type (A) good sequences of length n are obtained by appending v or w to a good sequence of length n−1. So there are 2a(n−1) Type (A) good sequences of length n.

The Type (B) good sequences of length n ≥ 2 are obtained by appending u to a good sequence of length n−1 that doesn't end in u. Such a good sequence is obtained by appending v or w to a good sequence of length n−2, so there are 2a(n−2) of them.

It follows that for n≥2,

a(n)= 2a(n−1) + 2a(n−2)

As initial conditions we can use a(0) = 1 ,  a(1) = 3.

since the possibilities are {u},{v},{w}, and a(2) = 8. Then I can solve for a(3) by accounting for the total number of combinations, 3 pow(3),

then subtracting cases of adjacent u's, totaling to 9 cases,

which gives the result of 18.

(b)

According to Question:-

since the possibilities are {u},{v},{w}, and a(2) = 8. Then I can solve for a(3) by accounting for the total number of combinations, 3 pow(3),

Now , ther is only 3 cases ,

which gives the result of 24.

Add a comment
Know the answer?
Add Answer to:
Find a recurrence relation for an, the number of sequences of length n formed by u's,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT