CS 381 Final Exam




Spring 2001




1. Let $A$ be an array of integers of size $100$ and let $A[i]$ denote the $i$-th entry of $A$ for a natural number $i$. Express the assertions given below as a proposition of a predicate logic using the predicate $\leq$. The universe is the set of natural numbers between $1$ and $100$.



(a) Some entries of $A$ are nonnegative.
(b) The $8$-th or $27$-th entry of $A$ is nonnegative.
(c) If some entries of $A$ are nonnegative, then all the entries of $A$ are nonnegative.
(d) If the first $10$ entries of $A$ are nonnegative, then the last $10$ entries are also nonnegative.
(e) All entries at even numbered locations are nonnegative.



2 (a) Express the argument given below in the symbolic form of first order predicate logic. Use the predicate symbols shown. You may also use the predicate = .
(b) Prove that the argument is valid by deriving the conclusion from the premises using inference rules. Use one rule for each step of your reasoning and state what rule is used.



Argument: Every computer science student works harder than someone. Everyone who works harder than any other person gets less sleep than that person. Jane is a computer science student. Therefore, Jane gets less sleep than someone else.



$C(x)$: $x$ is a computer science student.
$W(x,y)$: $x$ works harder than $y$.
$S(x,y)$: $x$ sleeps less than $y$.



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



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



4. Prove by mathematical induction the following:



(a) $n^{2} - 7n + 2$ is an even number for all natural number $n$.
(b) Prove that any amount of postage greater than or equal to 14 cents can be obtained using 3-cent and 8-cent stamps.



5 (a) Recursively define the set of propositions of propositional logic with P, Q and R as propositional variables.
(b) Recursively define the relation $\geq$ on the set of natural numbers.



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.



Relation Ref Irref Antisym Sym Tran
$\neq$ on naturals          
$\leq$ on naturals          
$ R on naturals, where (x, y) \in R$ iff $x > y^{2}$          
Parent-child relation on peoples          
$x \equiv y$ (mod 5) on naturals