Deadlock Cats and Dogs

There are two neighbors Adam and Brian. Adam owns a cat while Brian owns a dog. Sometimes, they need to walk their pets in the park. However, only one of them can do so at any point in time as their pets don’t get along.

They arrive at an agreement to decide who gets to go to the park. There is a wooden arrow pointing at either house that both of them can control. Anyone who wants to go to the park will do the following:

1. Set the wooden arrow pointing to the other house.
2. Raise a flag on their terrace.
3. Wait until the other flag is lowered or the arrow is pointing to his own house.
4. Go for a walk in the park.
5. Come back and lower the flag.

Does this procedure guarantee that Adam and Brian won't walk their pets in the park simultaneously?


Problem Loading...

Note Loading...

Set Loading...