# 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. $\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. P: You can handle me at my worst
Q: You deserve me at my best

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

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

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

$L\(wedge Q$($latex\sim I \Rightarrow T$))

4. L- I get Logicalâ€¨
I-Trust my Instinctsâ€¨
T-I get in trouble

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

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

5. 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 !!!

• 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. 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))$

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

• 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. 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

• 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).

• 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.

• 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. 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$

• 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. worry too much ,happiness will come less
P: worry too much
Q: happiness will come less
Puzzle
P=>Q
~P=>~Q

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

Q $P \Rightarrow Q$ P

15. Q: You have nothing nice to say
P: Donâ€™t say anything.

Q \Rightarrow P

16. Q: You have nothing nice to say
P: Donâ€™t say anything.

$Q \Rightarrow P$

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

Q: You have something nice to say
P: Say something.

$Q \Rightarrow P$

18. We should be able to delete posts here

Q: You have something nice to say
P: Say something.

$~Q \Rightarrow ~P$

• 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. 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. 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. 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. 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. I don’t know why I can’t get the correct expression, when I put it in latex tester it works??

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

24. P: build your own dreams
Q: someone will hire you to build theirs.
~P=>Q

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

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

• All you need is a dollar and a dream

• 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. P: Diet
Q: Exercise
R: A healthy life
latex$(\sim P \wedge \sim Q) \rightarrow \sim R$

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

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

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

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

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

• I’ll forward this one to my daughter đź™‚
-Prof. Reitz

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

30. P: You are Schrodinger’s cat
R: You are alive

$P \Rightarrow (Q \wedge R)$

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

31. $P \Rightarrow \sim Q$

32. 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$

• 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

35. P: The pokemon is yellow
Q: It is a pikachu

$P \Rightarrow Q$

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

36. Q: you fall for everything
P: You don’t stand for anything

$P \Rightarrow Q$

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