Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.74 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%%%%%%%%% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4.  
  5. \documentclass[12pt,letterpaper]{article}
  6.  
  7. \usepackage{amsmath} % Enviornments, etc. for typsetting math.
  8. \usepackage{amsthm} % Theorem/proof enviornments.
  9. \usepackage{amssymb} % Various symbols.
  10. \usepackage{geometry} % Easy interface to set page margins.
  11. \usepackage{fancyhdr} % Custom headers/footers, page styles.
  12. \usepackage[shortlabels]{enumitem} % Stuff for enumerate, itemize environments.
  13. \usepackage{tikz}
  14.  
  15. %%%%%%%%%% VARIOUS HOUSEKEEPING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  16.  
  17. \geometry{margin=3cm} % Sets margins on all sides.
  18. \pagestyle{fancyplain} % Sets page style.
  19. \headheight 35pt % Sets the height of the header.
  20. \headsep 10pt % Sets space between the header and the body.
  21.  
  22. \setlength{\parindent}{0em} % Sets paragraph indentation.
  23. \setlength{\parskip}{0.5em} % Sets space between paragraphs.
  24.  
  25. \setlist[itemize]{leftmargin=*} % Normalize left margin in itemize.
  26. \setlist[enumerate]{leftmargin=*} % Normalize left margin in enumerate.
  27.  
  28. % The answer environment definition.
  29. \newenvironment{answer}[1]{
  30. \subsubsection*{Problem \hwnum.#1}
  31. }
  32.  
  33. %%%%%%%%%% ASSIGNMENT INFORMATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  34.  
  35. % Edit these as appropriate.
  36. \newcommand\course{CS 22}
  37. \newcommand\semester{Spring 2017} % <-- current semester
  38. \newcommand\banner{B01300206} % <-- your banner id
  39. \newcommand\hwnum{3} % <-- homework number
  40.  
  41. %%%%%%%%%% HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  42.  
  43. \lhead{\banner\\\course\ --- \semester}
  44. \chead{\textbf{\Large Homework \hwnum}}
  45. \rhead{\today}
  46.  
  47. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  48. %%%%%%%%%% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  49. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  50.  
  51. \begin{document}
  52. \begin{answer}{1}
  53. Let $S$ be the quaternary string representation of $T$. \\
  54. That is, for each $(X,Y)$ in $T$ represented by $t$, it is related to an $s$ in $S$ such that: \\
  55. $s$ is a base-4 string of length $n$, and the $k$th digit represents whether the $k$th element of $A$ is in $X$ and whether the $k$th element of $A$ is in $Y$. For example: \\
  56. The $k$th digit in $s$ is a 0 iff $X$ does not contain the $k$th element of $A$ and $Y$ does not contain the $k$th element of $A$. \\
  57. The $k$th digit in $s$ is a 1 iff $X$ contains the $k$th element of $A$ and $Y$ does not contain the $k$th element of $A$. \\
  58. The $k$th digit in $s$ is a 2 iff $X$ does not contain the $k$th element of $A$ and $Y$ contains the $k$th element of $A$. \\
  59. The $k$th digit in $s$ is a 3 iff $X$ contains the $k$th element of $A$ and $Y$ contains the $k$th element of $A$. \\
  60. As each digit of $s$ is determined by whether an element is in $X$ and whether it is in $Y$ through if and only if, any $s$ related to a $t$ is related to only that $t$. i.e. the relation between $S$ and $T$ is injective.\\
  61. As each digit of $s$ can only be $0,1,2,3$, each digit represents some combination of whether an element of $A$ is in $X$ and $Y$, so each $s$ of length $n$ represents some combination of whether the $n$ elements of $A$ are in $X$ and $Y$. i.e. the relation between $S$ and $T$ is surjective. \\
  62. As the relation between $S$ and $T$ is injective and surjective, it is a bijective relation. \\
  63. The bijective relation implies that the cardinality of $S$ and $T$ are equal, so the two sets are of equal sizes. \\
  64. \end{answer}
  65.  
  66. \begin{answer}{2}
  67. \begin{enumerate}[a.]
  68. \item
  69. \begin{proof} \hspace{1 mm}
  70. \begin{description}
  71. \item[Base case]: $n = 1$.\\
  72. \begin{align*}
  73. \sum_{i=1}^{1} i^2 &= 1^2 = 1 \\
  74. \frac{1^3}{3} + \frac{1^2}{2} + \frac{1}{6} &=
  75. \frac{1}{3} + \frac{1}{2} + \frac{1}{6} = 1 \\
  76. \sum_{i=1}^{1} i^2 &=
  77. \frac{1^3}{3} + \frac{1^2}{2} + \frac{1}{6} \\
  78. \end{align*}
  79. \item[Inductive step]: Let $k \in \mathbb{Z_+}$.
  80. \begin{align*}
  81. Assume \sum_{i=1}^{k} i^2 &= \frac{k^3}{3} + \frac{k^2}{2} + \frac{k}{6}. \\
  82. 1^2 + 2^2 + \ldots + k^2 &= \frac{k^3}{3} + \frac{k^2}{2} + \frac{k}{6}. \\
  83. 1^2 + 2^2 + \ldots + k^2 + (k+1)^2 &= \frac{k^3}{3} + \frac{k^2}{2} + \frac{k}{6} + (k+1)^2 \\
  84. 1^2 + 2^2 + \ldots + k^2 + (k+1)^2 &= \frac{k^3}{3} + \frac{k^2}{2} + \frac{k}{6} + k^2 + 2k + 1 \\
  85. 1^2 + 2^2 + \ldots + k^2 + (k+1)^2 &= \frac{k^3}{3} + k^2 + k + \frac{1}{3} + \frac{k^2}{2} + k + \frac{1}{2} + \frac{k}{6} + \frac{1}{6} \\
  86. 1^2 + 2^2 + \ldots + k^2 + (k+1)^2 &= \frac{k^3 + 3k^2 + 3k + 1}{3} + \frac{k^2+2k+1}{2} + \frac{k+1}{6} \\
  87. 1^2 + 2^2 + \ldots + k^2 + (k+1)^2 &= \frac{(k+1)^3}{3} + \frac{(k+1)^2}{2} + \frac{k+1}{6} \\
  88. \sum_{i=1}^{k+1} i^2 &= \frac{(k+1)^3}{3} + \frac{(k+1)^2}{2} + \frac{k+1}{6} \\
  89. \end{align*}
  90. \end{description}
  91. By the process of inductive proof, the statement is valid for all $k \in \mathbb{Z_+}$
  92. \end{proof}
  93. \item
  94. The 'victory case' of this game is if only one pile contains one or more spoons. \\
  95. Whoever takes their turn then wins the game by removing all the spoons left. \\
  96. The base case of this game is if the two piles each contain one spoon. \\
  97. Whoever takes their turn then loses the game as they are forced to remove the last spoon from one of the piles, leaving their opponent with the victory case. \\
  98. If either pile has more than one spoon while the other has precisely one, whoever takes their turn then can win by removing all but one spoon from the bigger pile. \\
  99. The game starts with two equal piles of spoons. If the game is not in the base case, and the first player removes some number of spoons from a pile without leaving it empty, the second player removes the same amount of spoons from the other pile so the piles are equal again. \\
  100. If at any point the first player takes all the spoons from one pile, the second player can win. \\
  101. Eventually, as each turn both players take a positive amount of spoons from either pile, the first player will be forced to leave one spoon in either pile, allowing the second player to bring the game to the base case and win. \\
  102. \end{enumerate}
  103. \end{answer}
  104.  
  105. \begin{answer}{3}
  106. \begin{proof}
  107. \begin{description}
  108. \item[Base case]: $n = 1$.\\
  109. $1 = 1 \times 3^0$
  110. \item[Inductive step]: Let $n \in \mathbb{Z_+}$. \\
  111. Assume $n$ can be written as: \\
  112. $a_k 3^k + a_{k-1}3^{k-1} + \ldots +a_1 3^1 + a_0$ where each
  113. $a_i \in \left\{ -1, 0, 1 \right\}.$ \\
  114. If $a_0 = -1$, then $n+1$ can be written as: \\
  115. $a_k 3^k + a_{k-1}3^{k-1} + \ldots +a_1 3^1 + 0$ \\
  116. If $a_0$ = 0, then $n+1$ can be written as: \\
  117. $a_k 3^k + a_{k-1}3^{k-1} + \ldots +a_1 3^1 + 1$ \\
  118. If $a_0$ = 1, then $n+1$ can be written as: \\
  119. $a_k 3^k + a_{k-1}3^{k-1} + \ldots + (a_1 + 1) 3^1 + (-1)$ if $a_1 \not = 1$ \\
  120. If $a_1$ = 1, the 1 is carried up through all of the $a_i$ until either: \\
  121. $a_i \not = 1$, and $n + 1$ can be expressed as \\
  122. $a_k 3^k + a_{k-1}3^{k-1} + \ldots + a_{i+1} 3 ^ {i+1} + (a_i + 1) 3^i + (-1) 3^{i-1} + \ldots + (-1) 3^1 + (-1)$ \\
  123. or $i = k$, in which case $n + 1$ can be expressed as \\
  124. $1 \times a_{k+1} + (-1) 3^k + (-1) 3^{k-1} + \ldots + (-1) 3^1 + (-1)$ \\
  125. In adding 1 to $n$, the ternary representation of $n$ adds 1 to its final term with coefficient $a_i \not = 1$ and subtracts 2 from the coefficients of all following terms, changing them from $1$ to $-1$. \\
  126. As $2(3^0 + 3^1 + \ldots + 3^{i-1}) + 1 = 3^{i}$, the process adds 1 to the representation.
  127. \end{description}
  128. By the process of inductive proof, the statement is valid for all $n \in \mathbb{Z_+}$
  129. \end{proof}
  130. \end{answer}
  131. \begin{answer}{4}
  132. \begin{enumerate}[a.]
  133. \item The resultant function $R_{TSR}$ would be:
  134. \begin{description}
  135. \item[Reflexivity]: \\
  136. Reflexive, because any superset of a reflexive relation is still reflexive. Expanding a reflexive relation without expanding its domain does not affect its reflexivity, since every element in the domain is already related to itself.
  137. \item[Symmetry]: \\
  138. Symmetric, because the transitive closure of a symmetric relation is still symmetric. Any new elements added to make the relation transitive must have its symmetric element added as well. To create a transitive closure, elements $t$ are added to the relation, s.t. if $(a,b) \in R_{SR}$ and $(b,c) \in R_{SR}$, then $t = (b,c)$ is added to the relation if not already in it. But if $(a,b)$ and $(b,c)$ are both in $R_{SR}$, then $(b,a)$ and $(c,b)$ are both in the relation, and $(c,a)$ must be added as well to create the transitive closure.
  139. \item[Transitivity]: \\
  140. Transitive because it is a transitive closure of $R_{SR}$.
  141. \item[Equivalence]: \\
  142. An equivalence relation because it is reflexive, symmetric, and transitive.
  143. \end{description}
  144. \item The resultant function $R_{RST}$ would be:
  145. \begin{description}
  146. \item[Reflexivity]: \\
  147. Reflexive, because it is a reflexive closure of $R_{ST}$.
  148. \item[Symmetry]: \\
  149. Symmetric, because any elements added to a symmetric relation to form a reflexive closure are in the form $(e,e)$ thus symmetric. $R_{ST}$ was a symmetric relation because it is a symmetric closure of $R_T$.
  150. \item[Transitivity]: \\
  151. Either transitive or not. An example of both is provided below. \\ \\
  152. Consider the relation $R$ on $A = \{1,2,3\}$ be defined as the set $\{(1,2), (1,3)\}$. \\
  153. Its transitive closure $R_T$ is still $\{(1,2), (1,3)\}$. \\
  154. The symmetric closure of $R_T$, $R_{ST}$ is $\{(1,2), (1,3), (2,1), (3,1)\}$. \\
  155. The reflexive closure of $R_{ST}$, $R_{RST}$ is $\{(1,2), (1,3), (2,1), (3,1), (1,1), (2,2), (3,3)\}$. \\
  156. $R_{RST}$ is reflexive and symmetric, but it is not transitive. \\
  157. $(2,1)$ and $(1,3)$ are in the relation, but $(2,3)$ is not. \\
  158. \\
  159. Consider the relation $Q$ on $A = \{1,2,3\}$ be defined as the set $\{(1,1)\}$. \\
  160. Its transitive closure $Q_T$ is still $\{(1,1)\}$. \\
  161. The symmetric closure of $Q_T$, $Q_{ST}$ is still $\{(1,1)\}$. \\
  162. The reflexive closure of $Q_{ST}$, $Q_{RST}$ is $\{(1,1), (2,2), (3,3)\}$. \\
  163. $R_{RST}$ is reflexive, symmetric, and transitive.
  164. \item[Equivalence] : \\
  165. Possibly an equivalence relation, but not necessarily as its transitivity is not certain.
  166. \end{description}
  167. \end{enumerate}
  168. \end{answer}
  169. \begin{answer}{5}
  170. \begin{enumerate}[a.]
  171. \item
  172. \begin{proof}
  173. Assume for any integer $n$, $n^{2} -2$ is divisible by $4$. \\
  174. i.e. $n^2 - 2$ can be written in the form $4k$, where $k \in \mathbb{Z}$. \\
  175. $n^2 = 4k + 2$ \\
  176. $n^2$ is divisible by 2, as $4k + 2$ is divisible by 2. \\
  177. Therefore, as shown in class, $n$ cannot be odd as $n^2$ is not odd. \\
  178. If $n$ is even, it can be written in the form $2j$, where $j \in \mathbb{Z}$. \\
  179. $n^2 = 4j^2$. \\
  180. $4j^2 = 4k + 2$, which cannot be true when $j,k \in \mathbb{Z}$. \\
  181. Therefore $n$ is neither even nor odd, therefore $n^2 - 2$ is not divisible by 4. \\
  182. \end{proof}
  183. \item
  184. \begin{proof}
  185. If $n$ is odd, then $n \times n$ is odd. \\
  186. If $n \times n$ is odd, then $(n \times n) \times n = n^3$ is odd. \\
  187. If $n^3$ is odd, then $n^3 \div n = n^2$ is odd. \\
  188. If $n^2$ is odd, then $n^2 \div n = n$ is odd. \\
  189. \end{proof}
  190. \item
  191. \begin{proof} For any integer $n$, $n^3 - n$ can be written in the form: \\
  192. $n \times (n+1) \times (n-1)$ \\
  193. One of $n, n+1, n-1$ must be divisible by 3 because: \\
  194. If $n$ is not divisible by 3, its remainder when dividing by 3 must be either 1 or 2. \\
  195. If the remainder when $n \div 3$ is equal to 1, then $n-1$ is divisible by 3. \\
  196. If the remainder when $n \div 3$ is equal to 2, then $n+1$ is divisible by 3. \\
  197. The product of any number divisible by 3 is divisible by 3. \\
  198. $n \times (n + 1) \times (n - 1)$ is divisible by 3. \\
  199. $n^3 - n$ is divisible by 3. \\
  200. \end{proof}
  201. \end{enumerate}
  202. \end{answer}
  203. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement