CS 381 Final Exam



December, 2003



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



$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) Not every natural number is a composite number.




b) A natural number is a prime number only if it is not divisible by any number.




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





2 (a) Recursively define the relation $<$ on the set of natural numbers. [8]














(b) Recursively define $\cup_{i = 1}^{n} A_{i}$ that is $A_{1} \cup A_{2}\cup A_{3} ... \cup A_{n}$ for sets $A_{1}$, $A_{2}$, $A_{3}$, ..., $A_{n}$. [7]



3. Which of the following statements are true and which are false ? $A, B, C$ and $D$ are sets. [10]



(a) $\emptyset \subseteq \{\emptyset \}$



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



(c) If $A \cap B = B$, then $A \cup B = A$.



(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) $\{ \emptyset \} \times \{ \emptyset \} = \emptyset $



(g) $f(x) = 1/(x^{2} + 1)$ is a function from N to N, where N is the set of natural numbers.



(h) $f(x) = (x - 5)^{2}$ is a one-to-one function from N to N.



(i) $f(x) = x + 2$ is a onto function from N to N.



(j) The subset relation on a collection of sets is a partial order.




4 (a) Prove by mathematical induction that $\Sigma_{i=0}^{n} i^{3} = (n(n+1)/2)^2$. [8]



(b) Prove that any amount of postage greater than or equal to 2 cents can be built using only 2-cent and 3-cent stamps. [7]






















5. Let $R$ be a binary relation on a set $A$. Suppose that $R$ is symmetric and transitive and every element of $A$ is related to some element by $R$. Prove that $R$ is an equivalence relation. [15]



6. 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. [15]



Relation Ref Irref Antisym Sym Tran
$\geq $ on naturals          
$\neq$ on naturals          
"Taking same courses" relation on people          
Ancestor-descendant relation on people          
$R$ on naturals, where $<x, y> \in R$ iff $x > y^{2}$          



7. 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.) [15]





S. Toida
2003-12-05