Christmas Cookie Algorithm
Posted: November 29th, 2020, 11:21 pm
Christmas Cookies
I will try to make a brainteaser; I don't know if it will be challenging or not, but let's find out.
(Also based in truth!): I have a box of Christmas cookies and there are ten different types.
Two are plain
Two are filled with or topped with chocolate
One is filled with mint chocolate
One has chocolate and nuts on it
One has nuts in it
One has coconut in it
One has raspberry jam in it.
One has apricot jam in it.
Here are the rules:
If I eat one with chocolate, a non chocolate cookie must follow.
If I eat one with nuts, a cookie with jam must follow.
A coconut cookie cannot follow a chocolate or jam cookie.
A mint chocolate cookie cannot come before or after a cookie with nuts on it or in it.
A plain cookie cannot be eaten just before a chocolate cookie.
Two plain cookies cannot be eaten in a row.
If a raspberry jam cookie is eaten just after cookie x, an apricot cookie has to be eaten before cookie x.
How can I eat twenty cookies and still follow these rules, and without simply repeating a compliant 1-10 sequence?
PS: If you try to solve it, I will send you a virtual cookie.
If no one tries, that is fine because this made me laugh even thinking about it. : )
I will try to make a brainteaser; I don't know if it will be challenging or not, but let's find out.
(Also based in truth!): I have a box of Christmas cookies and there are ten different types.
Two are plain
Two are filled with or topped with chocolate
One is filled with mint chocolate
One has chocolate and nuts on it
One has nuts in it
One has coconut in it
One has raspberry jam in it.
One has apricot jam in it.
Here are the rules:
If I eat one with chocolate, a non chocolate cookie must follow.
If I eat one with nuts, a cookie with jam must follow.
A coconut cookie cannot follow a chocolate or jam cookie.
A mint chocolate cookie cannot come before or after a cookie with nuts on it or in it.
A plain cookie cannot be eaten just before a chocolate cookie.
Two plain cookies cannot be eaten in a row.
If a raspberry jam cookie is eaten just after cookie x, an apricot cookie has to be eaten before cookie x.
How can I eat twenty cookies and still follow these rules, and without simply repeating a compliant 1-10 sequence?
PS: If you try to solve it, I will send you a virtual cookie.
If no one tries, that is fine because this made me laugh even thinking about it. : )