Alice and Bob are best friends living in houses separated by a field. However, they have a problem. Alice owns a cat and Bob owns a dog, and their pets do not get along. As a result they can never let both their pets loose in the field together.
They set up the following protocol to decide when to let their pets out:
Provided that Alice and Bob strictly follow the protocol, is it guaranteed that whenever either owner wants to let their pet out, they will eventually be able to do so?
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.
If Alice and Bob both have their flags raised, but neither has their pet out, then they will wait indefinitely. Alice does not let her pet out while Bob's flag is raised, and the same for Bob, and neither will lower their flag until after they've let out their pets.
Such a situation could occur if, for example, both Alice and Bob were to raise their flags at the same time.