Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Holiday - Brain teasers
Message
De
27/12/1999 13:44:28
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00308199
Message ID:
00308850
Vues:
28
>There are 3 missionaries and 3 natives. They need to cross a river in a boat that only holds 2. The restraints are that the cannibals can't outnumber the Missionaries on either side because the missionaries feared that the natives would over-power and eat them.

(c=cannibal, m=missionary)
left - on boat - right
cccmmm -
ccmm - cm
ccmm - m - c
cmm - cm - c
cmm - m - cc
mm - cm - cc
mm - m - ccc
m - mm - ccc
m - cc - cmm
c - cm - cmm
c - m - ccmm
- cm - ccmm
- cccmmm

After using brute force on this, it reminds me of the Towers of Hanoi problem (Moving a stack of disks across 3 pegs where no larger disk can fit over a smaller disk)

I heard a simplified version:
A farmer has a dog, a chicken, and some grain. He must cross a stream by carrying each over his head one at a time. If left alone, the dog will eat the chicken and the chicken will eat the grain. How does he get all three across?

Answer: (d=dog,c=chicken,g=grain,f=farmer)
dcgf -
dg - cf -
dg - f - c
d - gf - c
d - cf - g
c - df - g
c - f - dg
- cf - dg
- - dcgf
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform