You are on page 1of 17

General Questions

How do I write a proof?


- Make sure you understand what you’re trying to prove
- Know definitions
- Try some inputs to verify the proof (make sure it makes sense to you, and try to
find a counterexample if it’s a prove/disprove question)
- Try to identify the proof pattern needed
- Practice, Practice, Practice!
- Don’t be scared to ask questions if you’re stuck (in recitation, office hours, weekly
forums, etc.)
General Question 2

Should we brush up on factoring polynomials?


- Yes for basic ones, they will be crucial in some proofs
- Ex: sum of cube, basic binomials
- x^3 + 1 or x^2 + 2x + 1 for example
Introduction to LaTeX

1/18/2019
Adapted from the notes on LaTeX for CIS 160
LaTeX Resources

● Week 1 contains a module entitled “Learn and Practice with


LaTeX” that contains useful resources.

● GOOGLE is your best friend when it comes to LaTeX

● Popular LaTeX forum: https://tex.stackexchange.com

● Try out http://detexify.kirelabs.org/classify.html to look up


math symbols!
Setting up your LaTeX environment

● For detailed instructions see the the “LaTeX Setup Guide” in the
Learn and Practice with LaTeX module in Week 1 of the course

● In the same module you will find an interactive guide to LaTeX which
we also recommend browsing through, as well as a “cheat sheet”
with useful LaTeX commands for CIT 592.

● We recommend using Overleaf - an online editor for LaTeX


1. Go to www.overleaf.com and create an account
2. Login and click on “New Project” to start a new “.tex” file
3. Click “Blank Project” template under Basics
LaTeX Basics

● Structure of “.tex” document:


○ Preamble: packages, macros, general info about document (i.e. title, author, etc.)
○ Document body: enclosed in \begin{document} … \end{document} tags

● Import packages using the \usepackage{packagename} command

● Special Characters:
○ The backslash ‘\’ denotes commands or escape special characters
○ The dollar sign ‘$’ is used to enter or leave inline math-mode
○ The percent ‘%’ sign is used to comment the remainder of the line
○ Curly braces ‘{}’ are used to tell LaTeX that “these things belong together”
Environments I

Align: used to group together series of equations


IN GENERAL
\begin{environmentname} aligned by the positions of the special align
…. character - i.e. the ampersand ‘&’. In addition, a
contents new line is generated by two backslashes ‘\\’
….
\end{environmentname} Example:
\begin{align*}
(a + b)^2 &= (a + b)(a + b) \\
SOME NOTABLE EXCEPTIONS &= a^2 + ab + ba + b^2 \\
● Inline math mode: surround &= a^2 + 2ab + b^2
desirable text with single dollar \end{align*}
signs $ … $
● Display math mode: place desirable
text within \[ … \]
Environments II

● Enumerate: used to number text clauses. Enclose desired text within the
\begin{enumerate} … \end{enumerate} environment. Use \item to advance the
numbering. You can also nest such environments as follows:
\begin{enumerate}
\item \begin{enumerate}
\item Example A
\item Example B
\end{enumerate}
\item Explanation
\end{enumerate}

● Itemize: used to list text clauses without numbers (by default it uses bullets
instead). It is used exactly like the enumerate environment but within
\begin{itemize} … \end{itemize} commands.
Environments III

● Cases: essentially creates a self-contained miniature align*


environment. Most frequently used for piecewise functions;
can only be used if you’re already in math mode!! Table Example:
Example:
\[ \begin{tabular}{|c|c|c|}
f(x) = \hline
\begin{cases} $p$ & $q$ & $p \land q$
x^3 + 1 &\text{if } x \leq 0 \\ \\ \hline
x^2 + 1 &\text{if } x > 0 $T$ & $T$ & $T$ \\
\end{cases} $T$ & $F$ & $F$ \\
\] $F$ & $T$ & $F$ \\
$F$ & $F$ & $F$ \\
● Tables: to create a table in LaTeX enclose the relevant \hline
information within the \begin{tabular} … \end{tabular} \end{tabular}
environment and use the ampersand ‘&’ to align the
information and ‘\\’ for line breaks.
Images, Figures, and Diagrams

● To include images in LaTeX you’ll need to import the To ensure that your image appears as
graphicx package. You can do so by including close to the last text you wrote use the
\usepackage{graphicx} somewhere in your preamble. following syntax:

● If your image is in the same directory as your .tex file use \begin{figure}[!htbp]
\includegraphics{filename} to insert it to your document (file \centering
extension not required). \includegraphics{filename}
\caption{Caption} % optional
● If your image is in a different directory, specify its full path \label{fig:my_label} % optional,
instead of just the filename. % allows \ref to link to the figure
\end{figure}
● You can also provide additional scaling and rotation
arguments in brackets.
Examples
\includegraphics[scale=1.5, angle=45]{filename}
\includegraphics[height=2cm, width=\textwidth]{filename}
Math Mode Commands - General Notation

● Exponentiation: a^b ● Not equals: \neq


● Subscript: a_b ● Infinity: \infty
● Multiplication Cross: \times ● Floor Function: \lfloor x \rfloor
● Multiplication Dot: \cdot ● Ceiling Function: \lceil x \rceil
● Fraction: \frac{a}{b} ● Dots: \dots
● Square Root: \sqrt{x} ● Function composition: \circ
● Nth Root: \sqrt[n]{x} ● Cool-looking “l”: \ell
● Less or equal: \leq ● Summation: \sum_{k=1}^n
● Greater or equal: \geq ● Product: \prod_{k=1}^n
● Not greater or equal*: \not \geq ● Union over indices: \bigcup_{k=1}^n
● Intersection over indices: \bigcap_{k=1}^n
* in general \not slashes out the next symbol
Math Mode Commands - Set Notation

● Rendering braces: \{ … \} ● Set Difference: \setminus


● Empty Set: \emptyset ● Cartesian Product: \times
● Is an element of: \in ● Complement of S: S^c or \overline{S}
● Is not an element of: \notin ● Symmetric Difference: \oplus or
● Subset: \subseteq \triangle
● Strict Subset: \subsetneq or \subset
● Superset: \supseteq
● Strict Superset: \supsetneq or \supset
● Union: \cup
● Intersection: \cap
Math Mode Commands - Logical Notation

● Logical Conjunction: \land


● Logical Disjunction: \lor
● Logical Negation: \lnot
● Exclusive “or”: \oplus
● Logical Implication: \implies
● Reverse Logical Implication: \impliedby
● Biconditional Implication: \iff
● Equivalence: \equiv
● “For all” Quantifier: \forall
● “There exists” Quantifier: \exists
Math Mode Commands - Miscellaneous Notation

● Probability: \Pr[E]
● Conditional Probability: \Pr[A \mid B]
● Arrow for functions: \to
● Arrow for function action on specific
element: \mapsto
● Chromatic Number: \chi(G)
AMSmath Commands
Do not forget to include the amsmath package to use the following commands by
including \usepackage{amsmath} in your preamble

● “n choose k”: $\binom{n}{k}$


● Align: \begin{align} … \end{align}
● Cases: \begin{cases} … \end{cases}
● Boxes the selection (useful for
highlighting final answers):
$\boxed{x}$
AMSsymb Commands

Do not forget to include the amssymb package to use the following commands by
including \usepackage{amssymb} in your preamble

● The natural numbers: $\mathbb{N}$


● The integers: $\mathbb{Z}$
● The positive integers: $\mathbb{Z}^+$
● The rationals: $\mathbb{Q}$
● The reals: $\mathbb{R}$
● Does not divide: $\nmid$
● Check mark: $\checkmark$
● Wavy arrow (“has path to”): $\leadsto$
Spacing

● To create a new line: \newline

● To start new page: \newpage

● Spacing commands in augmenting order of space size:


\! \, \: \; \ \quad \qquad
Note that \! Is negative spacing (less than not writing anything).

● You can also use the tilde ‘~’ to create more spacing in both math
mode and normal text mode.

You might also like