# OpenLab Assignment #2: Create a logical puzzle

Make a translation puzzle (Due Thursday, October 3).  Your assignment this week is to take a common phrase – a saying, a quote, a song lyric, or anything recognizable to most people – and translate it into logical notation.  You should break it up into individual parts (such as P, Q and R), and then combine them using logical notation to create your phrase.  This is meant to be a puzzle for your classmates, so do NOT include the original phrase.

Your submission should include: the individual parts P, Q, R etc. (written in English), and the puzzle itself (written in logical notation).

Extra Credit.  You can earn extra credit by responding to a classmate’s puzzle – either by being the first person to correctly guess the phrase, or by making suggestions, or by offering an alternative way of translating the phrase into logical notation.

Here are two examples:

1.

P: you're happy
Q: you know it

Puzzle: $( P \wedge Q) \Rightarrow R$

2.

P(x,y): you can fool person x at time y

Puzzle: $\sim (\forall x,y P(x,y))$ 

Answer: “You can’t fool all the people all the time”

How do I type logical notation on the OpenLab?  This is not too hard — BUT it takes a little getting used to.  Here’s an example. If you type this into a comment:

Here is a statement:  $latex P \wedge Q$

then (after you post the comment) you should see this:

Here is a statement: $P \wedge Q$

Each equation or expression begins with “$latex ” and ends with “$”.  In between “$latex ” and “$” you type your math — many things you type just as they are, like letters and numbers, but each special symbol has a special code.  In the example above, we use the code “\wedge” to produce the upside-down vee which means “and”.

Here are a few more examples:

 Type this: to get this result: $latex P \vee Q$ $P \vee Q$ $latex P \Rightarrow Q$ $P \Rightarrow Q$ $latex \sim P$ $\sim P$ $latex \bar{P}$ $\bar{P}$ $latex P \Leftrightarrow Q$ $P \Leftrightarrow Q$ $latex \forall x, P(x)$ $\forall x, P(x)$ $latex \exists x, P(x)$ $\exists x, P(x)$ $latex \forall x \exists y ( P(x) \vee Q(y)) \implies R(x,y)$ $\forall x \exists y ( P(x) \vee Q(y)) \implies R(x,y)$

LaTeX tester.  Want to test out your LaTeX code before you post it in a comment?  There is a LaTeX tester here, where you can type in your formula, hit the button, and see how it looks: http://samples.geekality.net/latex/.
NOTE:  When you use the test, do NOT include the dollar signs or the word “latex” — just include the stuff in between.

Finally, if you submit a comment but you find it doesn’t look right, don’t hesitate to make corrections and submit it again – you will NOT be penalized for multiple submissions!

### 57 responses to “OpenLab Assignment #2: Create a logical puzzle”

1. ibrahimadam193 $\forall s \in S ( ( s \in S) \implies (s \in F))$
where: $S = \{ \text{Set of all locations containing smoke }\}$ $F = \{ \text{Set of all locations containing fire} \}$

2. yanira

P: You can handle me at my worst
Q: You deserve me at my best

Puzzle: $\sim P\Rightarrow \sim Q$

• Renautha

If you can not handle me at my worst, then you do not deserve me at my best.

3. Renautha

L- I get Logical
I- Trust my Instincts
T-I get in trouble $L\(wedge Q$($latex\sim I \Rightarrow T$))

4. Renautha

L- I get Logical
I-Trust my Instincts
T-I get in trouble

Puzzle: $L \wedge (\sim I \Rightarrow T)$

• Ricky S.

I get Logical and, if I do not trust my instincts then I get in trouble.

5. Jonas Reitz

Guys, I’m loving these puzzles so far – nice work!

6. Albina Yevdayeva

P: love
Q: life
Puzzle: $P \Leftrightarrow Q$

7. Albina Yevdayeva

P : you
Q: being good $\forall x, P \Rightarrow Q$

8. Albina Yevdayeva

sorry, i meant:
Q: you
P: being good
Puzzle: $\forall x, Q$ \Rightarrow $\sim P$

9. Albina Yevdayeva

OMG, I got confused !!!

• Jonas Reitz

Hi Albina,
I like your setup! BUT I’m not sure I follow the puzzle – if you have the universal quantifier $\forall x$, then there should also be an ‘x’ running around in the P and Q somewhere, P(x) and Q(x).

10. Ricky S.

P(x)- Humans with common sense exist
R(x)- A world some place out there
~S(x)- This is not a place I want to live

Puzzle: $\exists x, R(x) \wedge (P(x) \Rightarrow S(x))$

• yanira

Their exists a world some place out there and if humans with common sense exist then this is the place I want to live .

• Jonas Reitz

Great puzzle! I recommend using just “S(x)” in your original definition, to mean the positive statement “This is a place I want to live” — then modify the Puzzle using $\sim$ in order to get the meaning you want.

11. Ms. Desir

it may not be easy but it is worth it
puzzle
p=it may not be easy
Q=but it is worth it
~P=>Q

• Jonas Reitz

Hi Ms. Desir – I like the sentiment! But right now, if p=it may not be easy, then in your puzzle $\sim P$ seems to mean “it may NOT not be easy” — there’s a double negative there! (does this make sense? Write back if not).

• Ms. Desir

Should it just be P instead since its already negative .. Would it be if p then q . I was under the impression the puzzle should be related to the phrase but maybe it’s contrapositive or its inverse.

• Jonas Reitz

Yes, you could use just P in the puzzle (since it’s already negative) . As long as the puzzle gives the phrase you want, the form (contrapositive, etc), doesn’t matter.

12. Rafael

P: The King’s horse(x)
Q: The King’s man(y)
R: Could put Humpty together again……. $\forall x\forall y, P(x)\wedge Q(y)\Rightarrow \sim R$

• Alphatron

If all of the kings horses and all of the king’s men, then they couldn’t put Humpty together again.

At least, I think that’s how you’d say it here.

13. Ms. Desir

worry too much ,happiness will come less
P: worry too much
Q: happiness will come less
Puzzle
P=>Q
~P=>~Q

14. Alphatron

Q: You have nothing nice to say
P: Don’t say anything.

Q $P \Rightarrow Q$ P

15. Alphatron

Q: You have nothing nice to say
P: Don’t say anything.

Q \Rightarrow P

16. Alphatron

Q: You have nothing nice to say
P: Don’t say anything. $Q \Rightarrow P$

17. Alphatron

Actually, even then, it’s not correct. It should be:

Q: You have something nice to say
P: Say something. $Q \Rightarrow P$

18. Alphatron

We should be able to delete posts here

Q: You have something nice to say
P: Say something. $~Q \Rightarrow ~P$

• Jonas Reitz

Hi Alphatron,
Yes, the ability to edit comments would be helpful. This way does allow me to see your thought process, however – excellent work developing your idea!

19. saloua

If you go away, you can’t expect people to keep your place for you.
P: you go away
Q: you can’t expect people to keep your place for you $P \ Rightarrow Q$

20. saloua

If you go away, you can’t expect people to keep your place for you.
P: you go away
Q: you can’t expect people to keep your place for you $P \ rightarrow Q$

21. saloua

If you go away, you can’t expect people to keep your place for you.
P: you go away
Q: you expect people to keep your place for you $P \Rightarrow latex \sim Q$

22. saloua

If you go away, you can’t expect people to keep your place for you.
P: you go away
Q: you can’t expect people to keep your place for you
latex P \Rightarrow \sim Q

23. saloua

I don’t know why I can’t get the correct expression, when I put it in latex tester it works??

• Jonas Reitz

Saloua, You’re almost there — just take the code you typed into the latex tester, and put the whole thing between $latex and$

24. Jean Poyo

Q: someone will hire you to build theirs.
~P=>Q

• Alan S. Jara

If you don’t build your dreams then someone will hire you to build theirs.

25. Alan S. Jara

P: All you need
Q: A dollar
R: A dream $P \Rightarrow Q\wedge R$

• Patty Arredondo

All you need is a dollar and a dream

• Jonas Reitz

Alan,
I love this sentiment – but the formal logic seems weird. A direct translation would be “If all you need, then a dollar and a dream”. What went wrong?
HINT: P, Q and R should be statements – are they?

26. Patty Arredondo

P: Diet
Q: Exercise
R: A healthy life
latex$(\sim P \wedge \sim Q) \rightarrow \sim R$

27. Patty Arredondo

Trying again!
P: Diet
Q: Exercise
R: A healthy life $(\sim P \wedge \sim Q) \rightarrow \sim R$

• Jonas Reitz

nice job!

28. d.Santos

P: Walk the dog
R: you’ll get punished

$sim (P \vee Q) \implies R$

29. d.Santos

P: Walk the dog
R: you’ll get punished $\sim (P \vee Q) \implies R$

• Jonas Reitz

I’ll forward this one to my daughter 🙂
-Prof. Reitz

ps. She is 4. And no, she doesn’t understand logical symbols. Yet.

30. Benjamin Zeng

P: You are Schrodinger’s cat
R: You are alive $P \Rightarrow (Q \wedge R)$

• d.Santos

If you are Schrodinger’s cat, then you are dead and alive.

31. saloua $P \Rightarrow \sim Q$

32. saloua

Thank you professor I got it finally.
P : you go away
Q :you can’t expect people to keep your place for you $P \Rightarrow \sim Q$

• Jonas Reitz

Great work with the latex!

A final suggestion — make a change to get rid of the double-negative in your logic (the expression $\sim Q$ would mean “you can’t NOT expect people to keep your place for you\$)

33. Albina Yevdayeva

D. Santos
If you don’t clean the room and walk the dog, you will get punished.
Patty Arredondo
With no diet and exercise, don’t expect a healthy life.

34. Albina Yevdayeva

Saloua
If you go away, you can’t expect people to keep your place for you

• Jonas Reitz

Albina, you’re on fire!

35. asiag

P: The pokemon is yellow
Q: It is a pikachu $P \Rightarrow Q$

• Ricky S.

If the Pokemon is yellow, then it is a pikachu!! Duh!! Gotta catch em all.

36. asiag

Q: you fall for everything
P: You don’t stand for anything $P \Rightarrow Q$

• d.Santos

If you fall for everything then you don’t stand for anything!!!