A Chat with GPT-4: The River Riddle

Can GPT-4 answer the timeless question: How can you safely transport a lion, cabbage, and goat across a river using a boat that can only carry one item at a time?

A Chat with GPT-4: The River Riddle

An interesting example of GPT getting caught in the fallacy (suspension of disbelief?) of the goat not eating a cabbage. Note that in this example the lion threatens to eat both the goat and the cabbage.

https://bram-adams.ghost.io/content/images/2023/03/gpt4-riddle-lion-cabbage-goat-river.png
gpt4 riddle lion cabbage goat river.png

(hn comment)

The Incorrect Answer

Note even with bolding of the salient details, and a system command to pay attention to wordplay tricks, the goat and cabbage association "override" the system.

---
system_commands: ['I am a puzzle solver that pays attention to wordplay and detail and doesn't fall for grammatical traps.']
temperature: 0.0
top_p: 1
max_tokens: 512
presence_penalty: 1
frequency_penalty: 1
stream: true
stop: null
n: 1
model: gpt-4
---

Suppose I have a cabbage, a goat and a lion, and I need to get them across a river. I have a boat that can only carry myself and a single other item. I am not allowed to leave the cabbage and lion alone together, and I am not allowed to leave the lion and goat alone together. How can I safely get all three across?


role::assistant

  1. First, take the goat across the river, leaving the cabbage and lion on the original side.
  2. Return to the original side alone and take the cabbage across the river, leaving the lion behind.
  3. Take the goat back to the original side, leaving the cabbage on the other side.
  4. Take the lion across the river, leaving the goat behind.
  5. Finally, return to the original side alone and take the goat across the river to join the others.

This way, all three items are safely transported across the river without violating any of the constraints.

The Correct Answer

When lion, cabbage, goat are turned into variable letters, the puzzle is easily solved.

---
system_commands: ['I am a generalist that is not afraid to make radical associations between distinct topics by using creative leaps. I write in short, quippy sentences that has a conversational tone.']
temperature: 0.0
top_p: 1
max_tokens: 512
presence_penalty: 1
frequency_penalty: 1
stream: true
stop: null
n: 1
model: gpt-4
---

Suppose I have a C, a G and a L, and I need to get them across a river. I have a boat that can only carry myself and a single other item. I am not allowed to leave the C and L alone together, and I am not allowed to leave the L and G alone together. How can I safely get all three across?


role::assistant

Ah, the classic river riddle! Here's how you'll crack it:

  1. Take L across first (C and G chillin' together).
  2. Head back solo (L safe on other side).
  3. Grab C for a boat ride (G stays put).
  4. Drop off C, but take L back with you (don't worry, it's temporary).
  5. Leave L, grab G for a trip across the river.
  6. Reunite G with C (both happy on the other side)!
  7. Finally, sail back to fetch L.

Boom! All three safely across! 🚣‍♀️


bramadams.dev is a reader-supported published Zettelkasten. Both free and paid subscriptions are available. If you want to support my work, the best way is by taking out a paid subscription.