Sample Problems and Solutions

Contributor(s): Nicholas Smirnov

Contents

Fun: A beautiful poem on proof techniques

The Proof's Pursuit: A Mathematical Tale

In lands of logic, sharp and keen,
Where numbers dance and minds are seen,
A theorem stood, so bold, so grand—
Yet proofless still, like castles of sand.

But first came tables, rows aligned,
With truth laid bare for any mind.
Each case displayed, both false and true,
No hidden paths to misconstrue.

With chalk in hand, the wizards came,
Each hoping they could stake their claim.
A contradiction! A bijection!
A proof by cases—pure perfection!

Then came Induction, noble and proud,
"I'll prove for one, then for the crowd!
If $n$ is true, and $n+1$,
The proof is done! Oh, what fun!"

Then Recursion stepped in with grace,
"A problem small sets up the case.
Solve the base, then build anew,
Each step defined by those we knew."

Then came Contradiction’s art,
A devious play, a cunning start.
"Assume I'm wrong, let chaos reign,
Oh dear! The logic breaks in twain!"

Contraposition took its turn,
With logic crisp and truth to burn.
"If not B, then not A too,
The proof holds firm, the claim is true!"

Next, Direct Proof took the stage,
With elegance upon the page.
"A to B, so crisp and clean,
No tricks, no traps—just what is seen."

Proof by Cases made its stand,
With many paths already planned.
"If A is this, or A is that,
We check them all—now that's a fact!"

Then Counterexample, swift and sly,
Declared, "One case can make it die!
A single flaw, a fatal seam,
Unravels all—no need to dream."

Reduction came, so sly and slick,
"Transform it here—just one neat trick!
A hard old proof made easy now,
Who needs brute force? Just take a bow!"

Then came Elements, calm and clear,
"Take one object—bring it near.
If it belongs, we plainly show,
Through sets it travels, to and fro."

Then One-to-One, so sharp and bright,
Mapped all things left to right.
"A bijection, neat and true,
Two sets the same—just look, you'll see too!"

Equivalence rose with structured grace,
"Relations bind in classes’ space.
Reflexive, symmetric, transitive too,
We group the world in partitions true."

The audience gasped, the scribes took note,
The theorem stood, as if it wrote,
"I stand, I stand! I am complete!"
The mathematicians rose to their feet.

Yet lurking still in shadow's guise,
A figure grinned with knowing eyes.
From Gödel’s lips, a whisper grew:
"Not all theorems can be proved!"

And so they sighed, both sad and wise,
For proofs may shine, but truth still hides.
Yet undeterred, they took their quills,
For math rewards the steadfast wills.

So let us strive, with joy and glee,
For proofs are puzzles, wild and free!
Through logic’s maze, we twist and wind—
Who knows what wonders we may find?

Propositional Logic

Question (10 points)

Give negations of the following statements using formal mathematical language. Your negations must not use conditionals or biconditionals.

  1. if $p$, then $q$
  2. $p$ only if $q$
  3. $p$ if and only if $q$
  4. $p$ is necessary for $q$
  5. $p$ is sufficient for $q$
  6. $p$ is necessary but not sufficient for $q$
  7. $p$ is not necessary but sufficient for $q$
  8. $p$ is necessary and sufficient for $q$
  9. $p$ is neither necessary nor sufficient for $q$

Solution

  1. $p \land \sim q$
  2. $p \land \sim q$
  3. $p \oplus q$
    (alternate answer) $(p \land \sim q) \lor (\sim p \land q)$
  4. $q \land \sim p$
  5. $p \land \sim q$
  6. $(q \land \sim p) \lor (\sim p \lor q)$
  7. $(\sim q \lor p) \lor (p \land \sim q)$
  8. $p \oplus q$
    (alternate answer) $(q \land \sim p) \lor (p \land \sim q)$
  9. $(\sim q \lor p) \lor (\sim p \lor q) \equiv \mathbf{t}$

Question (5 points)

Determine if the following deduction rule is valid:

$p \rightarrow q$
$\sim q \rightarrow \sim r$
----------
$\therefore\; p \rightarrow r$

Solution

$p$$q$$r$$p \rightarrow q$$\sim q$$\sim r$$p \rightarrow q$$\sim q \rightarrow \sim r$$p \rightarrow r$
$T$$T$$T$$T$$F$$F$$T$$T$$T$
$T$$T$$F$$T$$F$$T$$T$$T$$F$
$T$$F$$T$$F$$T$$F$$F$$F$
$T$$F$$F$$F$$T$$T$$F$$T$
$F$$T$$T$$T$$F$$F$$T$$T$$T$
$F$$T$$F$$T$$F$$T$$T$$T$$T$
$F$$F$$T$$T$$T$$F$$T$$F$
$F$$F$$F$$T$$T$$T$$T$$T$$T$

$\fbox{The deduction rule is invalid.}$

Question (5 points)

Determine if the following deduction rule is valid:

$p \lor q$
$\sim p \lor \sim q$
----------
$\therefore\; p \oplus q$

Solution

$p$$q$$p \lor q$$\sim p$$\sim q$$\sim p \lor \sim q$$p \oplus q$
$T$$T$$T$$F$$F$$F$
$T$$F$$T$$F$$T$$T$$T$
$F$$T$$T$$T$$F$$T$$T$
$F$$F$$F$$T$$T$$T$

$\fbox{The deduction rule is valid.}$

Question (5 points)

Determine if the following deduction rule is valid:

$p \rightarrow \sim q$
$p \land q$
----------
$\therefore\; p \lor q$

Solution

$p$$q$$\sim q$$p \rightarrow \sim q$$p \land q$$p \lor q$
$T$$T$$F$$F$$T$
$T$$F$$T$$T$$F$
$F$$T$$F$$T$$F$
$F$$F$$T$$T$$F$

$\fbox{The deduction rule is valid (vacuous truth).}$

Question (5 points)

Mention whether the following statements are true or false. Reasoning is not required.

  1. $p \land \sim p \equiv \textbf{t}$
  2. $p \rightarrow p \equiv \textbf{t}$
  3. $p \oplus q \equiv (\sim p \lor q) \land (\sim q \lor p)$
  4. $p \rightarrow (q \rightarrow r) \equiv (p \rightarrow q) \rightarrow r$
  5. $(p \land q \land \sim r) \lor p \equiv p$

Solution

  1. False ($p \land \sim p \equiv \textbf{c}$)
  2. True
  3. False ($p \oplus q \equiv (\sim p \land q) \lor (\sim q \land p)$)
  4. False (Implication is not associative)
  5. True

Question (5 points)

Determine how many ordered truth assignments satisfy the following statement:

$$ \sim(p \land q \land r) \lor (p \land \sim q \land r) \lor \sim p $$

Solution

$p$$q$$r$$p \land q \land r$$\sim(p \land q \land r)$$p \land \sim q \land r$$\sim p$Final Expression
$T$$T$$T$$T$$F$$F$$F$$F$
$T$$T$$F$$F$$T$$F$$F$$T$
$T$$F$$T$$F$$T$$T$$F$$T$
$T$$F$$F$$F$$T$$F$$F$$T$
$F$$T$$T$$F$$T$$F$$T$$T$
$F$$T$$F$$F$$T$$F$$T$$T$
$F$$F$$T$$F$$T$$F$$T$$T$
$F$$F$$F$$F$$T$$F$$T$$T$

$\fbox{7 truth assignments.}$

Question (5 points)

Given the following logic circuit, construct an Input-Output table.

p q r

Solution

The logical expression for the circuit is $\sim(\sim(p\land q) \lor ((p \land q) \lor r))$. The truth table is as follows:
$p$$q$$r$$p \land q$$\sim (p \land q)$$(p \land q) \lor r$$\sim(\sim(p\land q) \lor ((p \land q) \lor r))$
$1$$1$$1$$1$$0$$1$$0$
$1$$1$$0$$1$$0$$1$$0$
$1$$0$$1$$0$$1$$1$$0$
$1$$0$$0$$0$$1$$0$$0$
$0$$1$$1$$0$$1$$1$$0$
$0$$1$$0$$0$$1$$0$$0$
$0$$0$$1$$0$$1$$1$$0$
$0$$0$$0$$0$$1$$0$$0$

Question (5 points)

Construct the truth table for the following logical expression:

$$ ((p \rightarrow q) \land r) \leftrightarrow \sim(p \oplus q) $$

Solution

$p$$q$$r$$p \rightarrow q$$(p \rightarrow q) \land r$$p \oplus q$$\sim(p \oplus q)$$(p \rightarrow q) \land r \leftrightarrow \sim(p \oplus q)$
$T$$T$$T$$T$$T$$F$$T$$T$
$T$$T$$F$$T$$F$$F$$T$$F$
$T$$F$$T$$F$$F$$T$$F$$T$
$T$$F$$F$$F$$F$$T$$F$$T$
$F$$T$$T$$T$$T$$T$$F$$F$
$F$$T$$F$$T$$F$$T$$F$$T$
$F$$F$$T$$T$$T$$F$$T$$T$
$F$$F$$F$$T$$F$$F$$T$$F$

Predicate Logic

Question (5 points)

Negate the following statements using formal predicate logic:

  1. $\forall x \in \mathbb{R},\; P(x) \implies Q(x)$
  2. $\exists x \in \mathbb{R},\; P(x) \land Q(x)$
  3. $\forall x \in \mathbb{R},\; \exists y \in \mathbb{R},\; x^2 + y^2 = 1$
  4. $\forall x, y \in \mathbb{Z},\; x \neq y \implies P(x) \land P(y)$
  5. $\exists x \in \mathbb{N},\; P(x) \lor Q(x)$

Solution

  1. $\exists x \in \mathbb{R}, P(x) \land \sim Q(x)$
  2. $\forall x \in \mathbb{R}, \sim P(x) \lor \sim Q(x)$
  3. $\exists x \in \mathbb{R}, \forall y \in \mathbb{R}, x^2 + y^2 \neq 1$
  4. $\exists x, y \in \mathbb{Z}, (x \neq y) \land (\sim P(x) \lor \sim P(y))$
  5. $\forall x \in \mathbb{N}, \sim P(x) \land \sim Q(x)$

Question (5 points)

Consider a scenario where a student is represented by $S$, and the following predicates are given:

Express the following statements using formal mathematical logic.

  1. Every student who studies computer science also studies mathematics.
  2. There exists a student who studies both computer science and mathematics.
  3. A student will study mathematics unless they are studying computer science.
  4. If a student studies both computer science and mathematics, they will have a higher grade than a student who studies only computer science.

Solution

  1. $\forall S,\; C(S) \rightarrow M(S)$
  2. $\exists S,\; C(S) \land M(S)$
  3. $\forall S,\; \sim C(S) \rightarrow M(S)$
  4. $\forall S_1,S_2,\; (C(S_1) \land M(S_1) \land C(S_2) \land \sim M(S_2)) \rightarrow G(S_1,S_2)$

Question (5 points)

Consider a scenario where an animal is represented by $A$, and the following predicates are given:

Express the following statements using formal mathematical logic.

  1. All carnivores are not herbivorous.
  2. There exists an animal that is both carnivorous and herbivorous.
  3. Any animal that is not carnivorous is herbivorous or flying.
  4. If an animal is both carnivorous and flying, it is larger than an animal that is herbivorous but not flying.

Solution

  1. $\forall A,\; C(A) \rightarrow \sim H(A)$
  2. $\exists A,\; C(A) \land H(A)$
  3. $\forall A,\; \sim C(A) \rightarrow (H(A) \lor F(A))$
  4. $\forall A_1,A_2,\; (C(A_1) \land F(A_1) \land H(A_2) \land \sim F(A_2)) \rightarrow L(A_1,A_2)$

Question (5 points)

