% 
% hw5.tex
%
%   This is LaTeX template to get you started
%   making problem-set solutions
%
 
\documentclass[11pt]{article}
\usepackage{amsthm,amsmath, amssymb}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textheight}{9.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Homework 5: due 2/12/2019\\[2ex]
       \rm\normalsize ECS 20 (Winter 2019)}
%\date{\today}
\author{Patrice Koehl\\koehl@cs.ucdavis.edu}

\begin{document}
\maketitle
%\section*{\underline{Homework 4 - For 11/2/2017}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 1 \emph{(10 points for each subquestion: 20 total)}} 
\begin{itemize}
\item[a)] Show that the following statement is true: "If there exist two integers $n$ and $m$ such that $2n^2+2n+1=2m$, then $2n=3$.
\item[b)]  If $x$ and $y$ are rational numbers such that $x < y$, show that there exists a rational number $z$ with $x <z < y$.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 2 \emph{(10 points)}} 
Let $x$ be a real number. Show that $\lfloor \frac{x}{3} \rfloor + \lfloor \frac{x+1}{3} \rfloor +  \lfloor \frac{x+2}{3} \rfloor = \lfloor x \rfloor$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 3  \emph{(10 points)}} 

This is a generalization of exercise 2:
\\
Let $x$ be a real number and $N$ an integer greater or equal to 3. \\ 
Show that $\lfloor x \rfloor = \lfloor \frac{x}{N} \rfloor + \lfloor \frac{x+1}{N} \rfloor+  \ldots + \lfloor \frac{x+N-1}{N } \rfloor$.


\vspace{0.2in}
(Hint: instead of following a proof similar to the one you used for exercise 2, define:
\begin{eqnarray*}
f(x) = \lfloor x \rfloor -\lfloor \frac{x}{N} \rfloor - \lfloor \frac{x+1}{N} \rfloor-  \ldots - \lfloor  \frac{x+N-1}{N } \rfloor
\end{eqnarray*}
and show that $f(x)$ is periodic, with period $1$.)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 4  \emph{(10 points)}}

Let $x$ be a real number. Then show that $\left( \lceil x \rceil - x \right) \left(x - \lfloor x \rfloor \right) \leq \frac{1}{4}$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 5 \emph{(10 points for each subquestion: 20 total)}}

Let $x$ be a real number. Solve the following equations:
\begin{itemize}
\item [a)] $\lfloor x^2 +x -5 \rfloor = \frac{1}{2}x$

\item [b)] $2\lfloor 4-x \rfloor = 2x+1$

\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\section*{Extra Credit \emph{(5 points)}}

Let $x$ and $y$ be two real numbers such that $0 < x \leq y$. We define:
\begin{itemize}
\item [a)] The customized arithmetic mean $m$ of $x$ and $y$: $\displaystyle m = \frac{x+2y}{3}$
\item [b)] The customized geometric mean $g$ of $x$ and $y$: $\displaystyle g = {x^{\frac{1}{3}}y^{\frac{2}{3}}}$
\item [c)] The customized harmonic mean $h$ of $x$ and $y$: $\displaystyle \frac{3}{h} = \left(\frac{1}{x} + \frac{2}{y}\right)$
\end{itemize}
Show that:
\begin{eqnarray*}
x \leq h \leq g \leq m \leq y
\end{eqnarray*}
\end{document}

