\documentclass[12pt]{article}

% Everything after a percent sign is ignored by the LaTeX compiler --
% these are called "comments". This template has many of the same
% explanatory comments as appeared in the template for the first
% problem set; over time I will phase them out as they become less
% necessary.

% Note that most of this template is comments, to explain exactly what
% is going on with each line. You can remove as many of them as you
% want without affecting the output, and you might well want to remove
% them if you think they're just in your way.

% If you actually want to put a percent sign in your document, use the
% two-character combination "\%", e.g. "40 dollars invested at a 4\%
% interest rate will become $40e^{0.04t}$ dollars after $t$ years."


% The "geometry" package is used for page layout. The normal LaTeX
% page is very small; using this package allows us to let out the
% margins a bit. If you find the text unattractively close to the
% edges of the page, you might try adjusting the 'margin=' number to
% 1in. Feel free to experiment!

\usepackage[margin=0.7in]{geometry}

% amsmath, amsfonts, and amssymb are packages created by the American
% Mathematical Society to respectively enhance LaTeX's basic equation
% layout, fonts, and available symbols for relations and operators. Of
% particular note at this point: amsfonts provides the commands
% \mathcal and \mathbb for caligraphic and blackboard-bold text,
% respectively.

\usepackage{amsmath,amsfonts,amssymb}

% fancyhdr allows a wider range of headers and footers than basic
% LaTeX.

\usepackage{fancyhdr}

% lastpage may not be part of your installation; it's a somewhat
% nonstandard package that determines the page number of the last page
% of your document, and allows you to refer to it with
% \pageref{LastPage}. If you don't have it, it can be worked around.

\usepackage{lastpage}

% Uncomment the following line and actually put your name into the
% second pair of braces. This will make LaTeX resolve \studentname
% throughout the document as whatever you put in the braces. Note that
% if you don't uncomment this line, your source will not compile!

%\newcommand{\studentname}{Your name here}

% Here we _use_ the functionality provided by the fancyhdr
% package. The first line tells LaTeX that we actually want a page
% with headers and footers, and the subsequent 6 commands indicate
% what those headers and footers are. Feel free to fiddle with these
% to produce the layout _you_ like!
\pagestyle{fancy}

% In the upper left, we have the class name...
\lhead{MATH 311-02}

