% 
% hw1.tex
%
%   This is a LaTeX template to get you started
%   making problem-set solutions
%
 
\documentclass[11pt]{article}
\usepackage{amsmath}
\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}
 
  \newcommand{\centerfig}[2]{%
\centerline{\includegraphics[#2]{#1}}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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*{\underline{Homework 1}}

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

Eighty nine biscuits are to be fed to eleven pets; each pet is either a cat or a dog. Each dog is to get nine biscuits, and each cat is
to get seven. How many dogs and how many cats are there?

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

A computer and its case cost \$3100 in total. The computer costs \$3,000 more than the case. How much does the case cost?

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

You are about to leave for holiday, but you forgot socks! You race back to your room, but the power is off so you can't see sock colors.
Never mind, because you remember that in your drawer there are twelve pairs of green socks, eight pairs of black socks, and ten pairs of blue socks, but they are all separated (i.e., not in pair), and mixed up.

What is the minimum number of socks you need to take before you can be sure to have at least one matching pair (i.e., 2 socks of the same color)?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 4}

You are on an island inhabited by three types of people: knights (always make true statements), knaves (always make false statements) and spies (sometimes make true statements and sometimes make false statements). You come across 3 people Adam, Ben and Carl. You know that one is a knight, one is a knave and one is a spy. They say the following:
\begin{itemize}
\item Adam: ``Carl is a knave"
\item Ben: ``Adam is a knight"
\item Carl: ``I am the spy"
\end{itemize}
Determine which person is what or whether you do not have enough information.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 5}
You are on an island inhabited by two types of people: knights (always make true statements), and knaves (always make false statements). You come across 3 people Adam, Ben and Carl.  Only Adam and Ben speak; they say the following:
\begin{itemize}
\item Adam: ``We are all three knaves"
\item Ben: ``Two of us are knaves and one of us is a knight"
\end{itemize}
Determine which person is what or whether you do not have enough information.


\end{document}
