Translating into first-order logic

first-order-logic

How would I translate the following into first-order logic?
Currently I have this but I am not completely sure if this is correct

Not all students take both History and Biology.\
$\exists x:$ $\neg$ $Student(x)$ $\wedge$ $H(x)$ $\wedge$ $B(x)$)

Only one student failed History.\
$\exists x$ $Student(x)$ $\wedge$ $(Hf(x)$ $\wedge$ $\forall$ $y:(Hf(y) \supset$ x=y))

Every person who dislikes all vegetarians is smart\
$ \forall x$ $\forall y$: PERSON(x) $\neg L(x,y) \wedge V(y) \supset S(x)$

No person likes a smart vegetarian \
$\forall x$ $\forall y$ PERSON(x) $ \wedge S(y) \wedge V(y)$ $\supset$ $\neg L(x,y)$

I’m particularly confused about this one
How would I go about establishing a one to one relationship

There is a student who does homework for those and only those who do not do homework for themselves. \
$\exists x$ $\exists y$ students(x) $\neg HomeWork(y) \supset $HomeWork(x)$

Best Answer

Not all students take both History and Biology.\ $\exists x:$ $\neg$ $Student(x)$ $\wedge$ $H(x)$ $\wedge$ $B(x)$)

Your formula says: There is someone who is not a student who takes history and biology.
Instead you want to say: There is someone who is a student but does not take both history and biology.

Only one student failed History.\ $\exists x$ $Student(x)$ $\wedge$ $(Hf(x)$ $\wedge$ $\forall$ $y:(Hf(y) \supset$ x=y))

Correct.

Every person who dislikes all vegetarians is smart\ $ \forall x$ $\forall y$: PERSON(x) $\neg L(x,y) \wedge V(y) \supset S(x)$

This is not a formula, there is a connnective missing between $PERSON(x)$ and $\neg L(x,y)$. The person predicate can be left away anyway. Additionally, the universal quantifier for the disliked vegetarians must be inside the condition of the implication ("if they dislikes all vegetarians"), not on the outside.

No person likes a smart vegetarian \ $\forall x$ $\forall y$ PERSON(x) $ \wedge S(y) \wedge V(y)$ $\supset$ $\neg L(x,y)$

Correct.

I’m particularly confused about this one
How would I go about establishing a one to one relationship
There is a student who does homework for those and only those who do not do homework for themselves. \ $\exists x$ $\exists y$ students(x) $\neg HomeWork(y) \supset $HomeWork(x)$

"Q for those and only for those who P" means: Q if and only if P, or equivalently, if P and Q and if Q then P.

Related Question