%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% This top part of the document is called the 'preamble'.  Modify it with caution!
%
% The real document starts below where it says 'The main document starts here'.

\documentclass[12pt]{article}

\usepackage{amssymb,amsmath,amsthm}
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{verbatim}

% Comment the following line to use TeX's default font of Computer Modern.
\usepackage{times,txfonts}

\newtheoremstyle{homework}% name of the style to be used
  {18pt}% measure of space to leave above the theorem. E.g.: 3pt
  {12pt}% measure of space to leave below the theorem. E.g.: 3pt
  {}% name of font to use in the body of the theorem
  {}% measure of space to indent
  {\bfseries}% name of head font
  {:}% punctuation between head and body
  {2ex}% space after theorem head; " " = normal interword space
  {}% Manually specify head
\theoremstyle{homework} 

% Set up an Exercise environment and a Solution label.
\newtheorem*{exercisecore}{\@currentlabel}
\newenvironment{exercise}[1]
{\def\@currentlabel{#1}\exercisecore}
{\endexercisecore}

\newcommand{\localhead}[1]{\par\smallskip\noindent\textbf{#1}\nobreak\\}%
\newcommand\solution{\localhead{Solution:}}

% \newcommand{includematlab}[1]{\verbatiminput{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Stuff for getting the name/document date/title across the header
\makeatletter
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{\ifnum \value{page} > 1\relax\thepage\fi}
\fancyhead[L]{\ifx\@doclabel\@empty\else\@doclabel\fi}
\fancyhead[C]{\ifx\@docdate\@empty\else\@docdate\fi}
\fancyhead[R]{\ifx\@docauthor\@empty\else\@docauthor\fi}
\headheight 15pt

\def\doclabel#1{\gdef\@doclabel{#1}}
\doclabel{Use {\tt\textbackslash doclabel\{MY LABEL\}}.}
\def\docdate#1{\gdef\@docdate{#1}}
\docdate{Use {\tt\textbackslash docdate\{MY DATE\}}.}
\def\docauthor#1{\gdef\@docauthor{#1}}
\docauthor{Use {\tt\textbackslash docauthor\{MY NAME\}}.}
\makeatother

% Shortcuts for blackboard bold number sets (reals, integers, etc.)
\newcommand{\Reals}{\ensuremath{\mathbb R}}
\newcommand{\Nats}{\ensuremath{\mathbb N}}
\newcommand{\Ints}{\ensuremath{\mathbb Z}}
\newcommand{\Rats}{\ensuremath{\mathbb Q}}
\newcommand{\Cplx}{\ensuremath{\mathbb C}}
%% Some equivalents that some people may prefer.
\let\RR\Reals
\let\NN\Nats
\let\II\Ints
\let\CC\Cplx

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% The main document start here.

% The following commands set up the material that appears in the header.
\doclabel{Math 426: Homework 1 (Part A)}
\docauthor{Your name here!}
\docdate{August 28, 2020}

\newcommand{\vv}{\mathbf{v}}
\begin{document}

\def\vv{\mathbf{v}}
\def\vw{\mathbf{w}}

\begin{exercise}{Octave Tutorial \# 5}
 Let $p(t) = -1 +3t-2t^3$ -- that is, $p$ is a polynomial.  Use Octave to compute the value of $p$ at each of the entries of $x$.
The first entry of this matrix should be $p(7)$ since the first entry of $x$ is 7.  The last entry should be $p(2)$ since $2$ is the last
entry of $x$.
\end{exercise}
\solution
\begin{verbatim}
Your solution here!
\end{verbatim}

\begin{exercise}{Octave Tutorial \# 7}
Plot the curves $y=C e^{x}$ for $C=1$, $C=1/2$, $C=0$, $C=-1/2$, and $C=-1$ over the range $-1\le x \le 1$ all in the same figure. 
Add a helpful legend to your plot.  Hand in a printout of your plot.
\end{exercise}
\solution
\begin{verbatim}
Your code here!
\end{verbatim}
\begin{center}
Uncomment the next line and put your own figure in the file.
% \includegraphics[width=5in]{HW1P3F1.pdf}
\end{center}


\begin{exercise}{Octave Tutorial \# 9}
\newcommand\ml[1]{{\tt #1}}
Let $\displaystyle{\rm logistic}(x)=\frac{1}{1+e^{-x}}$.
\begin{itemize}
    \item[a.] Use Octave to define an inline function \ml{logisitic} for this function.
    \item[b.] Verify that your function works correctly by computing \ml{logistic(0)}, \ml{logisitic(1)}, and $\ml{logistic([0,1])}$.
    Do you obtain the right answers? (Hint: if you have a error when you test with vector input, think about the dot operators \ml{.*}, \ml{./} and so forth.)
    \item[c.] Plot the \ml{logistic} function over the range $-2\le x\le 2$.  Add a red square or diamond that marks the point $(1,{\rm logistic}(1))$.
\end{itemize}
Hand in a transcript of the Octave commands you used in parts a) through c) as well as a printout of your plot.
\end{exercise}
\solution
\begin{verbatim}
Your code here!
\end{verbatim}
\begin{center}
Uncomment the next line and put your own figure in the file.
% \includegraphics[width=5in]{HW1P4F1.pdf}
\end{center}

\end{document}