\documentclass[12pt,a4paper]{article}

\usepackage{fullpage,amsmath,amsfonts,graphicx}

\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}

\tikzset{->, % makes the edges directed
         >=stealth', % makes the arrow heads bold
         node distance=3cm, % specifies the minimum distance between
                            % two nodes. Change if necessary.
         every state/.style={thick, fill=gray!10}, % sets the
                            % properties for each `state` node
         initial text=$ $,  % sets the text that appears on the start arrow
}

\begin{document}

\title{Foundations of Information Systems}
\author{Mock Exam}
\date{January 24, 2024}
\maketitle

% {\baselineskip=40pt
% \begin{tabbing}\
% Student ID Number: \= \kill
% Last Name: \> \rule[-2pt]{10cm}{0.3pt} \\
% First Name:  \> \rule[-2pt]{10cm}{0.3pt} \\
% Signature: \> \rule[-2pt]{10cm}{0.3pt} \\
% %Code: \> \fbox{\rule{0pt}{1.5em}\rule{1.5ex}{0pt}}
% %\fbox{\rule{0pt}{1.5em}\rule{1.5ex}{0pt}}
% %\fbox{\rule{0pt}{1.5em}\rule{1.5ex}{0pt}}
% %\fbox{\rule{0pt}{1.5em}\rule{1.5ex}{0pt}}
% \end{tabbing}}
% \vspace*{-2cm}
\begin{center}
\includegraphics[width=0.63\textwidth]{ascii-table.pdf}
\end{center}

\newpage
\begin{enumerate}

\item A Boolean function is described by the following truth table:
\begin{center}
\begin{tabular}{|ccc|c|}
\hline
$a$ & $b$ & $c$ & $z$ \\
\hline
0 & 0 & 0 & 1\vphantom{$\int^1$}\\
0 & 0 & 1 & 1 \\
0 & 1 & 0 & 0 \\
0 & 1 & 1 & 0 \\
1 & 0 & 0 & 1 \\
1 & 0 & 1 & 0 \\
1 & 1 & 0 & 0 \\
1 & 1 & 1 & 0 \\
\hline
\end{tabular}
\end{center}
\begin{enumerate}
\item Write out a Boolean algebra expression for this function.
\item Simplify the expression as much as possible.

\emph{Hint:} In the final expression, each of the input variables
should appear exactly once.
\item Draw a realization of this Boolean function via logic gates.

\emph{Note:} If you get stuck in part (b), you can draw the version
from part (a).
\end{enumerate}
\hfill(5+5+5)

\item Interpret the 8-bit string $01001001$ in each of the following
ways:
\begin{enumerate}
\item Unsigned integer
\item Signed two's complement integer
\item ASCII
\item An 8-bit floating point representation where the leading bit is
the sign, the next three bits encode the exponent with a bias of $3$,
and the last four bits encode the normalized mantissa, with the
leading 1 before the binary point implied, but not stored
\item Hamming-(8,4)-encoded bit string (correct or detect errors, if
necessary)
\end{enumerate}
\hfill(5+5+5+5+5)


\item For each of the following cases, is it possible to construct a
finite state transducer that reads the infinitely repeating input
sequence $01010101\ldots$ and outputs the stated infinite output
sequence?  If possible, draw the finite state transducer, otherwise
argue why it cannot be done.

\begin{enumerate}
\item ABABABAB\ldots
\item AAAAABABABA\ldots
\item ABBAAABBBBAAAAABBBBBB\ldots
\end{enumerate}
\hfill(5+5+5)


\item Consider what is known as the ``cigarette-smoker's problem'':
Three smokers are sitting around a table.  The first has a supply of
paper, the second has tobacco, and the third has matches.  There is
also an agent who has all three, but does not smoke. The agent
randomly places two different of the three ingredients on the table.
The smoker who has the third missing ingredient could then roll a
cigarette, light it, and smoke.  When done, the smoker signals the
agent to continue providing the next set of two items.
\begin{enumerate}
\item State the four necessary conditions for deadlock.
\item Explain why, without further provisions, each of the four
necessary conditions for deadlock is present here, then describe how
deadlock is possible.
\end{enumerate}
\hfill(4+6)


% Reference for the following:
% https://serverfault.com/questions/848680/how-raid-1-and-raid-10-become-different-when-there-are-8-logical-disk

\item A RAID-01 configuration is a RAID-1 (``mirroring'') arrangement
of several RAID-0 (``striping'') disk arrays.  A RAID-10 configuration
is similar, but in reversed order.  Consider the 6-disk case as shown:

\hspace*{-0.5\leftmargin}\includegraphics[width=\textwidth]{lmPtz.png}

(Image from: \texttt{https://serverfault.com/a/848689})

\begin{enumerate}
\item What is the total storage capacity of the RAID-01 or RAID-10
array as shown?
\item What is the read speed of RAID-01 or RAID-10 compared to the
read speed of a single disk?
\item What is the write speed of RAID-01 or RAID-10 compared to the
write speed of a single disk?

\item Which one is safer?  Answer this question assuming, as is often
the case in practical implementations, that an entire RAID-0 array is
failing as soon a single disk in that array is failing.

\end{enumerate}
\hfill(5+5+5+5)

% \newpage
% (Solution ctd./scratch paper)
\end{enumerate}



\end{document}