\documentclass[a4paper, 12pt, fleqn]{article}
\usepackage{amsmath}

\begin{document}
\noindent
\textbf{First name:} Monika \\
\textbf{Last name:} Wunderlich\\
\textbf{Date:} 4.12.03\\
\textbf{Homeworknumber:} 1\\
\textbf{Homework Title:} 1.17\\
\newline
\newline
\textbf{Problem description:} 
\newline
Let $x$ be a given nonzero floating-point number in a normalized system, and let $y$ be an adjacent floating-point number, also nonzero.
\begin{itemize}
	\item[(a)] What is the minimum possible spacing between $x$ and $y$?
	\item[(b)] What is the maximum possible spacing between $x$ and $y$?
\end{itemize}
\textbf{Problem solution:} 
\newline
In a normalized system the floating-point number $x$ is represented by the mantissa 
$d_0 d_1 \ldots d_{p-1}$ where $d_0$ is nonzero and the exponent $E \in [L, U]$. 
$$x = \left( d_0 + \frac{d_1}{\beta} + \frac{d_2}{\beta^2} + \ldots + \frac{d_{p-1}}{\beta^{p-1}}\right) \cdot \beta^{E}$$
There are two possible cases for the lower adjacent floating-point number $y$:
$$y = 
\begin{cases}
	 \left(d_0 + \frac{d_1}{\beta} + \frac{d_2}{\beta^2} + \ldots + \frac{d_{p-2}}{\beta^{p-2}} + \frac{d_{p-1}-1}{\beta^{p-1}}\right) \cdot \beta^{E} & \text{if} \ d_{p-1} > 0 \\
	\left( d_0 + \frac{d_1}{\beta} + \ldots + \frac{d_i -1}{\beta^{i}} + \frac{\beta -1}{\beta^{i+1}}+ \ldots + \frac{\beta -1}{\beta^{p-1}}\right) \cdot \beta^{E}	& \text{if} \ \forall j > i: d_j = 0 \\ & \text{and} \ d_i > 0, \ i > 0\\
	\left( (\beta -1) + \frac{\beta -1}{\beta} + \ldots + \frac{\beta -1}{\beta^{p-1}} \right) \cdot \beta^{E-1} & \text{if} \ \forall j > 0: d_j = 0 \\ & \text{and} \ d_0 = 1\\
\end{cases}
$$  
Therefore we have three cases for calculation of the difference $\Delta = x-y$:
\begin{description}
	\item[case: $d_{p-1} > 0$:]  
		\begin{eqnarray}
			\Delta &=& x-y \notag \\
				&=& \left( d_0 + \frac{d_1}{\beta} + \ldots + \frac{d_{p-1}}{\beta^{p-1}}\right) \cdot \beta^{E} - \left(d_0 + \frac{d_1}{\beta} + \ldots + \frac{d_{p-2}}{\beta^{p-2}} + \frac{d_{p-1}-1}{\beta^{p-1}}\right) \cdot \beta^{E} \notag \\
				&=& \left( \frac{d_{p-1}}{\beta^{p-1}} - \frac{d_{p-1} -1}{\beta^{p-1}} \right)\cdot \beta^{E} \notag \\
				&=& \beta^{E-(p-1)} \notag 
		\end{eqnarray}
	\item[case: $\forall j > i: d_j = 0 \ \text{and} \ d_i > 0 \ \text{and} \ i > 0$:]
		\begin{eqnarray}
			\Delta &=& x-y \notag \\
				&=& \left( d_0 + \frac{d_1}{\beta} + \ldots + \frac{d_i}{\beta^{i}} + \frac{0}{\beta^{i+1}} + \ldots + \frac{0}{\beta^{p-1}}\right) \cdot \beta^{E}\notag \\ 
				& &- \left( d_0 + \frac{d_1}{\beta} + \ldots + \frac{d_i -1}{\beta^{i}} + \frac{\beta -1}{\beta^{i+1}}+ \ldots + \frac{\beta -1}{\beta^{p-1}}\right) \cdot \beta^{E} \notag \\
				&=& \left( \frac{1}{\beta^{i}} - \frac{\beta -1}{\beta^{i+1}} - \frac{\beta -1}{\beta^{i+2}} - \ldots -\frac{\beta -1}{\beta^{p-1}} \right) \cdot \beta^{E} \notag \\
				&=& \beta^{E-(p-1)} \notag
		\end{eqnarray}		
	\item[case: $\forall j > 0: d_j = 0 \ \text{and} \ d_0 = 1$:]
		\begin{eqnarray}
			\Delta &=& x-y\notag \\
				&=& 1 \cdot \beta^{E} - \left( (\beta -1) + \frac{\beta -1}{\beta} + \ldots + \frac{\beta -1}{\beta^{p-1}} \right) \cdot \beta^{E-1} \notag \\
				&=& \beta^{E-1-(p-1)} = \beta^{E-p} \notag 
		\end{eqnarray}
\end{description}
We see that for the same $x$, $\Delta$ gets its minimum in the third case and its maximum in the first or second case. \\
\newline
\textbf{Results:} 
\begin{itemize}
	\item[(a)] Thus $E \in [L,U]$ we get the minimum for $\Delta$ in the third case if $E$ is minimal:
$$\Delta_{min} = \beta^{L-p}.$$
	\item[(b)] The maximum of $\Delta$ is reached in the first or second case if $E$ is maximal:
$$\Delta_{max} = \beta^{U-p+1}.$$
\end{itemize}
\end{document}