# Converting a sentence to Predicate Logic

Need help translating this sentence to predicate logic.

If a student brings a candy bar for him or herself, then that student brings a candy bar for everyone.

• Use $$C(w)$$ as the one-place predicate "$$w$$ is a candy bar"

• Use $$B(x, y, z)$$ as the three-place predicate "$$x$$ brings $$y$$ for $$z$$"

This is what I have but I am unsure if it's the correct solution $$\exists x(B(x, C(w), x)) \rightarrow \exists x \forall z(B(x, C(w), z))$$

• I think the first part of the implication must have two possible options: for him or for me. – manooooh Sep 21 '18 at 5:42

## 1 Answer

You forgot to get any candy bars. Notice that it is the same student each time and $$C(x)$$ is not a candy bar, it is a statement.

$$\exists x (\exists w (C(w) \wedge B(x,w,x)) \rightarrow \forall z \exists w (C(w) \wedge B(x,w,z)))$$

That is still incomplete because a predicate $$S(z)$$ - is a student - needs to be included.
Presumably everyone is just the students in the class and not all the students, teachers, principal and assistants in the school.