Writing logic statements using quantifier

352 Views Asked by At

I was given two predicates $\text{Prime}(x)$ and $\text{Even}(x)$ and is required to write the following statements:

  1. For every odd natural number there is a different natural number such that their sum is even.

My attempt: $(\forall x):(x \in \mathbb{N} \wedge \neg \text{Even}(x) \to (\exists y):(x \neq y \wedge \text{Even}(x+y))).$

and

  1. The sum of any two prime numbers except the prime number $2$ is even.

My attempt: $(\forall x,y):(x \neq 2 \wedge y\neq 2 \wedge \text{Prime}(x,y) \to \text{Even}(x+y)).$

Is my attempt correct? And Am I allowed to write $\text{Prime}(x,y)$ or should I write $(\text{Prime}(x) \wedge \text{Prime}(y))?$

1

There are 1 best solutions below

8
On

In the first statement, you wrote $x \neq y \wedge \text{Prime}(x+y)$ but it should be $x \neq y \wedge \text{Even}(x+y).$

Avoid writing $\text{Prime}(x,y)$ because the predicate $\text{Prime}$ only takes one argument (i.e., $\text{Prime}(x)$.)

You could also have written the following.

  1. $(\forall x \in \mathbb{N})(\exists y \in \mathbb{N}):[\neg \text{Even}(x) \to (x \neq y \wedge \text{Even}(x+y))].$

  2. $(\forall x \in \mathbb{N})(\forall y \in \mathbb{N}):[(\text{Prime}(x) \wedge \text{Prime}(y) \wedge x \neq 2 \wedge y \neq 2) \to \text{Even}(x+y)].$