Monday, March 5, 2018

Logic problem discussed on 03/04/2018

There are four types: boy knight, boy knave, girl knight, and girl knave. 

Rule: Boy knight and girl knave always tell truth. Boy knave and girl knight always lie.

Setting: communication on the Internet, no face seen and no voice heard. Information only comes from the text message. 

Problem: determine the type of person based on the message s/he sends. Or write a message that can only come from given type(s). 

Example 1:  "I never lie" is a message that can come from any type: it is true for both boy knight or girl knave, who always tell truth, and false for both boy knave and girl knight, who always lies. 

Example 2:  "I am a boy" is a message that can only come from a knight. To see this, construct the following truth table:

boy girl
knight T F
knave T F

The message is true for boy knight and false for girl knight, so both types may send it. It is true for boy knave and false for girl knave, so neither type will send it.

Example 3: If a message that can only come from a boy, then its truth values must be as follow:

boy girl
knight T T
knave F F

To exclude the possibility that the message is from a girl, it has to be true for girl knight and false for girl knave.  To make it possible for both types of boys to send this message, it must be true for boy knight and false for boy knave. "I am a knight" is a message that satisfies all these requirements.

Example 4:  Write a message that can only come from a girl knight.  To do so, we first develop the following truth table:

boy girl
knight F F
knave T F

For neither boy knight nor girl knave to send this message, it must be false for both types. For a boy knave not to send this message, it must be true for him. For a girl knight to send this message, it must be false for her.  "I am a boy knave" is a message that meets all these conditions.

Homework:

1. Write a message that can only come from a boy knight.

2. Write a message that can come from anybody but a girl knave.

3. Write a message that cannot come from any of these four types.

4. To refresh your memory about things we learned weeks ago. Suppose that you want to find out if a person you met on the Internet has a brother. The person is of one of the above four types but you don't know which one. You are allowed to send him/her one message to ask a question for a yes/no answer. What question should you ask?