He deduces both 1 and 2 must want a beer. Fact he can then answer yes means he also wants a beer and can confidently assert they must ALL want beer, the waiter's question.

Perhaps this varient will help clarify:

nostr:note1k7cd0f8d52lrjxshwh3fauqtpdlw5wsxdxcwmlv55kz4rqlv9vhqs4g2cu

Reply to this note

Please Login to reply.

Discussion

But what information does he use to deduce that 1 and 2 must have a beer?

If all 3 enter into the joke in the "not-knowing" state [ 0 0 0 ]

then through the dialogue, information must be imparted to make it [ 0 0 1 ]

but they say "I don't know"

which afaict doesn't give 3 any information to make a deduction.

(not to over-intellectualize your joke or anything)