# First Order Logic: sentence into symbols

Are these translations correct?

Translate the following sentences into wfs.

• a) Nobody loves a loser.

Let $H(x,y):= x$ loves $y$.

Then $\lnot(\exists x\exists p (H(x,p)))$

• b) Nobody in the statistics class is smarter than everyone in the logic class.

(which is the same (I think) as 'All in the logic class are smarter than all in the statistic class.')

Let H(x,y):=x is smarter than y, p(x)=x is in the logic class and q(x)=x is in the statistic class.

Then $\forall x\forall y[(q(y)\land p(x))\to H(x,y)]$

• c)Anyone who knows Julia loves her.

(This is the same as 'If x knows Julia, then x loves Julia.')

Let $p(x)=x$ knows Julia, H(x,J)=x loves Julia.

Then $\forall x(p(x)\to H(x,J))$

• d) There is no set belonging to precisely those sets that do not belong to themselves.

Let $H(x,y)=$The set x belongs to the set y.

Then $\forall\forall[\lnot H(x,y)\land \lnot H(y,y)]$

• e) There is no barber who shaves precisely those men who do not shave themselves.

Let H(x,y)=x shaves y.

Then $\forall x\forall y[\lnot H(x,y)\land \lnot H(y,y)]$

• This exercise is from Mendelson logic book btw – user178403 Nov 19 '17 at 1:59
• How would you write "Nobody loves nobody" as a wff? – Git Gud Nov 19 '17 at 2:00
• $\forall x(\lnot H(x,x))$ – user178403 Nov 19 '17 at 2:05
• But that'd mean nobody loves him-/herself. Hint "Nobody loves nobody" = "Everybody loves someone". – PattuX Nov 19 '17 at 2:06

a) where is the part about someone being a loser? Or was that a typo and it's supposed to be 'Nobody loves a lover?' Even so, you'll need two instances of a predicates, not one

b) No, your interpretation is incorrect. just because no one in the statistics class is smarter than everybody in the logic class does not mean that every one in the logic class is smarter than everyone in the statistics class. For example, suppose that there is one really smart person in the logic class who is smarter than everyone else, but otherwise you have some not so smart people in the logic class and a bunch of smart people in the statistics class that are smarter than everyone in the logic class except for that one really smart person. Then we have that no one in the statistics class is smarter than everyone in the logic class, but we don't have that everyone in the logic class is smarter than everyone in the statistics class

c) You probably want to use a 2-place predicate $K(x,y)$ for '$x$ knows $y$'

d) and e) Think of these as conditionals: e.g if a set does not belong to itself, then it belongs to some set. And: if someone doesn't shave himself, then the barber will shave that person. And what if a person does shave himself?

• What other words can mean the same as no one ? I understand that no one means nobody for example, from 10 people, 0 people is no one – user178403 Nov 19 '17 at 6:07
• @Michelle You can use the quantifiers together with negation to capture 'no one. For example, to say 'no one is tall' you could do $\neg \exists x \ Tall(x)$ or you could do $\forall x \ \neg Tall(x)$ – Bram28 Nov 19 '17 at 12:09
• For a) $\forall x (p(x)\to\lnot (\exists y L(y,x))),$ if p(x)=x is a loser, L(x,y)=x loves y. Is correct? – user178403 Nov 19 '17 at 22:15
• @Michelle a) is correct! For d) I would start with $\neg \exists x ...$ ... and then express that for any set $y$: $x$ belongs to $y$ if and only if $y$ does not belong to $y$ – Bram28 Nov 19 '17 at 23:19
• @Michelle Yeah, that's it! – Bram28 Nov 20 '17 at 21:20

a) You need a predicate for "loser".

b) Your two statements are not the same. What the original question says is that the smartest kid is in the logic class. Hint: Another equivalent would be: "For every kid from the statistics class, there is someone in the logic class who is smarter than that kid."

edit: as pointed out in the comments, my statement is actually not equivalent, as there could be students in both classes who are equally smart (or as Fabio pointed out even just one student in both classes). Another approach would just be to translate the given sentence 1:1. Again, similar to e) "nobody" (="There is nobody...") should tell you to use $\neg \exists$.

c) correct, although you could drop the $J$ and make $H$ unary, as $J$ is the second argument of $H$ in any case here.

edit: As Bram28 said, you can keep $H$ unary and even make $p$ binary. I think both should have the same number of arguments, but that's up to debate. Also I always use descriptive predicate names, which could resolve this, too. Either $knowsJulia(x)$ or $knows(x, J)$. That's how I learned it, I don't know exactly how common this is in literature.

d) As you probably recognized, this is the same as e) but I find e) better to explain.

e) Your formula says: "Everyone does not shave anyone, including himself" or in other words "No one shaves anyone". The key words "There is" should tell you to use $\exists$ somehow. Or specifically for this case, "There is no..." should tell you to use $\neg \exists$. Then think about how to model "the barber who shaves precisely those men who do not shave themselves". Hint: For each man either the barber shaves that man and the man does not shave himself OR the barber does not shave the man but the man shaves himself. Or even shorter: Every man shaves himself if and only if the barber does not shave that man.

• I see I could have saved myself the ttrouble of doing so much typing: you gave pretty mich the same pieces of advice, better in most cases in fact! The only one I disagree with is for c) I think it's best to keep the $J$ and use two 2-place predicates there . If you agree, please change that and i'll delete my answer. – Bram28 Nov 19 '17 at 2:30
• For (b), the smartest student may be taking both classes. – Fabio Somenzi Nov 19 '17 at 2:35
• Actually I was just thinking: what if everyone in both classes is equally smart? – Bram28 Nov 19 '17 at 2:37
• @Bram28: Personally I find both solutions acceptable. However, at least I'd like them consistent (both unary or both binary @FabioSomenzi/Bram28: You're right, fixed that. – PattuX Nov 19 '17 at 14:40