Skip to content

Instantly share code, notes, and snippets.

@jalvarado91
Created February 1, 2017 03:01
Show Gist options
  • Save jalvarado91/2440e11c0751098c213f11cd0a8a029c to your computer and use it in GitHub Desktop.
Save jalvarado91/2440e11c0751098c213f11cd0a8a029c to your computer and use it in GitHub Desktop.
\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\begin{document}
\title{Homework 1}
\author{Juan Alvarado}
\maketitle
\begin{enumerate}
\item \textbf{Problem 1}:
\textit{Order the functions by asymptotic notation.}\\
Use a truth table to prove the following logical equivalence.
\begin{displaymath}
P \wedge (Q \vee R) \equiv (P \wedge Q) \vee (P \wedge R)
\end{displaymath}
Solution:
\begin{displaymath} % start unumbered math environment
%
% Start a table in math mode. The |c|c|c|c|c|c|c|c| string is a
% format string that says there will be 8 colunms in the table. The
% c's indicate that the data in each column will be centered (use l
% for left justified and r for right justified). The vertical bar
% means that lines will be drawn between columns. The trailing
% \hline causes a horizontal line to be drawn across the top of the
% table.
%
\begin{array}{|c|c|c|c|c|c|c|c|}\hline
%
% Each row of the table consists of data separated by "&" symbols.
% Each row must end with "\\" to cause a newline. A trailing
% \hline will cause a line to be drawn under the row. A double
% \hline is often used to separate the table header from the rest
% of the table.
%
P & Q & R & Q \vee R & P \wedge (Q \vee R) & P \wedge Q & P \wedge
R & (P \wedge Q) \vee (P \wedge R)\\\hline\hline
T & T & T & T & \mathbf{T} & T & T & \mathbf{T}\\\hline
T & T & F & T & \mathbf{T} & T & F & \mathbf{T}\\\hline
T & F & T & T & \mathbf{T} & F & T & \mathbf{T}\\\hline
T & F & F & F & \mathbf{F} & F & F & \mathbf{F}\\\hline
F & T & T & T & \mathbf{F} & F & F & \mathbf{F}\\\hline
F & T & F & T & \mathbf{F} & F & F & \mathbf{F}\\\hline
F & F & T & T & \mathbf{F} & F & F & \mathbf{F}\\\hline
F & F & F & F & \mathbf{F} & F & F & \mathbf{F}\\\hline
\end{array}
\end{displaymath}
\end{enumerate}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment