Hey all,
I've been working on my homework for the past few hours, and I got stuck on one of the questions:
A) Find a recurrence relation for the number of n-digit binary sequences with no pair of consecutive 1s.
B) Repeat for n-digit ternary sequences.
C) Repeat for n-digit ternary sequences with no consecutive 1s or consecutive 2s.
For part A, I figured the recurrence relation is a[sub:2u0r5agx]n[/sub:2u0r5agx] = a[sub:2u0r5agx]n-1[/sub:2u0r5agx] + (a[sub:2u0r5agx]n-1[/sub:2u0r5agx] - a[sub:2u0r5agx]n-2[/sub:2u0r5agx]), but I can't be sure that for part B, the relation for a ternary sequence is a[sub:2u0r5agx]n[/sub:2u0r5agx] = a[sub:2u0r5agx]n-1[/sub:2u0r5agx] + (a[sub:2u0r5agx]n-1[/sub:2u0r5agx] - a[sub:2u0r5agx]n-2[/sub:2u0r5agx]) + a[sub:2u0r5agx]n-1[/sub:2u0r5agx]. Is my logic correct? I have no idea how to approach part C, so a bit of guidance there would be great.
Thanks.
I've been working on my homework for the past few hours, and I got stuck on one of the questions:
A) Find a recurrence relation for the number of n-digit binary sequences with no pair of consecutive 1s.
B) Repeat for n-digit ternary sequences.
C) Repeat for n-digit ternary sequences with no consecutive 1s or consecutive 2s.
For part A, I figured the recurrence relation is a[sub:2u0r5agx]n[/sub:2u0r5agx] = a[sub:2u0r5agx]n-1[/sub:2u0r5agx] + (a[sub:2u0r5agx]n-1[/sub:2u0r5agx] - a[sub:2u0r5agx]n-2[/sub:2u0r5agx]), but I can't be sure that for part B, the relation for a ternary sequence is a[sub:2u0r5agx]n[/sub:2u0r5agx] = a[sub:2u0r5agx]n-1[/sub:2u0r5agx] + (a[sub:2u0r5agx]n-1[/sub:2u0r5agx] - a[sub:2u0r5agx]n-2[/sub:2u0r5agx]) + a[sub:2u0r5agx]n-1[/sub:2u0r5agx]. Is my logic correct? I have no idea how to approach part C, so a bit of guidance there would be great.
Thanks.