Problem
(Adapted from "Mathematics for Computer Science", Lehman, Leighton, Meyers, 2018.)
Translate the following sentences into predicate formulas:
(a) There is a student who has e-mailed at most two other people in the class, besides possibly himself.
(b) There is a student who has e-mailed exactly two other people in the class, besides possibly himself.
The domain of discourse are the students in the class. Use the predicate $E(x,y)$ to mean that "$x$ has sent e-mail to $y$".
Solution attempt
(a) The sentence can be rephrased as: "There is a student who did not e-mail 3 or more people in the class, besides possibly himself".
Or, in other words: "There is a student $x$ such that, for all students $y_1,y_2,y_3$, if $x$ has e-mailed all three of $y_1,y_2,y_3$, then at least two of $y_1,y_2,y_3$ are equal to each other, or at least one of $y_1,y_2,y_3$ is equal to $x$". So, this can be expressed as:
$\exists x \forall{y_1,y_2,y_3} \left[ E(x,y_1) \land E(x,y_2) \land E(x,y_3)) \implies (y_1=y_2 \lor y_1 = y_3 \lor y_2=y_3 \lor y_1=x \lor y_2=x \lor y_3=x ) \right]$
The value of this predicate formula is false if all students have e-mailed at least three distinct students $y_1,y_2,y_3$ all of which are different from $x$.
(b) Two solution attempts:
The first attempt is based on rephrasing the sentence as: "There are three distinct students $x,y,z$ such that $x$ e-mailed both $y$ and $z$ and, for all students $w$, if $x$ has e-mailed $w$, then $w$ is equal to one of $x,y,z$":
$ \exists{x,y,z} \forall w \left[ E(x,y) \land E(x,z) \land y\neq z \land y\neq x \land z\neq x \land (E(x,w) \implies w=x\lor w=y\lor w=z) \right] $
The second attempt is based on rephrasing the sentence as: "There are three distinct students $x,y,z$ such that, for all students $w$: $x$ has e-mailed $w$ exactly when $w$ is equal to one of $x,y,z$, or $w=x$ ($x$ has possibly e-mailed himself)".
$ \exists{x,y,z} \forall w \left[ w=x\lor (y\neq z \land y\neq x \land z\neq x \land (E(x,w) \iff w=x\lor w=y\lor w=z) \right] $
The value of the predicate formulas of both attempts above is false if there is no student $x$ who e-mailed exactly two distinct people $y,z$.
Is this solution correct?