What is logic? What do you use logic for?
What is a system? How do they relate?
What have we built before?
How do you know if your system works?
How are tests not sufficient?
Riddle 1
Alice -> Bob -> Charlie
Brown -> Harvale -> ?
Does someone who graduated from Brown directly supervise someone who did not graduate from Brown?
Yes, Alice supervises Bob and she graduated from Brown while he did not.
Alice -> Bob -> Charlie
Brown -> ? -> Harvale
Now does someone who graduated from Brown directly supervise someone who did not graduate from Brown?
Yes. If Bob did not go to Brown, then he is supervised by Alice who did. If Bob did go to Brown, then he supervises Charlie who did not.
Riddle 2
An evil wizard has imprisioned 4 gnomes.
There are two rooms separated by a wall. Gnomes can only see the gnomes in front of them.
They know there are two red hats and two blue hats. If any of the gnomes can figure out what
color hat they are wearing, they all go free.
/r\ | /b\ /r\ /b\
O | O O O
________________
Can anyone figure out what color hat they are wearing?
The gnomes are smart, logical, and trust each other. There is no time limit.
Answer: The middle gnome hears the back gnome say 'I don't know.' The middle gnome now knows that its hat is a different color than the gnome in front of it, because if they were the same color, the back gnome would have been able to figure out its own hat color. So, in this case, the middle gnome
correctly figures out that its hat is red.
Public Key Cryptography
Messages are encrypted with public key (which everyone has access to), but can only be decrypted with private key.
Tim Katya
----- {Tim, SecretA}K ---->
<---- {SecretA, SecretB}T ---
----- {SecretB}K ----------->
This was widely used and proven correct. Can you find the vulnerability in this interaction?
The protocol works as expected when the two parties are trustworthy, but consider what happens when one party is not trustworthy
Tim Katya Tim's Bank
---- {Tim, SecretT}K ------->
---- {Tim, SecretT}B ------>
<--- {SecretT, SecretB}T ---
<--- {SecretT, SecretB}T ----
---- {SecretB}K ------------>
---- {SecretB}B ----------->
Now, Tim thinks he's just talking to Katya, but Tim's Bank thinks they're talking to Tim.
Can it be fixed?
In the third line, send {SecretT, SecretB, Bank}T, so that when it gets to Tim, he realizes that Katya was trying to talk to his bank, and he can safely stop the interaction.
Riddle 3
(not P or Q) and (not Q or R) and R
Is there an assignment to the variables P, Q, R to make this expression true?
Yes. To make the expression true all three clauses must be true. Starting from the last clause, R must be True. Then Q can be True or False and P must be False if Q is False otherwise it can be True or False. So, R -> True, Q->True, P->False makes the expression true.