To make a cigar, one needs three ingredients: paper, matches, tobacco.
The dealer arbitrarily puts two ingredients on the table and the agents take them and combine with their own supplies to make a cigar and smoke it. The dealer again puts two arbitrary ingredients on the table when one of the agents has finished smoking.
Which of the two following ways should the agents desirably behave in?
(A)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
(B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Assuming the dealer always puts two different ingredients.
In case A, it's possible that after the dealer puts two ingredients, nobody is currently smoking and thus the dealer never puts additional ingredients. For example, if the ingredients are matches and paper, and Alice grabs the matches before Carol does, then the paper will only be grabbed by Bob. Thus nobody has a complete set of ingredients to smoke yet, so nobody smokes, so the dealer doesn't continue. When nobody does anything, waiting for others to do something, this is called a deadlock .
In case B, only one person will ever be able to take the ingredients on the table, so there is no deadlock. One person will take both ingredients; they will smoke; and they will finish and notify the dealer to put more ingredients.
Whether case B is more desirable or not depends on whether you are a smoker or not (I personally prefer case A so nobody smokes because I don't like smoking). But for the purpose of this problem, case B is more desirable.