Medium
logic-puzzleriver-crossingclassic-puzzle

River Crossing Puzzle: Farmer, Fox, Chicken, and Grain

Problem Statement

A farmer needs to transport a fox, a chicken, and a bag of grain across a river. Constraints: - The boat can only carry the farmer and one item at a time - If left alone together, the fox will eat the chicken - If left alone together, the chicken will eat the grain - The farmer can be present with any combination How can the farmer get everything across the river safely?

Answer

Take chicken across, return alone, take fox across, bring chicken back, take grain across, return alone, take chicken across.

Step-by-Step Explanation

  1. 1

    Step 1: Take the chicken across the river first. Leave the chicken on the far side. (Fox and grain are safe together)

  2. 2

    Step 2: Return to the original side alone.

  3. 3

    Step 3: Take the fox across the river. (The grain is safe alone)

  4. 4

    Step 4: Leave the fox on the far side, but bring the chicken back with you. (Can't leave fox and chicken together)

  5. 5

    Step 5: Leave the chicken on the original side, take the grain across. (Chicken is safe alone)

  6. 6

    Step 6: Leave the grain with the fox on the far side. (Fox won't eat grain)

  7. 7

    Step 7: Return alone to get the chicken.

  8. 8

    Step 8: Take the chicken across one final time.

  9. 9

    The key insight is that you must bring the chicken back on one trip to avoid leaving it with either the fox or the grain.