Determine whether the following statements are true. Assume that $\mathbb{Q}$ and $\mathbb{I}$ are the sets of rational and irrational numbers, respectively.

  1. $\forall x,y \in \mathbb{Z},\; xy \in \mathbb{Z}$
  2. $\forall x \in \mathbb{Z},\; \exists y \in \mathbb{Z},\; x > y$
  3. $\forall x,y \in \mathbb{Z},\; x/y \in \mathbb{Q}$
  4. $\forall x,y \in \mathbb{I},\; x + y \in \mathbb{I}$
  5. $\forall x,y \in \mathbb{Z},\; |x+y| \le |x| + |y|$

Solution

  1. True. Integers are closed under multiplication.
  2. True. There always exists a smaller integer.
  3. False. Suppose $y=0$.
  4. False. $\sqrt{2} + (-\sqrt{2}) = 0$.
  5. True. This is the triangle inequality.

Proof Techniques

Question (5 points)

Prove that the sum of any two integers with the same parity (either both even or both odd) results in an even number.

Solution

Proof by division into cases

Case 1: Both integers are even.
Let $a$ and $b$ be two even integers. Then

\begin{align*} a + b &= 2m + 2n && \text{(defn. of even, } a = 2m, b = 2n\text{)}\\ &= 2(m + n) && \text{(factor out 2)}\\ &= 2p && \text{(}p = m + n \text{ and addition is closed on integers)}\\ &= \text{even} && \text{(defn. of even)} \end{align*}

Case 2: Both integers are odd.
Let $a$ and $b$ be two odd integers. Then

\begin{align*} a + b &= (2m + 1) + (2n + 1) && \text{(defn. of odd, } a = 2m + 1, b = 2n + 1\text{)}\\ &= 2m + 2n + 2 && \text{(simplify the terms)}\\ &= 2(m + n + 1) && \text{(factor out 2)}\\ &= 2p && \text{(}p = m + n + 1 \text{ and addition is closed on integers)}\\ &= \text{even} && \text{(defn. of even)} \end{align*}

Question (5 points)

Prove that if $n^{100}$ is odd, then $n$ is odd.

Solution

Proof by contrapositive.

Contrapositive: If $n$ is even, then $n^{100}$ is even.

Proof: Assume $n$ is even. Then $n = 2k$ for some integer $k$. Now, consider $n^{100}$:

\begin{align*} n^{100} &= (2k)^{100} && \text{(since } n = 2k\text{)}\\ &= 2^{100} k^{100} && \text{(simplify the expression)} \end{align*}

Since $2^{100}$ is a power of 2, it is clearly divisible by 2, so $n^{100}$ is even.
Thus, by contrapositive, if $n^{100}$ is odd, then $n$ must be odd. This completes the proof.

Question (5 points)

Prove that the sum of any two prime numbers greater than 2 is always even.

Solution

Let $p_1$ and $p_2$ be prime numbers greater than 2. Then

\begin{align*} p_1 &= 2k_1 + 1 \text{ and } p_2 = 2k_2 + 1 && \text{(defn. of odd, since primes greater than 2 are odd)}\\ p_1 + p_2 &= (2k_1 + 1) + (2k_2 + 1)\\ &= 2k_1 + 2k_2 + 2 && \text{(simplifying the terms)}\\ &= 2(k_1 + k_2 + 1) && \text{(factor out 2)}\\ &= 2k_3 && \text{(where } k_3 = k_1 + k_2 + 1\text{)}\\ &= \text{even} && \text{(defn. of even)} \end{align*}

Question (5 points)

Prove the following statement using two different methods: (1) by contrapositive and (2) by contradiction.

"If the product of two integers is odd, then both integers must be odd."

Solution

Proof 1: Contrapositive
Contrapositive: If at least one integer is even, their product is even.

Assume at least one integer is even. Let $a = 2k$ for some integer $k$.

\begin{align*} a \times b &= (2k) \times b && \text{(defn. of even, } a = 2k\text{)}\\ &= 2(k \times b) && \text{(factor out 2)}\\ &= 2m && \text{(where } m = k \times b\text{)}\\ &= \text{even} && \text{(defn. of even)} \end{align*}

Thus, if at least one integer is even, their product is even.
By contrapositive, if $a \times b$ is odd, both integers are odd.

Proof 2: Contradiction
Negation: The product of two integers is odd and one of the two integers is even.
Let $a$ and $b$ be two integers.
Assume $a \times b$ is odd, but one integer is even.
Let $a = 2k$ for some integer $k$. Then

\begin{align*} a \times b &= (2k) \times b && \text{(defn. of even, } a = 2k\text{)}\\ &= 2(k \times b) && \text{(factor out 2)}\\ &= 2m && \text{(where } m = k \times b\text{)}\\ &= \text{even} && \text{(defn. of even)} \end{align*}

Contradiction. Thus, both integers must be odd.

Question (5 points)

Prove that if $a$ and $b$ are integers such that $a \mid b$ and $b \mid c$, then $a \mid c$.

Solution

Direct proof

Given $a \mid b$ and $b \mid c$, there exist integers $k_1$ and $k_2$ such that:

\begin{align*} b &= a \times k_1 && \text{(defn. of } a \mid b\text{)}\\ c &= b \times k_2 && \text{(defn. of } b \mid c\text{)} \end{align*}

Substitute $b = a \times k_1$ into $c = b \times k_2$ to get:

\begin{align*} c &= (a \times k_1) \times k_2\\ &= a \times (k_1 \times k_2) && \text{(associativity of multiplication)}\\ &= a \times k_3 && \text{(Let } k_3 = k_1 \times k_2 \text{ and } k_3 \text{ is an integer because mult. is closed on integers)} \end{align*}

Therefore, $a \mid c$.

Question (5 points)

Given two nonnegative numbers $a$ and $b$, the arithmetic mean is defined as $(a + b) / 2$ and the geometric mean is defined as $\sqrt{ab}$. Prove or disprove: For all nonnegative real numbers $a$ and $b$, the arithmetic mean of the two numbers is never smaller than the geometric mean.

Solution

Direct proof.

