% 
% hw1.tex
%
%   This is a LaTeX template to get you started
%   making problem-set solutions
%
 
\documentclass[11pt]{article}

\usepackage{amssymb,amsmath,pstricks,framed}
\usepackage{color}

\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textheight}{9.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}

% *** GRAPHICS RELATED PACKAGES ***
%

\usepackage[pdftex]{graphicx}
 \graphicspath{{./}}
 \DeclareGraphicsExtensions{.pdf,.jpeg,.png}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Data, Logic, and Computing\\[2ex] 
       \rm\normalsize ECS 17 (Winter 2026)}
\date{\today}
\author{Patrice Koehl\\koehl@cs.ucdavis.edu}

\begin{document}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 1} 

Assuming that there are 154,998 characters in the UNICODE, and that each character is represented with the same number of bits, what is the minimal number of bits needed to store a word with 8 characters using this code?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 2} 

How much space would you need to store a 6 min song that has been sampled at 44.1 kHz, with each data point stored on 16 bits, in stereo (assume no compression).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 3} 

Which word is encoded in the ASCII code $(01100101 01100011 01110011)_2$?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 4} 

You want to store a movie on your computer.  You know that your movie is 2 hour long. It was filmed at a rate of 25 frames per second and each frame requires 10 kilobytes of storage. The soundtrack was stored in stereo, recorded at 50KHz, with 2 bytes per point. How much space is needed to store the whole movie and its soundtrack, in megabytes (assuming that 1 megabyte = 1000 kilobytes)?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 5}

Let us play a logical game. You find yourself in front of three rooms whose doors are closed.
Behind each door, there could be a Lady or a Tiger. There is only one Lady and two Tigers.
There is one sign on each door; you are told
that the sign on the door of the room containing the Lady is true, and that at least one of the other two signs is false Here are the signs: 

\begin{framed}
\begin{minipage}[c]{.30\linewidth}
\centering
\begin{framed}
Room I \\
A Tiger is in room II
\end{framed}
\end{minipage}
\begin{minipage}[c]{.30\linewidth}
\centering
\begin{framed}
Room II \\
A Tiger is in this room
\end{framed}
\end{minipage}
\begin{minipage}[c]{.30\linewidth}
\centering
\begin{framed}
Room III \\
A Tiger is in room I
\end{framed}
\end{minipage}
\end{framed}

\noindent Can you find what is inside each room?

\end{document}

