% 
% 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 2025)}
\date{\today}
\author{Patrice Koehl\\koehl@cs.ucdavis.edu}

\begin{document}
\maketitle
\section*{\underline{Homework 1}}

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

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

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

A surfboard and a swimsuit cost \$2100 in total. The surfboard costs \$2,000 more than the swimsuit. How much does the surfboard 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 ten pairs of green socks, ten pairs of black socks, and eleven pairs of blue socks, but they are all 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?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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.  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"
\item Carl: ``I am a knight and the others are knaves"
\end{itemize}
Determine which person is what or whether you do not have enough information.


\end{document}
