CS 281 Final Exam


August 3, 1995

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 tex2html_wrap_inline59 . The universe is the set of natural numbers between 1 and 100.
(a) Some entries of A are zero.
(b) The 6-th and 47-th entries of A are negative.
(c) If some entries of A are negative, then all the entries of A are negative.
(d) If the first 10 entries of A are nonnegative, then the last 10 entries are also nonnegative.
(e) All odd numbered entries are negative.
(f) All entries of A between the 10-th and 50-th entries are sorted in non-decreasing order.

2. Fill in the blanks with shortest strings.
(a) If P is necessary for Q, then Q is tex2html_wrap183 for P.
(b) The power set of { tex2html_wrap_inline97 }}} is { tex2html_wrap_inline99 }}}}.
(c) The transitive closure of the parent-child relation on a set of people is the tex2html_wrap_inline101 relation.
(d) Let tex2html_wrap_inline103 be defined as tex2html_wrap_inline105 , x R y iff tex2html_wrap_inline113 is even. Then R is reflexive, tex2html_wrap_inline101 , and tex2html_wrap_inline101 . Hence R is tex2html_wrap_inline101 relation.
(e) If the digraph of an order relation has a cycle, it can not be a partial order because it violates the tex2html_wrap_inline101 property.
(f) tex2html_wrap_inline127 tex2html_wrap_inline101 tex2html_wrap_inline131 .
(g) tex2html_wrap_inline127 = tex2html_wrap_inline131 tex2html_wrap_inline101

3. Let tex2html_wrap_inline141 , and tex2html_wrap_inline143 .
Then prove that if tex2html_wrap_inline145 , then tex2html_wrap_inline147 .

4(a) Define the set of negative odd numbers inductively.
(b) Prove by induction that tex2html_wrap_inline149

5(a) Define the following relation R on the set of natural numbers N inductively: For all natural numbers a and b, tex2html_wrap_inline159 iff tex2html_wrap_inline161 .
(b) Prove by induction that for every natural number n, if 0 < n, then tex2html_wrap_inline167 , where the binary relation R on the set of naturals N is defined as
(1) tex2html_wrap_inline173 .
(2) tex2html_wrap_inline105 if tex2html_wrap_inline177 , then tex2html_wrap_inline179 and tex2html_wrap_inline181 .
(3) Extremal clause.




S. Toida
Thu May 29 10:58:54 EDT 1997