CS FundamentalsVery hardGATE CS (PYQ pattern)

Three philosophers sit at a table with three forks; philosopher i always picks up fork i (left) first and then fork (i+1) mod 3 (right), eats, and puts both down. Model each philosopher as thinking, holding only the left fork, or eating (holding both). How many global states are reachable from the all-thinking state, and how many of them are deadlocks (no philosopher can move)?

  1. A. 14 states, 2 deadlocks
  2. B. 17 states, 1 deadlock
  3. C. 14 states, 1 deadlock
  4. D. 11 states, 0 deadlocks

Correct answer: C. 14 states, 1 deadlock

Breadth-first exploration of the transition system gives 14 reachable states; the only stuck state is the one where every philosopher holds exactly the left fork.

More Operating Systems questions

Exams that ask this topic