# CS212 Winter2021 In-class exercise ## Lecture 2 **Rational number:** *A rational number $a$ can be written as the ratio $p/q$ where $p, q$ are integers with $q \ge 1$. You can also assume that these integers $p, q$ can be chosen such that they have no common factors.* 1. If $r$ is irrational, then $\sqrt{r}$ is also irrational. *Hint: Think of whether this statement or its contrapositive is easier to argue about* 2. $\sqrt{2}$ is irrational. *Hint: Think of proof by contradiction.* 3. For a positive integer n, prove that $1+3+3^2+\cdots+3^n=\frac{3^{n+1}-1}{2}$. *Hint: Think of proof by mathematical induction.*