CS310 - Assignment Template
Auteur
André dos Santos
Last Updated
il y a 5 ans
License
Creative Commons CC BY 4.0
Résumé
Template for CS310-002 Discrete Computational Structures at the UofR
Template for CS310-002 Discrete Computational Structures at the UofR
%%%%%%%%%%%%%%%%% DO NOT CHANGE HERE %%%%%%%%%%%%%%%%%%%% {
\documentclass[12pt,letterpaper]{article}
\usepackage{fullpage}
\usepackage[top=2cm, bottom=4.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{lastpage}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{mathrsfs}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true,
linkcolor=blue,
linkbordercolor={0 0 1}
}
\setlength{\parindent}{0.0in}
\setlength{\parskip}{0.05in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% }
%%%%%%%%%%%%%%%%%%%%%%%% CHANGE HERE %%%%%%%%%%%%%%%%%%%% {
\newcommand\course{CS 310-002}
\newcommand\semester{Fall 2019}
\newcommand\hwnumber{1} % <-- ASSIGNMENT #
\newcommand\NetIDa{Your Name} % <-- YOUR NAME
\newcommand\NetIDb{200XXYYZZ} % <-- STUDENT ID #
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% }
%%%%%%%%%%%%%%%%% DO NOT CHANGE HERE %%%%%%%%%%%%%%%%%%%% {
\pagestyle{fancyplain}
\headheight 35pt
\lhead{\NetIDa}
\lhead{\NetIDa\\\NetIDb}
\chead{\textbf{\Large Assignment \hwnumber}}
\rhead{\course \\ \semester}
\lfoot{}
\cfoot{}
\rfoot{\small\thepage}
\headsep 1.5em
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% }
\begin{document}
\section*{Example Problem 1}
Answer to the problem goes here.
Use a line per sentence.
Leave a blank space to start a new paragraph. Next, an example typesetting mathematics in \LaTeX .
%%%%%%%% Math formulas %%%%%%%%
%%% For math formulas in text, put them between dollar signs '$'
%% Example:
Showing that equation $a + b = \frac{c}{d}$ in evidence:
%%% For stand alone math formulas use "align"
%% Example:
\begin{align}
\label{eq_example}
a + b = \frac{c}{d}
\end{align}
Note that equation \ref{eq_example} was automatically numbered.
If you prefer not numbered equations, see the next example.
\section*{Example Problem 2}
Showing that $\neg (p \rightarrow q)$ and $p \wedge \neg q$ are logically equivalent.
\begin{align*}
\neg (p \rightarrow q) & \equiv \neg ( \neg p \vee q ) \\ % \\ makes a new line
& \equiv \neg ( \neg p \vee q ) \\
& \equiv \neg ( \neg p ) \wedge \neg ( q ) \\
& \equiv p \wedge \neg q
\end{align*}
Note that $\&$ is where the equations align.
\section*{Example Problem 3}
Constructing the \emph{Truth Table} of $(p \rightarrow q) \wedge (\neg p \leftrightarrow q)$ in Table \ref{tb_truth_table}:
\begin{table}[h] % [h] means to print the table here
\caption{Caption here. Leave it blank if you will not refer it.}
\label{tb_truth_table}
\centering % to center the table https://www.overleaf.com/project/5d757e7e591aa30001b65c17
\begin{tabular}{cc|c|cc|c} % one 'c' for each column. It means centered. You can use 'l' or 'r' for left and right, respectively. '|' prints a line
$p$ & $q$ & $\neg p$ & $p \rightarrow q$ & $\neg p \leftrightarrow q$ & $(p \rightarrow q) \wedge (\neg p \leftrightarrow q)$ \\ \hline
T & T & F & T & F & F \\
T & F & F & F & T & F \\
F & T & T & T & T & T \\
F & F & T & T & F & F
\end{tabular}
\end{table}
\section*{Example Problem 4}
% If the Problem is divided into items, use "enumerate"
\begin{enumerate}[a)]
\item
``There is a student in Gryffindor who has taken all elective classes.''
Solution:
\begin{align*}
\exists x \forall y \forall z ( H(x, \text{Gryffindor}) \wedge P(x,y) )
\end{align*}
where
\begin{itemize}
\item[] $H(x,z)$ is ``$x$ is of $z$ house''
\item[] $P(x, y)$ is ``$x$ has taken $y$,''
\item[] the domain for $x$ consists of all students in Hogwarts
\item[] the domain for $y$ consists of all elective classes,
\item[] and the domain for $z$ consists of all Hogwarts houses.
\end{itemize}
\item
Give a direct proof of the theorem ``If $n$ is an odd integer, then $n^2$ is odd.''
Solution:
\begin{enumerate}[1.]
\item
\begin{align*}
\forall n(P(n) \rightarrow Q(n)),
\end{align*}
where
\begin{itemize}
\item[] $P(n)$ is ``$n$ is an odd integer'' and
\item[] $Q(n)$ is ``$n^2$ is odd.''
\end{itemize}
\item
Assume $P(n)$ is true.
\item
By definition, an odd integer is $n = 2k + 1$,
where $k$ is some integer.
\item
\begin{align*}
n^2 &= (2k + 1)^2 \\
&= 4k^2 + 4k + 1 \\
&= 2(2k^2 + 2k) + 1
\end{align*}
\item
$\therefore n^2$ is an odd integer. $\qed$
\end{enumerate}
\item Let $A = \{1,2,3\}$ and $B = \{1,2,3,\{1,2,3\}\}$:
Then, $A \in B$ and $A \subseteq B$.
\item Let $A = \{1, 3, 5\}$, $B = \{1,2,3,\}$, and universe $U = \{1,2,3,4,5\}$:
\begin{align*}
A \cup B &= \{1,2,3,5\}, \\
A \cap B &= \{1,3\}, \\
A - B &= \{5\},\\
\bar{A} &= \{2,4\},\\
A - A &= \emptyset .
\end{align*}
\end{enumerate}
\end{document}