31/101
\begin{frame}
\frametitle{Functions as Machines}

A function as a \emph{machine}:
\begin{center}
\begin{tikzpicture}[default,node distance=25mm]
\node (x) {$x$ in $D$};
\node (f) [right of=x,minimum height=8mm,minimum width=12mm] {$f$};
\machine{f}
\node (fx) [right of=f] {$f(x)$ in $E$};
\begin{scope}[cdred,->,>=stealth,ultra thick]
\draw (x) -- (f.west);
\draw (f.east) -- (fx);
\end{scope}
\node [at=(x.south),anchor=north] {(input)};
\node [at=(fx.south),anchor=north] {(output)};
\end{tikzpicture}
\end{center}
\begin{itemize}
\pause
\item \emph{domain} = set of all possible inputs
\pause
\item \emph{range} = set of all possible outputs
\end{itemize}
\pause

\begin{example}
Square $f(x) = x^2$:\\
\begin{itemize}
\pause
\item domain = $\mathbb{R}$
\pause
\item range = \pause $\{x \mid x \ge 0\}$ = \pause $[0,\infty)$
\end{itemize}
\medskip\pause
Square root $f(x) = \sqrt{x}$\; (over real numbers):\\
\begin{itemize}
\pause
\item domain = \pause$\{x \mid x \ge 0\}$ = $[0,\infty)$
%     \hfill\textcolor{gray}{($\sqrt{x}$ for $x< 0$ does not exist)}
\pause
\item range = \pause$\{x \mid x \ge 0\}$ = $[0,\infty)$
\end{itemize}
\end{example}
\end{frame}