We prove that for all nonnegative real numbers $a$ and $b$, \[\frac{a+b}{2} \ge \sqrt{ab}.\] Since $a,b \ge 0$, the expression $(\sqrt{a} - \sqrt{b})^2$ is well-defined and nonnegative. Thus, \[(\sqrt{a} - \sqrt{b})^2 \ge 0.\] We have \begin{align*} &(\sqrt{a} - \sqrt{b})^2 \ge 0\\ &\implies a - 2\sqrt{ab} + b \ge 0 && \text{(expand)}\\ &\implies a + b \ge 2\sqrt{ab} && \text{(rewrite)}\\ &\implies \frac{a+b}{2} \ge \sqrt{ab} && \text{(divide by 2)} \end{align*} Therefore, the arithmetic mean of two nonnegative real numbers is never smaller than the geometric mean.

Proof by contradiction.

Negation: Suppose, for the sake of contradiction, that there exist nonnegative real numbers $a$ and $b$ such that \[ \frac{a+b}{2} < \sqrt{ab}. \] Then, \begin{align*} &\frac{a+b}{2} < \sqrt{ab} && \text{(supposition of negation)}\\ &\implies a + b < 2\sqrt{ab} && \text{(multiply by 2)}\\ &\implies a + b - 2\sqrt{ab} < 0 && \text{(rewrite)}\\ &\implies (\sqrt{a} - \sqrt{b})^2 < 0 && \text{(simplify)} \end{align*} However, for all real numbers, a square is always nonnegative, so \[ (\sqrt{a} - \sqrt{b})^2 \ge 0, \] which is a contradiction. Therefore, our assumption is false, and it must be that \[ \frac{a+b}{2} \ge \sqrt{ab} \] for all nonnegative real numbers $a$ and $b$.

Question (5 points)

Consider the following statements. For each statement, either prove it or provide a counterexample.

  1. (2 points) The product of two irrational numbers is always irrational.
  2. (3 points) The sum of two positive irrational numbers is always irrational.

Solution

  1. False.
    Consider $\sqrt{2} \cdot \sqrt{2} = 2$.
    $\sqrt{2}$ is irrational but the product $2$ is rational.
  2. False.
    Consider $\sqrt{2} + (2 - \sqrt{2}) = 2$.
    $\sqrt{2}$ and $2 - \sqrt{2}$ are positive irrational numbers but their sum $2$ is rational

Sequences

Question (5 points)

Prove by induction that the following statement is true for all integers $n \ge 1$:

$$ \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} $$

Solution

Let $P(n): \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}$.

Base case: For $n=1$,

$P(1): \sum_{i=1}^{1} i^2 = 1 = \frac{1 \times 2 \times 3}{6}$

Thus, the base case holds.

Inductive step: Assume $P(k)$ is true for some $k \ge 1$. We need to prove $P(k+1)$:

LHS of $P(k+1)$:

\begin{align*} &= \sum_{i=1}^{k+1} i^2 = \sum_{i=1}^{k} i^2 + (k+1)^2 && \text{(by definition of summation)}\\ &= \frac{k(k+1)(2k+1)}{6} + (k+1)^2 && \text{(since } P(k) \text{ is assumed to be true)}\\ &= \frac{(k+1)(2k^2 + 7k + 6)}{6} && \text{(simplify and combine terms)}\\ &= \frac{(k+1)(k+2)(2k+3)}{6} && \text{(factor the expression)}\\ &= \text{RHS of } P(k+1) \end{align*}

Thus, the inductive step holds.

Therefore, by mathematical induction, $P(n)$ is true for all $n \ge 1$.

Question (5 points)

Prove by induction that

$$ \prod_{i=1}^{n} 2i = 2^n \cdot n! $$

for all $n \in \mathbb{N}$.

Solution

Let $P(n): \prod_{i=1}^{n} 2i = 2^n \cdot n!$.

Base case: For $n=1$, the left-hand side is:

$2 = 2^1 \cdot 1! = 2$

Thus, $P(1)$ holds.

Inductive step: Assume $P(k)$ is true for some $k \ge 1$. We must prove $P(k+1)$:

LHS of $P(k+1)$:

\begin{align*} &= \left(\prod_{i=1}^{k} 2i\right) \cdot 2(k+1) && \text{(by definition of product)}\\ &= \big(2^k \cdot k!\big) \cdot 2(k+1) && \text{(by inductive hypothesis)}\\ &= 2^{k+1} \cdot (k+1)! && \text{(simplify)}\\ &= \text{RHS of } P(k+1) \end{align*}

Thus, the inductive step holds.

Therefore, by mathematical induction, $P(n)$ holds for all $n \in \mathbb{N}$.

Question (5 points)

Prove by induction that if

$$ a_n = \frac{a_{n-1} \cdot a_{n-2}}{a_{n-1} + a_{n-2}}, $$

with initial conditions $a_1 = 2$ and $a_2 = 1$, then for all $n \in \mathbb{N}$,

$$ a_n \leq \frac{2}{n}. $$

Solution

Let $P(n): a_n \leq \frac{2}{n}$. We will prove $P(n)$ by induction for all $n \in \mathbb{N}$.

Base case:
For $n=1$, $a_1 = 2 \leq \frac{2}{1}$. (True)
For $n=2$, $a_2 = 1 \leq \frac{2}{2}$. (True)

Thus, $P(1)$ and $P(2)$ hold.

Inductive step: Assume $P(i)$ holds true for all $i \in [1,k]$ for some $k \ge 2$. We need to show that $P(k+1)$ holds.

LHS of $P(k+1)$:

\begin{align*} &= a_{k+1}\\ &= \frac{a_k \cdot a_{k-1}}{a_k + a_{k-1}} && \text{(from the recurrence relation)}\\ &\le \frac{\frac{2}{k} \cdot \frac{2}{k-1}}{\frac{2}{k} + \frac{2}{k-1}} && \text{(}P(k): a_k \le \frac{2}{k}\text{ and } P(k-1): a_{k-1} \le \frac{2}{k-1} \text{ are true)}\\ &= \frac{\frac{4}{k(k-1)}}{\frac{2k + 2(k-1)}{k(k-1)}} = \frac{4}{4k-2} = \frac{2}{2k-1} && \text{(simplify)}\\ & \le \frac{2}{k+1} && \text{($2k-1 \ge k+1$ for $k \ge 2$)}\\ &= \text{RHS of } P(k+1) \end{align*}

Therefore, $a_{k+1} \leq \frac{2}{k+1}$, and $P(k+1)$ holds.

By induction, $P(n)$ is true for all $n \in \mathbb{N}$. Therefore, $a_n \leq \frac{2}{n}$ for all $n \in \mathbb{N}$.

Question (5 points)

Prove by induction that if

$$ a_n = \sqrt{a_{n-3} + a_{n-2} + a_{n-1}} \qquad \text{for all $n \ge 4$} $$

and $a_1 = 0$, $a_2 = 1$, $a_3 = 2$, then for all $n \in \mathbb{N}$, $a_n < 3$.

Solution

Let $P(n): a_n < 3$. We will prove $P(n)$ by induction for all $n \in \mathbb{N}$.

Base cases
For $n=1$, $a_1 = 0 < 3$.
For $n=2$, $a_2 = 1 < 3$.
For $n=3$, $a_3 = 2 < 3$.

Thus, $P(1)$, $P(2)$, and $P(3)$ hold.

Inductive step: Assume $P(i)$ holds true for all $i \in [1,k]$ for some $k \ge 3$. We need to show that $P(k+1)$ holds.

LHS of $P(k+1)$:

\begin{align*} &= a_{k+1}\\ &= \sqrt{a_{k-2} + a_{k-1} + a_{k}} && \text{(from the recurrence relation)}\\ &< \sqrt{3 + 3 + 3} && \text{(}P(k): a_k < 3\text{, } P(k-1): a_{k-1} < 3\text{, } P(k-2): a_{k-2} < 3 \text{ are true)}\\ &= \sqrt{9} = 3\\ &= \text{RHS of } P(k+1) \end{align*}

Therefore, $a_{k+1} < 3$, and $P(k+1)$ holds.

By induction, $P(n)$ is true for all $n \in \mathbb{N}$. Therefore, $a_n < 3$ for all $n \in \mathbb{N}$.

Sets

Question (5 points)

Prove that if $A \subseteq B$, then $A - B = \emptyset$.

Solution

Proof by contradiction.

Negation: Suppose that $A \subseteq B$ and $A-B$ is not an empty set.

Suppose $x \in A - B$.

\begin{align*} \implies &\; x \in A \text{ and } x \notin B && \text{(by definition of set difference)}\\ \implies &\; x \in B && \text{(since } A \subseteq B\text{)} \end{align*}

Contradiction since $x \in B$ and $x \notin B$.

Hence, the negation is false and the original statement is true.

Question (5 points)

Prove that if $A \cup B = U$ and $A \cap B = \emptyset$, then $(A \cup C) \cap (B \cup C) = C$.

Solution

We will prove $(A \cup C) \cap (B \cup C) = C$ in two parts.

Part 1: $(A \cup C) \cap (B \cup C) \subseteq C$.

Let $x \in (A \cup C) \cap (B \cup C)$.

\begin{align*} \implies &\; x \in A \cup C \text{ and } x \in B \cup C && \text{(by definition of intersection)}\\ \implies &\; (x \in A \text{ or } x \in C) \text{ and } (x \in B \text{ or } x \in C) && \text{(by definition of union)}\\ \implies &\; \big((x \in A \text{ and } x \in B) \text{ or } x \in C\big) && \text{(by distributive law)}\\ \implies &\; x \in C && \text{(since } A \cap B = \emptyset\text{, so } x \notin A \text{ and } x \notin B\text{)} \end{align*}

Therefore, $(A \cup C) \cap (B \cup C) \subseteq C$.

Part 2: $C \subseteq (A \cup C) \cap (B \cup C)$.

Let $x \in C$.

\begin{align*} \implies &\; x \in A \cup C \text{ and } x \in B \cup C && \text{(by definition of union)}\\ \implies &\; x \in (A \cup C) \cap (B \cup C) \end{align*}

Therefore, $C \subseteq (A \cup C) \cap (B \cup C)$

Since both inclusions hold, we conclude that $(A \cup C) \cap (B \cup C) = C$.

Functions

Question (5 points)

Let $f: \mathbb{Z}^{+} \to \mathbb{O}^{+}$, where $\mathbb{O}^{+}$ represents the set of positive odd numbers, be defined as $f(x) = 2x - 1$. Prove that $f$ is a one-to-one correspondence.

Solution

To prove that $f$ is a one-to-one correspondence, we need to show that $f$ is both one-to-one and onto.

1. One-to-One:
A function $f$ is one-to-one $\forall a, b \in \mathbb{Z}^+$ if $f(a)=f(b)$ then $a=b$.

$$ \text{Suppose } f(a)=f(b). \text{ Then, } 2a-1 = 2b-1. $$

Simplifying:

$$ 2a = 2b \implies a = b \implies f\text{ is one-to-one}. $$

2. Onto:
A function $f$ is onto if, for every $y \in \mathbb{O}^{+}$, there exists an $x \in \mathbb{Z}^{+}$ such that $f(x)=y$.
Let $y \in \mathbb{O}^{+}$. Since $\mathbb{O}^{+}=\{1,3,5,7,\dots\}$, we can write $y = 2x-1$. Solving for $x$:

$$ x = \frac{y+1}{2}. $$

Since $y$ is odd, $y+1$ is even, and $\frac{y+1}{2} \in \mathbb{Z}^{+}$. Hence, $f(x)=y$, proving $f$ is onto.

Conclusion:
Since $f$ is both one-to-one and onto, $f$ is a one-to-one correspondence.

Question (5 points)

Consider $f: \mathbb{R}^* \rightarrow \mathbb{R}^*$, where $\mathbb{R}^* = \mathbb{R}^+ \cup \{0\}$ is the set of all nonnegative real numbers, such that $f$ is a mapping from pounds to kilograms. A kilogram of mass in the International System of Units (SI) represents 2.2046226218 pounds. Is $f$ a one-to-one correspondence? If yes, give a formal proof.