% In the upper middle, the title of this particular document...
\chead{Problem Set \#2}

% And in the upper right, the name of the student doing this
% work. Note that this next line will fail to compile unless you
% uncomment the \newcommand up above!
\rhead{\studentname}

% I leave the lower left blank. Maybe you can come up with something
% clever to do with it.
\lfoot{}

% In the lower middle, the page number. The basic version of this uses
% the lastpage package. If you're not using lastpage, then comment
% this one out and use the simpler version which is commented out
% below. Note that \thepage is a macro meaning "the current page
% number".

\cfoot{Page \thepage\ of \pageref{LastPage}}
%\cfoot{Page \thepage}

% In the lower right, you could put the current date. \today will be
% expanded on compilation into whatever day your computer believes it
% to be.
%\rfoot{\today}

% On reflection, however, it's probably better to put the due date.
\rfoot{\bf due February 4}

\begin{document}
\begin{enumerate}
  % \textbf is a formatting command, saying "typeset the argument in
  % boldface (or 'bf' for short)". Here I use it to put the number of
  % points the problem is worth in boldface.

  % I also use \emph, which is similar but instead of boldface, it
  % means "emphasize". Text is emphasized by italicizing it -- or by
  % de-italicizing it! \emph when used within italiciazed text will
  % straighten it. I put the actual problem statement in emphasized
  % text, so that the question, italicized, will appead before your
  % answer. You can remove or edit this if you prefer some other
  % format.
\item \textbf{(10 points)} \emph{Consider the statements $P:
    x^2-3x+2=0$ and $Q: x\geq 0$.}

  % You throw a pair of dollar signs around
  % anything you want to be typeset inline as math. Most mathematical
  % symbols are just where they
  % are on the keyboard.

  % If you want a literal dollar sign in your text, use \$, e.g. "if
  % we invest \$40 at 5\%..."

  \begin{enumerate}
  \item \textbf{(6 points)} \emph{Explain in words why $P\Rightarrow
      Q$ is true.}
    
    % \Rightarrow is a short arrow with an arrowhead on the right
    % and with a doubled stem; it's an appropriate symbol for
    % implication. LaTeX has a variety of other arrows, but this one
    % is a good "implies" symbol.
    
  \item \textbf{(4 points)} \emph{There are four pairs of truth values
      for $P$ and $Q$. For each of the four pairs, either find a value
      of $x$ corresponding to those truth values, or explain why such
      an $x$ cannot exist.}
  \end{enumerate}
  
\item \textbf{(9 points)} \emph{The statements $(\neg P)\vee(\neg Q)$
    and $\neg(P\wedge Q)$ are equivalent. You will demonstrate this
    two ways.}
  % \neg is the symbol for negation; \vee is the symbol for
  % disjunction, and \wedge is the symbol for conjunction.
  
  \begin{enumerate}
  \item \textbf{(4 points)} \emph{Fill in the following truth table,
      and note that the two columns corresponding to $(\neg
      P)\vee(\neg Q)$ and $\neg(P\wedge Q)$ have identical entries.}
    
    \begin{center}
      % OK. Tabular environments are a bit complicated, but they're
      % how the layout of tables is done in LaTeX. We threw this
      % one inside of a center environment so that it would be
      % centered on the page and look nice, but it's still got a lot
      % to it. The big part is the "specification" at the top, which
      % contains a sequence of the characters "|", "l", "c", and "r",
      % representing a vertical line, a left-justified column, a
      % centered column, and a right-justified column. So this one,
      % for instance, has 7 centered columns separated by vertical
      % lines, with vertical lines on the left and right; in addition,
      % there are _doubled_ vertical lines separating the first two
      % columns, the middle three, and the final two. We shall see
      % that this is a useful layout for answering the question asked.
      \begin{tabular}{|c|c||c|c|c||c|c|}
        % We begin with a horizontal line, "\hline" to be the top edge
        % of our table.
        \hline
        % Now we include the first row, with the seven cells separated
        % by six "&" characters, and the end of the line signalled by
        % "\\".
        $P$&$Q$&$\neg P$&$\neg Q$&$(\neg P)\vee(\neg Q)$&$P\wedge Q$&$\neg(P\wedge Q)$\\
        % We want a double line under this row, since it's the
        % header. You could reduce this down to one line and entirely
        % remove the future \hlines. Experiment and find your
        % preferred layout!
        \hline\hline
        % Now we have a row of the actual truth table -- note that the
        % part you're supposed to fill in is blank!
        T&T& & & & & \\
        \hline % You may not like having a horizontal line here. Try
               % commenting it out.
        T&F& & & & & \\
        \hline % You may not like having a horizontal line here. Try
               % commenting it out.
        F&T& & & & & \\
        \hline % You may not like having a horizontal line here. Try
               % commenting it out.
        F&F& & & & & \\
        \hline % This is the bottom edge of the table, so you should
               % probably leave this \hline in.
      \end{tabular}
    \end{center}
  \item \textbf{(5 points)} \emph{Write out the statements $(\neg
      P)\vee(\neg Q)$ and $\neg(P\wedge Q)$ in words instead of
      symbols, and explain why these two different statements describe
      the same situation.}
  \end{enumerate}

\item \textbf{(6 points)} \emph{Letting $P$ and $Q$ be statements,
    identify each of the following statements as either tautological,
    contradictory, or neither. Justify your results, either with
    explanation or exhaustive computation.}
  \begin{itemize}
    % Just for a change of pace, a bulleted list.
  \item \emph{$(P\wedge(P\Rightarrow Q))\Rightarrow Q$.}
    
  \item \emph{$(P\vee Q)\Leftrightarrow(P\wedge Q)$.}
    
    % Leftrightarrow is a two-headed, double-stemmed arrow -- it's a
    % standard symbol for the biconditional.
    
  \item \emph{$(P\wedge Q)\Rightarrow\neg Q$.}
  \end{itemize}

\item \textbf{(5 points)} \emph{Let $P$ be the proposition ``$n$ is a
    prime number between 4 and 10''. For each of the propositions
    given below, indicate whether that proposition is a necessary
    condition for $P$, a sufficient condition for $P$, both, or
    neither; briefly justify your claim.}
  % We use `` and '' as smartquotes.
  
  \begin{itemize}
  \item \emph{$Q_1$: $n$ is equal to 5.}
  \item \emph{$Q_2$: $n$ is a positive, odd integer.}
  \item \emph{$Q_3$: $n$ is a prime number less than 6.}
  \end{itemize}
  
\item \textbf{(5 points)} \emph{Below, we shall discuss the true
    statement ``For every rational number $r$, $\frac{1}{r}$ is
    rational.''}
  \begin{enumerate}
  \item \textbf{(2 points)} \emph{Write this statement entirely in
      symbols. Note that we can assert that some $x$ is rational with the
      statement $x\in\mathbb Q$.}

      % Necessary LaTeX information: the symbol for the backwards E is
      % \exists; the symbol for the upside-down A is \forall.

  \item \textbf{(3 points)} \emph{Write the negation of this statement
      in words, in as easy-to-comprehend a way as possible. Do not
      simply wrap the entire expression in the phrase ``it is not the
      case that...''. Note that the statement you produce will in fact
      be false.}
  \end{enumerate}

\item \textbf{(5 points)} \emph{Below, we shall discuss the false
    statement ``There is a rational number $r$ such that $r^2=2$.''}
  \begin{enumerate}
  \item \textbf{(2 points)} \emph{Write this statement entirely in
      symbols.}

      % Necessary LaTeX information: the symbol for the backwards E is
      % \exists; the symbol for the upside-down A is \forall.

  \item \textbf{(3 points)} \emph{Write the negation of this statement
      in words, in as easy-to-comprehend a way as possible. Do not
      simply wrap the entire expression in the phrase ``it is not the
      case that...''. Note that the statement you produce should be
      true.}
  \end{enumerate}
  
  % You only need to do the following if you want to -- which is why
  % it's commented out in the basic template, so that it doesn't show
  % up unless you uncomment it and work on it.
  
% \item \textbf{(4 point bonus)} \emph{Logic is important in designing
%     computers, since the ``true'' and ``false'' properties of a
%     statement correspond to the circuit states of having a high signal
%     (usually 5 volts) and a low signal (0 volts). Due to technical
%     restrictions, early computers had only one basic operation,
%     generally called NAND (standing for ``not-and'') and written with
%     the symbol $\uparrow$. $P\uparrow Q$ was logically equivalent to
%     $\neg(P\wedge Q)$, as shown in the following truth table.}

%   \begin{center}
%     \begin{tabular}{|c|c||c|}
%       \hline
%       $P$&$Q$&$P\uparrow Q$\\\hline\hline
%       T&T&F\\\hline
%       T&F&T\\\hline
%       F&T&T\\\hline
%       F&F&T\\\hline
%     \end{tabular}
%   \end{center}

%   \emph{While this was the only primitive operation which was
%     feasible, early computer scientists of course wanted to use the
%     more familiar and useful operations. Show that one can express the
%     statements $\neg P$, $P\wedge Q$, and $P\vee Q$ entirely in terms
%     of repeated application of the ``nand'' operation to $P$ and $Q$
%     in various combinations.}

\end{enumerate}

\end{document}