CS 281 Solutions to Test II


April 27, 1999



1. Find the powerset of each of the following sets: [10]

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

Solutions:
(a) {$\emptyset$ }
(b) { $\emptyset$, { $\emptyset$ }, { { $\emptyset$ }}, { $\emptyset$ , { $\emptyset$ } } }

2. Find the following Cartesian products: [10]

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

Solutions:
(a) { (1, 1, $\emptyset$), (1, 2, $\emptyset$), (2, 1, $\emptyset$), (2, 2, $\emptyset$) }
(b) $\emptyset$

3. Find the smallest four elements of the set S defined recursively as follows: [8]

Basis Clause: $ 0 \in S$
Inductive Clause: If $x \in S$, then $2x + 1 \in S$.
Extremal clause: Nothing is in S unless it is obtained from the above two clauses.

Solution: 0, 1, 3, 7

4. Recursively define each of the following sets:

(a) The set of positive integers congruent to 1 modulo 3. [10]
(b) { $2^{n} - 1 \mid n$ is a natural number.} [10]

Solutions:
(a) Let T be the set to be defined.
Basis Clause: 1 $\in T$
Inductive Clause: For all x, if $x \in T$, then $x + 3 \in T$.
Extremal Clause: Nothing is in T unless it is obtained from the above two clauses.

(b) Let U be the set to be defined.
Basis Clause: 0 $\in U$
Inductive Clause: For all x, if $x \in U$, then $2x + 1 \in U$.
Extremal Clause: Nothing is in T unless it is obtained from the above two clauses.

5. Prove $( A - B) - C \subseteq A - C $ for sets A, B, and C. [15]

Proof: $(A - B) - C = (A \cap \overline{B}) \cap \overline{C}$
= $A \cap (\overline{B} \cap \overline{C})$
= $A \cap (\overline{C} \cap \overline{B})$
= $(A \cap \overline{C}) \cap \overline{B}$
= $(A - \overline{C}) \cap \overline{B}$
$\subseteq A - C$

6. Indicate which of the following are true and which are false. [16]

(a) $\{x \} \subseteq \{\{x \}\}$
(b) { $x\} \in \{ x\}$
(c) $\{ x \} \in \{\{x \}\}$
(d) $\emptyset \in \{ x \}$

Solutions: (c) is true, and the rest are false.

7. Express the assertions given below as a proposition of a predicate logic using the following predicates. The universe is the set of objects.[21]

CH(x): x is a check.
CS(x): x is cashable.
V(x): x is valid.

(a) Some checks are not valid.
(b) All invalid checks are not cashable.
(c) For a check to be cashable it is necessary that it is valid.

Solutions:
(a) $\exists x [ CH(x) \wedge \neg V(x)]$
(b) $\forall x [ CH(x) \wedge \neg V(x) \rightarrow \neg CS(x) ]$
(c) $\forall x [ CH(x) \wedge CS(x) \rightarrow V(x) ]$