Solution

Given that $1 \text{ kilogram} = 2.2046226218 \text{ pounds}$, we can express the function $f$ as:

$$ f(x) = \frac{x}{2.2046226218} $$

where $x$ is the mass in pounds. The function maps from the set of nonnegative real numbers (including zero) to the set of nonnegative real numbers. Since $2.2046226218 > 0$, for any $x \ge 0$, $f(x)$ will also be nonnegative. Therefore, $f(x) \in \mathbb{R}^*$ for all $x \in \mathbb{R}^*$. Thus, $f$ is well-defined.

1. One-to-One:

To show that $f$ is injective, we need to prove that if $f(x_1)=f(x_2)$, then $x_1=x_2$.

Assume $f(x_1)=f(x_2)$:

$$ \frac{x_1}{2.2046226218} = \frac{x_2}{2.2046226218} $$

Multiplying both sides by $2.2046226218$ (which is positive and does not change the equality) gives:

$$ x_1 = x_2 $$

Thus, $f$ is injective.

2. Onto:

To show that $f$ is surjective, we need to prove that for every $y \in \mathbb{R}^*$, there exists an $x \in \mathbb{R}^*$ such that $f(x)=y$.

Let $y$ be any nonnegative real number. We want to find $x$ such that:

$$ f(x)=y \implies \frac{x}{2.2046226218}=y $$

Solving for $x$ gives:

$$ x = 2.2046226218y $$

Since $y \ge 0$, it follows that $x = 2.2046226218y \ge 0$. Therefore, for every $y \in \mathbb{R}^*$, we can find an $x \in \mathbb{R}^*$ such that $f(x)=y$. Thus, $f$ is surjective.

Conclusion:

Since $f$ is both injective and surjective, we conclude that $f$ is a one-to-one correspondence (bijection) from $\mathbb{R}^*$ to $\mathbb{R}^*$. Thus, the function $f$ is a one-to-one correspondence.

Question (5 points)

Which of the two sets is bigger (i.e., has a larger size): the set of whole numbers i.e., $\{ 0, 1, 2, 3, 4, \ldots \}$ or the set of all odd integers (including the negative odd integers)? If the sets have different sizes, prove using the diagonalization method. If the sets have the same size, come up with a one-to-one correspondence function from the set of whole numbers to the set of odd integers and draw an arrow diagram. It is not necessary to show a formal proof that the function is a one-to-one correspondence.

Solution

Both sets have the same size.

Step 1: Create a one-to-one-correspondence

The one-to-one correspondence function $f : \mathbb{W} \rightarrow \mathbb{Z}$ is as follows: \begin{align*} f(n) = \left. \begin{cases} n+1 & \text{if $n$ is even},\\ -n & \text{if $n$ is odd}. \end{cases} \right\} \end{align*}

This maps even whole numbers to positive odd integers and odd whole numbers to odd whole numbers, ensuring that every odd integer appears exactly once.

Step 2: Diagram of the Function

$$ \begin{array}{c|c} n & f(n) \\ \hline 0 & 1\\ 1 & -1\\ 2 & 3\\ 3 & -3\\ 4 & 5\\ 5 & -5\\ 6 & 7\\ 7 & -7\\ \vdots & \vdots \end{array} $$

Question (10 points)

Fill the table with ✓ or ✗. If a function is one-to-one or onto, then use ✓. On the other hand, if a function is not one-to-one or not onto, then use ✗.

Function Sets One-to-one function? Onto function?
$f(x) = x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = x^2$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x^2$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = x^3$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x^3$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = 2^x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = 2^x$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = 3^x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = 3^x$ $f:\mathbb{R} \rightarrow \mathbb{R}$

Solution

Function Sets One-to-one function? Onto function?
$f(x) = x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = x^2$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x^2$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = x^3$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = x^3$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = 2^x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = 2^x$ $f:\mathbb{R} \rightarrow \mathbb{R}$
$f(x) = 3^x$ $f:\mathbb{Z} \rightarrow \mathbb{Z}$
$f(x) = 3^x$ $f:\mathbb{R} \rightarrow \mathbb{R}$

Question (5 points)

Consider the set of numbers of the form $k^2$ or $2^k$, where $k \in \mathbb{N}$. Prove that the set is countable by coming up with a one-to-one correspondence function and showing the arrow diagram.

Solution

To prove that the set consisting of numbers of the form $k^2$ or $2^k$, where $k \in \mathbb{N}$, is countable, we will first define the set clearly and then establish a one-to-one correspondence function.

Step 1: Define the Set
Let $S$ be the set defined as follows:

$$ S = \{ k^2 \mid k \in \mathbb{N} \} \cup \{ 2^k \mid k \in \mathbb{N} \} $$

This means that $S$ contains all perfect squares and all powers of 2, where $k$ is a natural number.

Step 2: List the Set Elements
Perfect Squares: The elements of the form $k^2$ for $k = 1,2,3,\ldots$ are:
$1^2 = 1, 2^2 = 4, 3^2 = 9, 4^2 = 16, 5^2 = 25, 6^2 = 36, 7^2 = 49, 8^2 = 64, 9^2 = 81, \ldots$

Powers of 2: The elements of the form $2^k$ for $k=1,2,3,\ldots$ are:
$2^1 = 2, 2^2 = 4, 2^3 = 8, 2^4 = 16, 2^5 = 32, 2^6 = 64, 2^7 = 128, 2^8 = 256, \ldots$

Common elements:
$4$ appears as $2^2$ and $2^2$.
$16$ appears as $4^2$ and $2^4$.
$64$ appears as $8^2$ and $2^6$.
so on...

So, essentially, we will need to eliminate all numbers of the form $2^{\text{even}}$ to avoid double-counting.

Step 3: Create a One-to-One Correspondence
To show that the set $S$ is countable, we can create a function that maps each natural number $k$ to a unique element in $S$.

Define a function $f: \mathbb{N} \to S$ as follows:

