@spaceblastxy1428 Yes, great! That is also another way to solve this problem. Excellent!
It is clever to think of tiling a 1×7 strip with B,R,WR, and WB because here we don't have a single white tile; the whites are always stuck next to a non-white, so we are guaranteed to not have two whites side-by-side.
We can make a strip of length n by adding a B or R to the end of a strip of length n−1. We don't have to worry about what the last colored bead is, since we aren't adding a white bead.
…n−4th,n−3rd,n−2nd,n−1st,B
…n−4th,n−3rd,n−2nd,n−1st,R
2 ways starting from length n−1
We could also make a strip of length n by adding a WR or WB to the end of a strip of length n−2. This strip is n−2 in length instead of n−1 in length because the tile we are adding is 2 units long.
…n−5th,n−4th,n−3rd,n−2nd,WR
…n−5th,n−4th,n−3rd,n−2nd,WB
2 ways starting from length n−2
This is expressed by the recursive formula
fn=2fn−1+2fn−2
or fn=2(fn−1+fn−2)
where fn= ways to make a sequence of n beads, fn−1= ways to make a sequence of n−1 beads, and fn−2= ways to make a sequence of n−2 beads.
Now we just need to find the number of strips for the small cases, since the recursive formula doesn't work for very small n.
-
For n=1, a 1×1 strip:
There are 2 ways: R or B.
-
For n=2, a 1×2 strip:
There are 6 ways:
R,R
R,B
B,R
B,B
WR
WB
Now we have enough values to start our recursion.
f3f4f5f6f7=2(f2+f1)=2(2+6)=16=2(f3+f2)=2(16+6)=44=2(f4+f3)=2(44+16)=120=2(f5+f4)=2(120+44)=328=2(f6+f5)=2(328+120)=2×448
Thus 2×448 is the number of 1×7 strips, but we want the number of 1×6 strips, so what should we do now? There are some copies that we should throw away. These copies have the same first 6 beads as another way, with only the last bead being different.
…S,A,M,E, beads,W
…S,A,M,E, beads,B
Removing the last bead of each string would give us the same 1×6 beads. There is no restriction on W or B, so there are equal numbers of strings ending in W, and equal numbers of strings ending in B. Thus we want half of the number of 1×7 strips, and the answer is
22×448=448 ways to color 6 beads black, white or red if two whites cannot be next to each other.