# Express exactly two logically

Let C(x, y) : "x and y have chatted over the Internet"

where the domain for the variables x and y consists of all students in your class.

a ) There are two students in your class who have not chatted with each other over the Internet.

My answer: $\exists x \exists y[(x \not =y) \land \lnot C(x, y)]$

I googled it and mine found correct.

b ) There are exactly two students in your class who have not chatted with each other over the Internet.

My answer: $\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b(\lnot C(a, b) \iff ((a = x \land b = y)\lor(a = y \land b = x)))]$

Am I correct for question b?

• I do think you are correct. I do not think it is the nicest way to put it. – Hugo Berndsen Nov 17 '16 at 16:37

I was going to comment on the ambiguity from the lack of braces but now that you've edited, I believe it is correct. I would remove the equivalence and just leave it as an implication as it is redundant and makes it a bit harder to read.

$\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b(\lnot C(a, b) \implies ((a = x \land b = y)\lor(a = y \land b = x)))]$

EDIT: thinking further I feel like I want to add this as maybe somebody is (not) chatting with himself over the internet, but we don't want this to bother us.

$\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b\{ [a\neq b \land \lnot C(a, b)] \implies ((a = x \land b = y)\lor(a = y \land b = x))\}]$

• @jblixr I don't quite understand your objection. I want the sentence to say "There's two guys that have not chatted, and any two guys that have not chatted are actually these two guys." And this just needs the implication. – JKEG Nov 17 '16 at 16:53

Your answer is correct. In fact, given that you use a biconditional, you can leave out the $\lnot C(x, y)$:

$\exists x \exists y[(x \not =y) \land \forall a \forall b(\lnot C(a, b) \iff ((a = x \land b = y)\lor(a = y \land b = x)))]$

(do you see why this works?)

Please do make sure that you can use $a$ and $b$ as variables in your system: some systems regard those as individual constants.

• This is what I meant in my answer when I said the biconditional was redundant, as the right to left implication was covered with $\lnot C(x,y)$. I, however, feel it is easier to read with the $\lnot C(x,y)$ and the single implication. But it's matter of preference. – JKEG Nov 17 '16 at 17:07
• @Mingus Yes, I personally very much prefer the explicit $\neg C(x,y)$ together with the one-way conditional as well! But some people want the most efficienct (shortest) answer. – Bram28 Nov 17 '16 at 17:10