Homework 10

Due: Nov 28th, 2021

This homework will have a mini-tutorial on how to create graphics in LaTeX, and also a chance to review and redo a previous homework problem.

We’ll show how to get started creating graphics using TikZ, and also a simple array.

Please create a LaTeX document using the code that has been posted in previous homework assignments. (Please update it to say Homework 10, with the correct due date, and including your name.)

Problems

This homework has three problems. The first one is LaTeX code that you can just copy into your file. For the second one, you’ll copy and modify that LaTeX code to answer a slightly different question. The third one is a review exercise, to redo a problem from a previous homework.

We’re starting with something a little simpler than Venn diagrams. So, despite the popular request for Venn diagrams, those will be postponed to our next (and probably last) homework assignment.

  1. This is a LaTeX exercise to learn how to include a graphic. Follow the steps:

    1. Add the following line to your LaTeX source file:

      \usepackage{tikz}

      It should be placed along with the other \usepackage lines.

    2. Within your document (after \maketitle and before \end{document}) add the lines

      \begin{exer}
      Suppose $f$ is a function $f : \{a,b,c\} \to \{u,v\}$ and we have $f(a)=u$ and $f(b)=u$.
      How should we define $f(c)$ if we want $f$ to be surjective (onto)?
      \end{exer}
      

      Before we go on, please take a moment. Do you understand what this question is asking? Do you know how to answer it?

    3. Now add these lines to your document, to show the answer in a table format:

      \begin{answer}
      We should define $f(c)=v$.
      Then $f$ is given by the table:
      \[
      \linespread{1.2}\selectfont % This is only needed because of \linespread{2.4} that is used for homework
      \begin{array}{c|rrr}
      x & a & b & c \\
      \hline
      f(x) & u & u & v \\
      \end{array}
      \]
      

      The linespread{2.4} would make the table way too spaced out. So we temporarily turn it off. The linspread change only affects within the \[ ... \]. After this display math ends, we’ll be back to linespread{2.4}. If you type arrays or tables in documents that don’t have linespread changes, then you can leave out the \linespread{1.2}\selectfont line.

      LaTeX: The {c|rrr} makes our table have 4 columns. The first column will be center-aligned, there will be a vertical separater line, and then the next three columns will be right-aligned.

    4. Finally, here’s a big block of code to draw a picture for the answer:

      We can represent $f$ pictorially by:
      \begin{center}
      \begin{tikzpicture}
        
        \draw[very thick] (0,0) ellipse[x radius=1, y radius=2];
        \node[below] at (0,-2) {domain};
        
        \draw[very thick] (5,0) ellipse[x radius=0.75, y radius=1.5];
        \node[below] at (5,-2) {target};
        
        \filldraw[black,fill=black] (0,1) circle[radius=0.1] node[left] {$a$};
        \filldraw[black,fill=black] (0,0) circle[radius=0.1] node[left] {$b$};
        \filldraw[black,fill=black] (0,-1) circle[radius=0.1] node[left] {$c$};
        
        \filldraw[black,fill=black] (5,0.75) circle[radius=0.1] node[right] {$u$};
        \filldraw[black,fill=black] (5,-0.75) circle[radius=0.1] node[right] {$v$};
        
        \draw (0,1) -- (5,0.75);
        \draw (0,0) -- (5,0.75);
        \draw[dashed] (0,-1) -- (5,-0.75);
        
      \end{tikzpicture}
      \end{center}
      We used a dashed line to show $f(c)=v$ that was the answer to the question.
      \end{answer}
      

      LaTeX: There’s a lot going on here. The important parts are that \draw draws lines and other shaps, \filldraw draws them and also fills them in, common shapes like circle and ellipse can be said directly, and for line segments we can use -- to connect a start point to an end point. Also node creates points where we can add label text.

    5. Compile your LaTeX and view the output to see how the table and the graphic look.

  2. Now modify the table and tikzpicture to answer this question:

    Suppose \(f\) is a function \(f : \{a,b,c\} \to \{u,v,w\}\) and we have \(f(a)=u\), \(f(b)=w\). How should we define \(f(c)\) if we want \(f\) to be injective (one-to-one)?

    Once you understand the question and know how to answer it, copy and modify the table and the graphic from the first question. Answer this question on a new page (after the first question).

  3. Finally, redo one problem from a previous homework assignment. Your score will count for this homework, not the previous one. Along with your answer, write a short reflection essay (1-2 paragraphs) about what you learned.

Additional assignments, required

These items are assigned and required. You do not have to turn in anything. These items will not be graded.

  • Read Chapters 12-13 of the textbook. Our class will cover Chapters 12 and 13, but not Chapter 14 or the appendices.

  • Have a happy, safe, healthy, fun, and restful Fall Break! This is a required assignment! :-)

    I truly, sincerely hope that all of you and your families and loved ones will have a good holiday.

If you need to contact me to ask questions, ask for help, or just need to talk, please feel free to email me at any time, including during the fall break.

Instructions

Use LaTeX to create a PDF. Upload your PDF to Gradescope. If you don’t have LaTeX on your computer, you can use Overleaf. Don’t submit the LaTeX source, just the PDF. Email your instructor (that’s me) if you have questions or need help.

Please include your name and the homework number within the document. Some additional formatting instructions are in the syllabus. To summarize:

  • Use a new page (\newpage) for each problem.
  • State which question you are answering and the actual question. Then, start your answer in a new paragraph.

You are encouraged to work together on the homework!

Additional assignments, optional

These are optional (not required).