$$ f(n)= \left. \begin{cases} 2^n & \text{if } n \text{ is odd},\\ (n/2)^2 & \text{if } n \text{ is even}. \end{cases} \right\} $$

Step 4: Diagram of the Function

$$ \begin{array}{c|c} n & f(n) \\ \hline 1 & 2^{1}\\ 2 & 1^2\\ 3 & 2^{3}\\ 4 & 2^2\\ 5 & 2^{5}\\ 6 & 3^2\\ 7 & 2^{7}\\ 8 & 4^2\\ \vdots & \vdots \end{array} $$

Relations

Question (10 points)

Consider finite sets $A$ and $B$ such that $|A|=m, |B| = n$.

  1. How are $|A\cup B|$ and $|A\cap B|$ related to each other?
  2. What is $|\mathcal{P}(A \times B)|$?
  3. How many relations $R: A\to B$ exist?
  4. How many functions $f:A\to B$ exist?
  5. How many one-to-one functions $f:A\to B$ exist?
  6. How many one-to-one correspondences functions $f:A \to B$ exist?

Solution

  1. $|A\cup B| = |A| + |B| - |A\cap B| = m + n - |A\cap B|$
  2. $2^{mn}$
    ($|A \times B| = mn$. The number of subsets of $mn$ elements is $2^{mn}$.)
  3. $2^{mn}$
    (Total number of binary relations from $A$ to $B$ is the total number of subsets of $A \times B$)
  4. $n^{m}$
    (First input element can be mapped to any of $n$ output elements, so on till the $m$th input element)
  5. $$ \left. \begin{cases} 0 & \text{if } m > n,\\ n \times (n-1) \times (n-2) \times \cdots \times (n-m+1) & \text{if } m \le n. \end{cases} \right\} $$ (First input element can be mapped to any of $n$ output elements, second input element can be mapped to any of remaining $(n-1)$ output elements, so on till the $m$th input element can be mapped to any of $(n-m+1)$ output elements)
  6. $$ \left. \begin{cases} 0 & \text{if } m \ne n,\\ m! & \text{if } m = n. \end{cases} \right\} $$ (First input element can be mapped to any of $m$ output elements, second input element can be mapped to any of remaining $(m-1)$ output elements, so on till the $m$th input element can be mapped to the only remaining $1$ output element)

Question (5 points)

Let $R$ be a relation on the set of integers $\mathbb{Z}$ defined by $a\,R\,b$ if and only if $a-b$ is divisible by 3. Check if $R$ is an equivalence relation and describe the equivalence classes of $R$ if it is.

Solution

1. Reflexive:
For any $a \in \mathbb{Z}$, $a-a=0$ is divisible by 3. Hence, $a\,R\,a$ holds.

2. Symmetric:
If $a\,R\,b$, then $a-b=3k$ for some $k\in\mathbb{Z}$.
Thus, $b-a=-3k$, which is divisible by 3. Hence, $b\,R\,a$ holds.

3. Transitive:
If $a\,R\,b$ and $b\,R\,c$, then $a-b=3k$ and $b-c=3m$ for some $k,m\in\mathbb{Z}$.
Adding these gives $a-c=3(k+m)$, which is divisible by 3. Hence, $a\,R\,c$.

4. Equivalence Classes:
The equivalence classes are the sets of integers that leave a remainder of $0$, $1$, and $2$ when divided by $3$, as shown below:

$$ [0] = \{\dots, -3, 0, 3, 6, \dots\}, \quad [1] = \{\dots, -2, 1, 4, 7, \dots\}, \quad [2] = \{\dots, -1, 2, 5, 8, \dots\}. $$

Question (5 points)

Let $R$ be a relation on the set of all strings over the alphabet $\{a,b\}$ defined by $x\,R\,y$ if and only if $x$ and $y$ have the same length. Check if $R$ is an equivalence relation and describe the equivalence classes of $R$ if it is.

Solution

1. Reflexive:
For any string $x$, we have $|x|=|x|$, so $x\,R\,x$ holds.

2. Symmetric:
If $x\,R\,y$, then $|x|=|y|$.
Thus, $|y|=|x|$, so $y\,R\,x$ holds.

3. Transitive:
If $x\,R\,y$ and $y\,R\,z$, then $|x|=|y|$ and $|y|=|z|$.
Thus, $|x|=|z|$, so $x\,R\,z$ holds.

4. Equivalence Classes:
The equivalence classes are the sets of strings with the same length.
For any non-negative integer $n$, the equivalence class of strings of length $n$ is:

$$ [n] = \{ x \mid x \text{ is a string over } \{a,b\} \text{ with length } n \} $$

Question (5 points)

Let $R$ be a relation on $\mathbb{R}$ defined by $a\,R\,b$ if and only if $a^2=b^2$. Check if $R$ is an equivalence relation and describe the equivalence classes of $R$ if it is.

Solution

1. Reflexive:
For any $a\in\mathbb{R}$, we have $a^2=a^2$, so $a\,R\,a$ holds.

2. Symmetric:
If $a\,R\,b$, then $a^2=b^2$.
Thus, $b^2=a^2$, so $b\,R\,a$ holds.

3. Transitive:
If $a\,R\,b$ and $b\,R\,c$, then $a^2=b^2$ and $b^2=c^2$.
Thus, $a^2=c^2$, so $a\,R\,c$ holds.

4. Equivalence Classes:
The equivalence classes are the sets of real numbers with the same absolute value.
For any non-negative real number $r$, the equivalence class of $r$ is:

$$ [r] = \{ x \in \mathbb{R} \mid |x| = r \} = \{-r, r\} \quad \text{(if } r \neq 0\text{), and } [0]=\{0\}. $$

Question (5 points)

Let $R$ be a relation on the set of all people, where $a\,R\,b$ if and only if $a$ and $b$ have the same birth year. Check if $R$ is an equivalence relation and describe the equivalence classes of $R$ if it is.

Solution

1. Reflexive:
For any person $a$, the relation holds because $a$ has the same birth year as $a$.
Thus, $a\,R\,a$ holds.

2. Symmetric:
If $a\,R\,b$, then $a$ and $b$ have the same birth year.
Since having the same birth year is a mutual property, $b\,R\,a$ also holds.

3. Transitive:
If $a\,R\,b$ and $b\,R\,c$, then $a$ and $b$ have the same year, and $b$ and $c$ have the same year.
Thus, $a$ and $c$ must also have the same birth year, so $a\,R\,c$ holds.

4. Equivalence Classes:
The equivalence classes of $R$ are the sets of people born in the same year.
For any year $y$, the equivalence class of people born in year $y$ is:

$$ [y] = \{ a \mid \text{person } a \text{ is born in year } y \}. $$

Question (5 points)

Let $R$ be a relation on the set of all points in the plane $\mathbb{R}^2$ defined by $(x_1,y_1)\,R\,(x_2,y_2)$ if and only if $x_1=x_2$ or $y_1=y_2$. Check if $R$ is an equivalence relation and describe the equivalence classes of $R$ if it is.

Solution

1. Reflexive:
For any point $(x_1,y_1)$, we have $(x_1,y_1)\,R\,(x_1,y_1)$ since $x_1=x_1$ and $y_1=y_1$.
Thus, the relation is reflexive.

2. Symmetric:
If $(x_1,y_1)\,R\,(x_2,y_2)$, then either $x_1=x_2$ or $y_1=y_2$.
If $x_1=x_2$, then clearly $x_2=x_1$.
If $y_1=y_2$, then clearly $y_2=y_1$.
Thus, the relation is symmetric.

3. Not Transitive:
Consider $(1,1), (1,2), (2,2)$. $(1,1)R(1,2)$, $(1,2)R(2,2)$, but $(1,1)\bar{R}(2,2)$. Therefore, not transitive.

This is NOT an equivalence relation.

Question (5 points)

Find the units digit of $7^{100}$.

Solution

To find the units digit of $7^{100}$, observe the pattern of the units digits of powers of $7$:

$$ \begin{aligned} 7^1 &= 7 \quad (\text{units digit } 7), \\ 7^2 &= 49 \quad (\text{units digit } 9), \\ 7^3 &= 343 \quad (\text{units digit } 3), \\ 7^4 &= 2401 \quad (\text{units digit } 1). \end{aligned} $$

The units digits repeat in a cycle of 4: $7,9,3,1$. To find the units digit of $7^{100}$, divide 100 by 4:

$$ 100 \div 4 = 25 \quad \text{remainder } 0. $$

Since the remainder is 0, the units digit of $7^{100}$ corresponds to the units digit of $7^4$, which is 1.
Thus, the units digit of $7^{100}$ is $\boxed{1}$.

Question (5 points)

Find the units digit of $3^{50}$.

Solution

To find the units digit of $3^{50}$, observe the pattern of the units digits of powers of $3$:

$$ \begin{aligned} 3^1 &= 3 \quad (\text{units digit } 3), \\ 3^2 &= 9 \quad (\text{units digit } 9), \\ 3^3 &= 27 \quad (\text{units digit } 7), \\ 3^4 &= 81 \quad (\text{units digit } 1). \end{aligned} $$

The units digits repeat in a cycle of 4: $3,9,7,1$. To find the units digit of $3^{50}$, divide 50 by 4:

$$ 50 \div 4 = 12 \quad \text{remainder } 2. $$

Since the remainder is 2, the units digit of $3^{50}$ corresponds to the units digit of $3^2$, which is 9.
Thus, the units digit of $3^{50}$ is $\boxed{9}$.

Question (5 points)

Find the units digit of $12^{1234}$.

Solution

To find the units digit of $12^{1234}$, observe the pattern of the units digits of powers of $12$. The units digits of powers of $12$ follow the same pattern as powers of $2$:

$$ \begin{aligned} 12^1 &= 12 \quad (\text{units digit } 2), \\ 12^2 &= 144 \quad (\text{units digit } 4), \\ 12^3 &= 1728 \quad (\text{units digit } 8), \\ 12^4 &= 20736 \quad (\text{units digit } 6). \end{aligned} $$

The units digits repeat in a cycle of 4: $2,4,8,6$. To find the units digit of $12^{1234}$, divide 1234 by 4:

$$ 1234 \div 4 = 308 \quad \text{remainder } 2. $$

Since the remainder is 2, the units digit of $12^{1234}$ corresponds to the units digit of $12^2$, which is 4.
Thus, the units digit of $12^{1234}$ is $\boxed{4}$.

Question (5 points)

Find the units digit of $2^{987}$.

Solution

To find the units digit of $2^{987}$, observe the pattern of the units digits of powers of $2$:

$$ \begin{aligned} 2^1 &= 2 \quad (\text{units digit } 2), \\ 2^2 &= 4 \quad (\text{units digit } 4), \\ 2^3 &= 8 \quad (\text{units digit } 8), \\ 2^4 &= 16 \quad (\text{units digit } 6). \end{aligned} $$

The units digits repeat in a cycle of 4: $2,4,8,6$. To find the units digit of $2^{987}$, divide 987 by 4:

$$ 987 \div 4 = 246 \quad \text{remainder } 3. $$

Since the remainder is 3, the units digit of $2^{987}$ corresponds to the units digit of $2^3$, which is 8.
Thus, the units digit of $2^{987}$ is $\boxed{8}$.

Question (5 points)

Find the units digit of $9^{999}$.

Solution

To find the units digit of $9^{999}$, observe the pattern of the units digits of powers of $9$:

$$ \begin{aligned} 9^1 &= 9 \quad (\text{units digit } 9), \\ 9^2 &= 81 \quad (\text{units digit } 1). \end{aligned} $$

The units digits repeat in a cycle of 2: $9,1$. To find the units digit of $9^{999}$, divide 999 by 2:

$$ 999 \div 2 = 499 \quad \text{remainder } 1. $$

Since the remainder is 1, the units digit of $9^{999}$ corresponds to the units digit of $9^1$, which is 9.
Thus, the units digit of $9^{999}$ is $\boxed{9}$.