[Math] Express the statements using quantifiers

first-order-logiclogiclogic-translationpredicate-logicquantifiers

The statement :

Every student in this class has taken exactly two mathematics classes at this school.

My idea of answer :

It should probably be using a bi-conditional but I cant understand how to frame it. Probably something like :

$$∀x∀y( T(x,y) <=> ( M1(y) \lor M2(y) ) )$$

where T(x,y) means X is taking class y, M1(x) means x is first math class, M2(x) means x is second maths class. The domain for x is all studint in this class and for y is maths classes in this school.

I'm not at all convinced by the answer. Couldn't find anywhere else either.

Best Answer

Here is another way to write it, using the biconditional that you intuitively 'feel' is involved here (I use $M(x)$ for '$x$ is a math course at this school)

$$\forall x (S(x) \to \exists y \exists z (y \not = z \land \forall w ((w = y \lor w = z) \leftrightarrow (M(w) \land T(x,w))))$$

This really is just a condensed version of Pe's second answer:

Going from left to right: if $w$ is either $y$ or $z$, then that will make $z$ (and thus both $y$ and $z$) a math course taken by the student at this school, and hence the student has taken at least two math courses at this school.

Going from right to left: if $w$ is a a math course taken by the student at this school, then it has to be either $y$ or $z$, and hence the student has taken at most two math courses at this school.

Combined, this gives that the student has taken exactly two math courses at this school.