Dean has three colors of the hibiscus: red, orange, and yellow. He wants to plant them in a straight hedge of shrubs (each of which is one color) so that the order appears somewhat random, but not truly random. More specifically, he wants the following to be true:
- No two adjacent shrubs have the same color.
- No ordering of three consecutive shrubs appears more than once in the hedge.
What is the greatest number of shrubs Dean’s hedge can contain?
I should have picked up on the otherwise extraneous information regarding Rivka Lipkovitz's interest in the base-7 Doomsday algorithm to divine that my Ore's theorem base upper bound was not exactly the sharpest bound in the shed. Well, you can't fool me again! I know that since I did indeed like the previous week's Fiddler involved Hamiltonian cycles, that somehow this one will too ....
So let's design Dean's hedge instructions as a directional graph. Let O denotes an orange hibiscus, R a red one, and Y a yellow one. Then a triplet v=(v1,v2,v3) with vi∈{O,R,Y} with v2≠v1 and v3≠v2 is one of the possible orderings of three consecutive shrubs that satisfies both of the conditions. Let V={ORO,ORY,OYO,OYR,ROR,ROY,RYO,RYR,YOR,YOY,YRO,YRY}
Sure enough, there is a Hamiltonian cycle on the graph G=(V,E) covering all 12 possible vertices, which gives a maximal Dean-approved hibiscus hedge length of 14 shurbs (count the first three shrubs of the initial vertex, then each subsequent vertex only adds one new shrub so 3+11=14). One possible instance of this Hamiltonian cylce is given by ORO→ROY→OYO→YOR→ORY→RYO→YOY→OYR→YRY→RYR→YRO→ROR→ORO,