% Prerequisite test, CSCE 235, spring 2007
% 12 January 2007

\magnification=1200

\pdfpagewidth=8.5truein \pdfpageheight=11truein
\hsize=6.5truein \vsize=9truein
\pdfhorigin=1truein \pdfvorigin=1truein

\headline={\hfil}
\footline={\hfil}

\centerline{CSCE~235: Introduction to Discrete Structures}
\centerline{Prerequisite test}
\centerline{January~12, 2007}

\medskip

{\parindent=0in

Name:

\medskip

Have you taken CSCE~155/155H? If so, what was your grade?

\medskip

Have you taken MATH~106/108H?

}  % end \parindent=0in

\bigskip

\noindent This test consists of five questions worth a total of 30~points. You
have 20~minutes to complete the test. You must show all steps, including any
computations or explanations, that led you to your answers.

\bigskip

\item{1.} (5~points) Let $\max(a,b)$ be the function that returns the maximum
of the two numbers $a$ and~$b$, and let $\min(a,b)$ be the function that returns
the minimum of the two numbers $a$ and~$b$. What is the value of
$$\max\biggl(a,\min\Bigl(\max\bigl(b,\min(a,b)\bigr),\min\bigl(a,\max(a,b)\bigr)\Bigr)\biggr)?$$

\vfill\vfill\vfill

\item{2.} (4~points) In {\it The Hitchhiker's Guide to the Galaxy}, Douglas
Adams says that the answer to the Question of Life, the Universe, and
Everything is~42. Express the decimal number~42 in

\smallskip

\itemitem{(a)} binary.

\vfill

\itemitem{(b)} base~5.

\vfill\eject %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item{3.} (4~points)

\smallskip

\itemitem{(a)} A document is enlarged by a factor of~150\% on a photocopier. By
what factor must the copy be reduced to produce a copy the same size as the
original?

\vfill

\itemitem{(b)} Sam and Kim both started new jobs at the beginning of~2005, with
the same starting salary. At the end of~2005, Sam received a 10\%~raise, while
Kim's salary was reduced by~5\%. At the end of~2006, however, it was Kim who
received the 10\%~raise, and Sam's salary fell by~5\%. After these two sets of
salary adjustments, whose salary is larger?

\vfill

\item{4.} (8~points) What is the output of the following pseudocode?

{\narrower\narrower\medskip\parindent=0in

$n:=13$

{\bf while} $n>1$ {\bf do}

\qquad{\bf output} $n$

\qquad{\bf if} $n$ is even {\bf then}

\qquad\qquad$n:=n/2$

\qquad{\bf else}

\qquad\qquad$n:=3n+1$

\qquad{\bf end}

{\bf end}

\smallskip}

\vfill\vfill

\vfill\eject %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item{5.} (9~points) An economist predicts, ``If the United States does not
reduce its trade deficit, then the country will fall into a recession.''

\smallskip

\itemitem{(a)} Based on this prediction, is it reasonable to conclude that ``if
the United States falls into a recession, it must be because the trade deficit
was not reduced''? Why or why not?

\vfill

\itemitem{(b)} Based on this prediction, is it reasonable to conclude that ``if
the United States does not fall into a recession, then the trade deficit must
have been reduced''? Why or why not?

\vfill

\itemitem{(c)} Based on this prediction, is it reasonable to conclude that ``if
the United States reduces its trade deficit, then the country will not fall
into a recession''? Why or why not?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\bye
