Predicate Logic Translating "All But One"

5.8k Views Asked by At

I need to translate an English sentence including the phrase "all but one" into predicate logic. The sentence is: "All students but one have an internet connection." I'm not sure how to show "all but one" in logic.

I could say $\forall x ((x \neq a) \rightarrow I(x))$

$I(x)$ being "$x$ has an internet connection"

But that clearly wouldn't work in this case, as we don't know which student it is.

I could say that $\exists x(\neg I(x))$

But it doesn't seem like that has the same meaning. Thanks in advance for any help you can give!

3

There are 3 best solutions below

0
On

If you mean that there is exactly one element with a given property, you can define a "unique existence" quantifier, $\exists!$, as follows: $$ \exists!x : \varphi(x) \iff \exists{x}{:}\left[\varphi(x)\wedge \forall{y}:\left(\varphi(y){\iff} y=x\right)\right]. $$ That is, a particular element $x$ has the property $\varphi$, and any element with the property $\varphi$ must be that same $x$. For your problem, you want to say that there's exactly one person that is a student and doesn't have internet access.

1
On

"All students but one have an internet connection" means there is a student who lacks a connection, while every other student (every student not identical to the unlucky guy!) has one. So (if the domain is e.g. people)

$$\exists x(\{Sx \land \neg Ix\} \land \forall y(\{Sy \land \neg y = x\} \to Iy))$$

0
On

"For all but one $\;x\;$, $\;P(x)\;$ holds" is the same as "there exists a unique $\;x\;$ such that $\;\lnot P(x)\;$ holds.

Normally the notation $\;\exists!\;$ is used for "there exists a unique" (just like $\;\exists\;$ is used for "there exists some").

If your answer is allowed to use $\;\exists!\;$, then the above gives you the answer.

If not, then there are different ways to write $\;\exists!\;$ in terms of $\;\exists\;$ and $\;\forall\;$. The one I like best, which also results in the shortest formula, can be found in another answer of mine.