CS 381 Final Exam



December 7, 2002



1. State the following formula in English, where the universe is the set of objects and the meaning of the predicate symbols are as follows:



$C(x)$: $x$ is a car.
$L(x,y)$: $x$ likes $y$.
$E(x,y)$: $x$ is too expensive for $y$.
$P(x)$: $x$ is a person.



(a) $\forall x [C(x) \rightarrow [\exists y [ P(y) \wedge L(x,y) ] \vee
\exists y [ P(y) \wedge E(x,y) ] ] ]$



(b) $\exists x [C(x) \wedge \forall y [P(y) \rightarrow E(x,y)]]$



(c) $\forall x \forall y [[C(x) \wedge P(y)] \rightarrow [L(x,y)
\wedge E(x,y)]]$




2. Express the assertions given below as propositions of predicate logic using the following predicates. The universe is the set of objects.



$C(x)$: $x$ is a composite number.
$D(x, y)$: $x$ is divisible by $y$.
$N(x)$: $x$ is a natural number.
$P(x)$: $x$ is a prime number.



a) Every natural number is a composite number.



b) There is a natural number that is a prime number.



c) For a natural number to be a prime number, it is necessary that the natural number is not divisible by any number.



3 (a) Recursively define the set of polynomials with nonnegative integer coefficients.
(b) Recursively define the relation $<$ on the set of natural numbers.



4. Which of the following statements are true and which are false ? $A, B, C$ and $D$ are sets.



(a) $\emptyset \subseteq \emptyset$
(b) $\emptyset \in \{ \emptyset, \{ 1 \} \}$
(c) If $A \cup B = A$, then $A \cap B = B$.
(d) If $A \subseteq B$ and $C \subseteq D$, then $A \cup C \subseteq B \cup D$.
(e) $A \subseteq (A - B) \cap (A - C)$
(f) $(A - B) \cup (B - A) = A \cup B$ if and only if $A \cap B = \emptyset$.
(g) $(A - B) \cap (B - C) = \emptyset$
(h) {$\emptyset$} has two subsets.

5 (a) Prove by mathematical induction that $\Sigma_{i=0}^{n} (2i + 1) = (n+1)^2$.
(b) Let $R$ be a binary relation on a set $A$.
Prove by mathematical induction that $RR^{n} = R^{n}R$. You may use the following definition of $R^{n}$:



Basis Clause: $R^{0} = E$, where $E$ is the equality relation.
Inductive Clause: For any natural number $n$, $R^{n} = R^{n-1}R$.
(Note that no extremal clause is necessary in this case because $n$ is a natural number.)



6. Let $R$ be an equivalence relation on a set $A$.
Prove that there is a function $f$ with $A$ as its domain such that $<x,y> \in R$ if and only if $f(x) = f(y)$.



7. Fill in the table below with "Y" if the relation has the corresponding property, else with "N". In the table the following abbreviations are used.
Ref: Reflexive, Irref: Irreflexive, Antisym: Antisymmetric, Sym: Symmetric, Tran: Transitive.



Relation Ref Irref Antisym Sym Tran
$\geq $ on naturals          
$\neq$ on naturals          
$x \equiv y$ (mod 3) on naturals          
Ancestor-descendant relation on people          
$R$ on naturals, where $<x,y> \in R$ iff $x > y^{2}$          



8. Prove that if a binary relation $R$ on a set $A$ is symmetric then $R^{2}$ is symmetric.





S. Toida
2003-11-26