Skip to content

Commit

Permalink
added lab 1 problems on sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
M1chaelM committed Apr 6, 2020
1 parent 8be4e1a commit a4149a2
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions labs/lab1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,48 @@ \section*{Warm up}
No.
\end{solution}

\section*{Sequences}
\question
Give a function definition corresponding to each of the following sequences. Include the domain and codomain in your definition.

\begin{parts}
\part $(2,4,3,5)$
\begin{solution}
$f: \{0,1,2,3\} \to \{2,3,4,5\}$ where $f = \{(0,2),(1,4),(2,3),(3,5)\}$\\

or\\

$f: \{0,1,2,3\} \to \{2,3,4,5\}$ where $f(n) = n + 1 + ((n + 1) \mod 3) $
\end{solution}

\part $(a,d,c,b)$
\begin{solution}
$f: \{0,1,2,3\} \to \{a,d,c,b\}$ where $f = \{(0,a),(1,d),(2,c),(3,b)\}$
\end{solution}

\part $(1,3,5,7,9...)$
\begin{solution}
$f: \N \to O$ where $O$ is the set of odd natural numbers. $f(n) = 2n+1$
\end{solution}

\part $(1,4,9,16,25...)$
\begin{solution}
$f: \N \to S$ where $S$ is the set of perfect squares. $f(n) = (n+1)^2$
\end{solution}

\part $(0,1,-1,2,-2,...)$
\begin{solution}
$f: \N \to \Z$ where
$f(n) = \begin{cases}
-\frac{n}{2} & \text{ if n is even}\\
\frac{n+1}{2} & \text{ if n is odd}\\
\end{cases} $
\end{solution}

\end{parts}



\newpage
\section*{Sets}
\question
Expand Down

0 comments on commit a4149a2

Please sign in to comment.