Lecture 10: Knowledge and Common Knowledge in Distributed Systems

Muddy foreheads

Silly example to help us practice thinking through a scenario with multiple collaborating/communicating participants.

Setup

  • Suppose there are \(n\) children and one teacher
  • The children have just come inside from playing, and \(k\ge 1\) of them have mud on their foreheads
    • (\(k\) is not known to the children)
  • The children are all perfectly rational and logical (:joy:)
  • The children sit in a circle
    • Everyone can see everyone else's forehead
    • No one can see their own forehead
  • The children cannot and do not communicate.
  • Q: based on what they see and know, can any child tell if they have mud on their forehead?
    • No.

The game

  • The teacher says we will play the following game:
    • The teacher announces "someone has mud on their forehead"
    • while True:
      • everyone close their eyes
      • raise your hand if you know you have mud on your forehead
      • put your hands down
      • open your eyes
      • teacher announces results as follows:
        • if exactly the right set of people raise their hand, everyone wins and game is over
        • if at least one person raises their hand, but not exactly the right set, everyone loses and game is over
        • if no one raises their hand, teacher announces that no one did, and game continues in next round

What happens?

  • We worked this out in class

  • First, let's think about the case where \(k=1\)
    • when the teacher announces "someone has mud", the muddy student gets new information! (everyone they can see does not have mud) so they raise their hand.
  • When \(k=2\), in first round, nobody raises hand.
    • But then teacher announces that no one raised hand, and that gives them information.
      • From one of the muddy student's perspectives, we can see that there is only one other muddy student, so they know \(k=1\) or \(k=2\)
      • So after that other student does not act in the first round (and because they know that other student is perfectly rational etc.), we can conclude that we are muddy.
  • In general, game proceeds for \(k-1\) rounds where no one raises their hand, and then all muddy students raise their hand in the \(k\)-th round.

Why is this interesting?

  • When \(k>1\), the teacher's announcement does not tell any student any information they don't already know
    • But the game doesn't work without the announcement
    • "Paradox"
  • The paradox is resolved by realizing that the announcement tells us something about what others know.
    • Recall \(k=2\). After the announcement, if we are a muddy student, we know that the only muddy student we see would be able to raise their hand if \(k=1\).
  • So knowledge about what other people know is essential to the example

Why is this relevant to distributed systems?

  • Each node has their own local state
  • They can send messages about their state to other nodes
  • Other nodes can respond saying "I received your message"
  • Now the original sender "knows that the receiver knows" about our state
  • This kind of reasoning is pervasive.

  • One hard thing about reasoning about distributed systems is separating the "bird's eye view" from the local view
    • In single node programming, this distinction does not exist
    • But this distinction is absolutely fundamental to distributed systems
    • Unless we communicate, I have no idea what your local state is.
    • Even if we do communicate, I only know what you tell me, and I only know that it was true when you sent the message.
    • Partial information.