% -*- latex -*-
% FILE: "/home/evmik/jobs/wm/2011_fall_practical_computing_for_scientists/hw01/hw01.tex"
% LAST MODIFICATION: "Tue, 23 Aug 2011 17:09:48 -0400 (evmik)"
% (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
% $Id:$
\documentclass[letter,12pt]{article}

%---------------------------------------------------------------
\usepackage{listings}
\usepackage{color}
\usepackage{fullpage}
%---------------------------------------------------------------

\begin{document}
\newcommand{\problem}[1]{%
	{\flushleft  \bf #1\\}
}
\newcommand{\subproblem}[1]{%
{\flushleft  {\bf Subproblem:} #1\\}
}

%---------------------------------------------------------------
\begin{center}
	{\bf \Large{Homework 01}} \\
\end{center}
%\author{Eugeniy E. Mikhailov}
%\date{\today}
%\date{}
%\maketitle

\problem{Problem 1 (2 points)}
%---------------------------------------------------------------
Find the value of the expression
\begin{equation}
	(3.2)^{4}-1+\ln(3)
\end{equation}
where $\ln$ is the natural logarithm (use \texttt{log} in Matlab).

\problem{Problem 2 (3 points)}
%---------------------------------------------------------------
Find the value of the expression
\begin{equation}
	\sin(2 \pi + \pi/3) + \tan(\pi/8)
\end{equation}
What variable name should you type to get numerical $\pi$ representation?
Does Matlab use degree or radians for angular measure?

\problem{Problem 3 (2 points)}
%---------------------------------------------------------------
Find the value of the expression
\begin{equation}
	e^{\sin(\pi/4)} - \log_{10}(25)
\end{equation}
Use \texttt{exp} for exponent function and \texttt{log10} for logarithm to
the base of 10.

\problem{Problem 4 (2 points)}
%---------------------------------------------------------------
Find the value of the expression
\begin{equation}
	\cos^2(\pi/3)
\end{equation}
Notice that human/mathematical notation is quite different from what Matlab
is expecting.

\problem{Problem 5 (4 points)}
%---------------------------------------------------------------
Find the largest number $x$ (one significant digit is enough) such that the
numerical evaluation of expression
\begin{equation}
	(1+x)-1
\end{equation}
equals to zero. The value of $x$ gives you an estimate of the relative
uncertainty of your calculations with Matlab, try to keep it in mind when
you do calculations. Note that $x$ is actually rather small. 

\problem{Problem 6 (4 points)}
%---------------------------------------------------------------
Find the value of the expression
\begin{equation}
	20/3-20\times(1/3)
\end{equation}
Algebraically you should get zero. If your result is not zero, please,  explain.

\problem{Problem 7 (3 points)}
%---------------------------------------------------------------
Find the numerical value of the expression
\begin{equation}
	10^{16} + 1 - 10^{16}	
\end{equation}
with Matlab.
Algebraically you should get 1. If your result is not 1, please,  explain.

%---------------------------------------------------------------
\end{document}
%---------------------------------------------------------------
