Answer to Question #260147 in Discrete Mathematics for Anonymous

Question #260147

Determine an, the number of words of length n on the alphabet {a, b, c} which


do not contain the substring ab. For instance, a3 = 21 since there are 21 such words


with 3 letters, namely:



aaa aac aca acb acc baa bac


bba bbb bbc bca bcb bcc caa


cac cba cbb cbc cca ccb ccc.


1
Expert's answer
2021-11-03T11:44:20-0400

Solution.

There are "3^n" different words of length "n" over this alphabet {a,b,c}.

1){b.......} or {c........}

If a string begins with b or c, then we are left with a string of length n−1, which can start with any character. There are an-1 strings of this type.

We have "2\u2022a_{n-1}" strings of this kind.

2) {aa.......} or {ac......}

If a string begins with a, and the second letter must be a or c, then you are left with a string of length n−2, which can start with any character. There are an-2 strings of this type.

We have "2\u2022a_{n-2}"

strings of this kind.

3) {aab.....}

Subtract the number of lines of this type.

We have "a_{n-3}" strings of this kind.

4) So, we have answer


"a_n=2\u2022a_{n-1}+2\u2022a_{n-2}-a_{n-3}"

"a_1=3, a_2=8, a_3=21."

For a example, "a_4=2\u202221+2\u20228-3=55."




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS