CS 381 Solutions to Test II



March 23, 2004



1. Express the assertions given below as a wff of a predicate logic using the following predicates. The universe is the set of objects.[15]



$P(x)$: $x$ is a person.
$Hp(x)$: $x$ is happy.
$Ht(x)$: $x$ is healthy.
$L(x, y)$: $x$ loves $y$.



(a) Someone is not healthy.



$\exists x [P(x) \wedge \neg Ht(x)]$



(b) Not every healthy person is happy.



$\neg \forall x [ [P(x) \wedge Ht(x)] \rightarrow Hp(x)]$
$\exists x [ P(x) \wedge Ht(x) \wedge \neg Hp(x) ]$



(c) Everyone is happy only if someone loves him/her.



$\forall x [ [ P(x) \wedge Hp(x) ] \rightarrow \exists y [P(y) \wedge L(y,x)]]$



2. Find the following Cartesian products: [10]



(a) $\{\{ \emptyset \}, \{1, 2\}\} \times \emptyset $



$\emptyset$



(b) $\{\{\emptyset \}\} \times \{ \{ 1 \}, \emptyset \}$



$\{ <\{\emptyset \}, \{1\}>, <\{\emptyset \}, \emptyset> \}$



3. Find the power set of the following sets: [10]



(a) $\emptyset$



$\{ \emptyset \}$



(b) $\{ \{ 1 \}, \emptyset \}$



$\{ \emptyset, \{\{1\}\}, \{ \emptyset \}, \{\{1\}, \emptyset \}\}$

4. Prove $ A - ( B \cup C ) = (A - B) \cap (A - C) $ by showing set inclusion in each direction. [15]



Let $x$ be an arbitrary element of the universe.
$ x \in A - ( B \cup C )$ $\Leftrightarrow x \in A \wedge \neg x \in B \cup C$
$\Leftrightarrow x \in A \wedge \neg [ x \in B \vee x \in C ]$
$\Leftrightarrow x \in A \wedge [x \not\in B \wedge x \not\in C]$
$\Leftrightarrow [x \in A \wedge x \in A ] \wedge [x \not\in B \wedge x \not\in C]$
$\Leftrightarrow [x \in A \wedge x \not\in B] \wedge [x \in A \wedge x \not\in C]$
$\Leftrightarrow x \in A - B \wedge x \in A - C$
$\Leftrightarrow x \in (A - B) \cap (A - C)$



5. Indicate which of the following are true and which are false. [20]



(a) {{ $x\}\} \in \{ x, \{\{ x \}\} \}$ True
(b) $\{1 \} \subseteq \{ 1, \{ 1 \}\}$ True
(c) $\emptyset \in \{ \{ x \}, \{\emptyset\}, x \} $ False
(d) $\emptyset \subseteq \{ \emptyset, \{ x \}\}$ True



6. Recursively define $\mid x \mid $ for strings $x$ over the alphabet $\{ a, b \}$. [15]



Basis Clause: $\mid \Lambda \mid = 0$.
Inductive Clause: $\mid x\sigma \mid = \mid x \mid + 1$ for any string $x$ and any symbol $\sigma$ of the alphabet.



7. Prove that $\emptyset \subseteq A $ for a set A. Justify each step of your proof. [15]



Let $x$ be an arbitrary element of the universe and let us consider the wff $x \in \emptyset \rightarrow x \in A$.
By the definition of $\emptyset$, $x \in \emptyset$ is false.
Hence $x \in \emptyset \rightarrow x \in A$ is (vacuously) true.
Hence by "Universal Generalization", $\forall x [x \in \emptyset \rightarrow x \in A]$ is true.
Hence by the definition of subset $\emptyset \subseteq A $.