The Cowboy Problem: How not to get shot — Part 2

The Problem

  • Four men are buried up to their necks in the ground, as illustrated.
  • They cannot move, so they can only look forward.
  • Between A and B is a brick wall which prevents either side from seeing the other.

The Question

  • Which one calls out the color of their hat?
  • Why is he 100% certain of the color of his hat?

The Solution


  • We have 4 cowboys (yeehaw!), each wearing 1 hat, either white or black.
  • They are buried in 4 spots, unable to move, or rotate their heads, constraining their field of view forward.
  • The wall prevents A from seeing B, C, D, and vice-versa.


  • A and B can only see the wall. They cannot turn their heads to look behind them.
  • Immobile and buried in a straight line, C sees B, and D sees C and B; no one sees A.
  • No one knows their own hat color.
  • Each cowboy knows the others’ position.


  • The 4 companions get 1 shot to get this right, if not, they all get shot.
  • None of them will call out early, unless they are 100% certain of their hat color, because they all value their lives. Granted, they might do a 9th minute “Hail Mary” [see cultural football reference] guess, but luckily, one of their companions yelled out the right answer in under a minute. So, we know he wasn’t “guessing”.
  • We also know that A and B don’t matter, because they are equally ignorant of one another, as well as everyone else, due to their positions.
  • Looking at the options, comprehensively, we see that only a select few of them fit with our observations.
  • 4 slots [1,2,3,4]
  • 2 options each {B, W}
  • only 2 of each (2Bs, 2Ws)


  • We know that D has the most data, but surprisingly, he doesn’t call out for a good minute, despite being able to see both B and C.
  • C notices that D doesn’t call out, despite D having more direct observable data.
  • C quickly reasons that D doesn’t know, despite his vantage point. (A key point, C will now exploit!)
  • So, we can now intuit that C has more (indirect) information than D as we pass the 1-minute mark, given D’s response (or lack of).
  • C can exploit the fact that, among the 2 remaining scenarios D is contemplating, both scenarios constrain C’s hat color (Black).



Developer and Designer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Brainstorming Example

A gentle introduction to Time Series

Avalanche Data

Grid / Batch / Secure / Cloud / Fun / Powerful Computing with Civis Platform

Bidding Optimisation in Ad Auctions

Which one of these is for me and how much did they pay for it?

PokeScrape: A Guide to a Basic Pokemon Scrape

Filters in Tableau — What do various filters in Tableau mean?

Scale and Govern AI Initiatives with ModelOps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhikhya Ashi

Abhikhya Ashi

Developer and Designer

More from Medium

Year note: 2021

Datacamp Course Review

My Journey From the Skies to Data

Study Smarter, Not Harder for the BOC Exam