View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis
 
Posts: n/a
Default Critical thinking puzzle

I was wondering if the following puzzle can be put in a formula, with
perhaps IF statements or however one can decide to solve. ...


Hi. I find these are indeed fun puzzles to solve using Excel.
However, I doubt one would be able to do this on a worksheet.
To do a brute force method, there are ...

=POWER(FACT(5),5)
24,883,200,000
combinations to search.

The method I use is to use programming. I find the best method is to use a
Dictionary object, and add one groups (ie Colors, beverages, etc) and then
try to use clues to delete as many as you can. Then, and the next group.
Doing it this way, the max size of the array is usually around 4,000.

For example, with clue #1, you add the color permutations (120 of them), and
then use the clue to reduce the size back down to 6. (ie the last two houses
are green & yellow) Adding the next permutation to these 6 keeps the size
of the array small and manageable. Eventually, the array size is one..your
solution.
It's a fun program. Good luck. HTH. :)

--
Dana DeLouis
Win XP & Office 2003


"jazbath" wrote in
message ...

Hi Folks,
I was wondering if the following puzzle can be put in a formula, with
perhaps IF statements or however one can decide to solve. I was
thinking of a spread sheet where we can focus on 5 cells eg. A1 to A5
and assume each as a house and write formula or code:

Here it goes:

there are five mebn of five different nationalities, living in five
different houses, of five different colors, each with different pet,
cigarette and beverage. The pets are a dog, a camel, a giragge, an
elephant and a horse. The mena re a Scotsman, a Norwegian, a German an
Englishman and an Irishman. The men smoke Camels, Pall Malls, Kools,
Salems and Chesterfields. The colors of the houses fare red, brown,
yellow, blue and green. The beverages are tea, juice, offfee and
water.

1. The Yellow house is immediately to the right of the green house and
has only
one neighbor.
2. Milk is drunk in the middle house.
3. The man in the red house lives immediately to the left of theman
who smokes
Chesterfields.
4. The Norweigian doesn't drink milk.
5. Tea is drunk in the house next to where the Scotsmnan lives.
6. The Scotsman smokes Camels.
7. The Irishman lives immediately to the left of theman who smokes
Pall Malls.
8. The dog lives in the house next to the house where the Irishman
lives.
9. Ther German lives next to the blue house.
10 The Germandrinks coffee.
11. The Giraffe and the elephant lives in houses separated by the blue
house.
12. The man in the green house smokes Salems.
13. The Englishman lives to the right of the house where juice is
drunk.
14. The horse lives in the niddle house.
15. The camel lives next tot he house where Kools are smoked.
16. The Scotsman lives in the brown house.

Now, who drinks tea? Who owns the horse? Name all five things for all
five homes.


Good Luck
Jaz


--
jazbath
------------------------------------------------------------------------
jazbath's Profile:
http://www.excelforum.com/member.php...o&userid=29467
View this thread: http://www.excelforum.com/showthread...hreadid=491735