\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{color}
\usepackage[dvips]{epsfig}
\usepackage{graphicx}

%
\newcommand{\prob}[3]{\item[\textbf{#1.}] (\textit{expires #2})\quad{#3}}
\newcommand{\M}{{\texttt{Maple}}}
\newcommand{\m}{{\texttt{Maple}}}
\newcommand{\cmd}[1] {{\upshape \color{blue}\texttt{#1}}}
\newcommand{\ds} {\displaystyle}
\newcommand{\R}{{\mathbf{R}}}
\newcommand{\mb}{\mathbf}


\begin{document}

\begin{center}
{\large Math 331, Spring 2006, Problems}
\end{center}
\begin{enumerate}




%\setcounter{enumi}{1}
  

\item {Use \M\ to write  $x^5 - 2x^4 - 10x^3 +20x^2 -16x +32$ as a product of
{\em{exact}} linear factors.  By exact, I mean you should leave any
non-rational factors expressed as radicals; do not approximate terms
like $\sqrt{3}$ as 1.73205, etc.}



\item
{Consider the planar curve $\gamma$ defined by
$x^2 y^3 + y^2 + y -2 e^x =0$. Using \textbf{only} \M, find the slope
of the tangent line to the curve at $(0,1)$. Then plot the curve and
the tangent line on the same graph. \\
\emph{Hint: you might want to use \cmd{implicitplot} from the library 
\cmd{plots}. You might find \cmd{implicitdiff} helpful, too.}
}



\item{
Plot the function $f(x) = 2\sin x - x^3 - 5$,
for $x\in [-4,4]$. Find 
all the zeros of the function with an accuracy
of 20 decimal digits. \emph{Hint: See \cmd{Digits}, \cmd{fsolve}, and/or \cmd{evalf}.} 
Make sure you find \it{all} the zeroes. Justify your answer.
}



\item{ (EXTRA CREDIT) Define a \M\ function $g$ that, given a positive integer $k$
yields the sum of the first $k$ primes. What is $k$ such that $g(k) \le
100,000$ but $g(k+1) > 100,000$? 
You might find \cmd{sum} and \cmd{ithprime} helpful.
}






\item{Find a polynomial of degree 3  passing through the points 
$$(-3.3,1),(-2,2),(0,3),(1.1,4)$$ 
by two methods: First solve the equations (as  in the book). 
Second, use the build-in \m\ command. Check that the two solutions agree.
}


\item{
\begin{enumerate}
\item Find two polynomials of degree 5  passing through the points 
$$(-3.3,1),(-2,2),(0,3),(1.1,4).$$ 
\item Plot the two polynomials and the points in the same graph. 
\item Is it possible to find more polynomials of degree 5 passing through the 4 points? Why?\
\item How many polynomials of degree 3 passing through the 4 points can you find?
\end{enumerate}
}

\item{Find a polynomial  which passes through the points 
$$(-3, (-9)/4), (-2, (-3)/2), (-1, (-3)/4), (0, 0),$$
$$ (1, 3/4), (2, 3/2), (3, 9/4), (4, 3), 
(5, 15/4), (6, 9/2), (7, 5.35),(8, 6).$$ 
Then find a  piecewise linear function passing through them.

}

\item{Fit the points given in the previous problem to a line using the least square method. 
Plot the three results (the to of the previous problem, and the one you just 
obtained) and the points in the same graph. 
Compare the  results. Which one do you think is best and why?
}
\item{
Fit the points $(-1.9,-4.7), (-0.8,1.2),
(0.1,2.8), (1.4,-1.2), (1.8,-3.5)$ by means of a quadratic function
$f(x)=ax^2+bx+c$, using the least square method. First, do this
step by step, as we did in class; then, use the built-in \m\ command,
described in the notes. Check that the two solutions agree.
}


\item {
Fit the set of points
 $$(1.02,-4.30), (1.00,-2.12), (0.99,0.52), (1.03,2.51), (1.00,3.34),  
(1.02,5.30)$$
with
a line, using the least square method we used in class. You will see
that this is not a good fit. Think of a better way to do the fit and
use \m\ to do it.  Explain in your solution why you think your better
way is better. 
}




 \item
Following the book, prove
that if we describe the circle of center $(a,b)$ and radius $r$ using
the parameters $(a,b,k)$, with $k = a^2 + b^2 - r^2$, rather than the
more natural parameters $(a,b,r)$, then the error function $H(a,b,k) =
E(a,b,\sqrt{a^2 + b^2 -k})$ is quadratic in $a,b$ and $k$. What does
this imply about the number of critical points?(Note: You do not need 
\M\ in this exercise, altough you can use it as a word processor.
If you're more confortable with paper, you can turn in a
paper instead of a \m\ worksheet)

\item (EXTRA CREDIT)
With reference to the previous problem, show that, for $r > 0$, the
transformation $(a,b,r) \mapsto (a,b,k)$ is a
valid change of variables, that is, it is one-to-one. This should help you
prove that $E(a,b,r)$ has only one ``physical'' critical point, which
is a minimum, and is mapped, through the transformation, into the unique
critical point of $H(a,b,k)$. (Note: You do not need \M\ in this exercise, altough you can use it as a word processor.If you're more confortable with paper, you can turn in a
paper instead of a \m\ worksheet)

\item Fit the points $[[1,1],[2,3],[3,1],[1,-1.1]]$ to a circle.
  
\item Following the on-line notes, find a set of 25 points 
which are "approximately" in a cubic and:
\begin{enumerate} 

\item Find the cubic that best fit the points by the least squares method using the CurveFitting package. 
\item Find the cubic that best fit the points by the least squares method 
without using the CurveFitting package. 
\item (EXTRA CREDIT) Find the corresponding spline.
\end{enumerate}


 

\item{ \emph{[In this problem use \m\ only as a word
processor. If you're more confortable with paper, you can turn in a
paper instead of a \m\ worksheet.]} Let $n$ points of the form
$(r_i,r_i^2)$, $i=1,2, \ldots, n$, be given. What is the quadratic 
function $f(x)=ax^2+bx+c$ that best fits them? \textbf{Prove} your 
answer. Does it depend on the optimization method (least square or
others)?
}

\end{enumerate}
\enddocument
\item Proof the Newton's method formula $x_{i+1}=x_i-f(x_i)/f'(x_i)$ following the figures we did in class. (Note: You do not need \M\ in this exercise, altough you can use it as a word processor.If you're more confortable with paper, you can turn in a
paper instead of a \m\ worksheet)

 
\item Using \m\ write a program that uses Newton's method to help you find the real roots of the function 
$$f(x)=\frac{7}{8}x^5+\frac{23}{2}x^4+\frac{459}{8}x^3+\frac{541}{4}x^2+151x+65$$
Make a judicial choice of initial points by studying the graph of $f$. Do not use any built-in \M\ commands to solve equations. (Hint: When you plot the function, select carefully the horizontal and verical ranges.)


\item \begin{enumerate}\item Explore the situation (with the polynomial of the previous exercise) when  the choice of initial value is $x_0=-3$. Use a for-loop to find the trajectory of this point under Newton's iterations. Explain what happens. 
\item Explore the situation when $x_0=-3+10^{-9}$ and when $x_0=-3-10^{-9}$. Speculate about how well the method depends on the initial value.
\end{enumerate}
\item Consider the function $f(z)=z^2$. Find out which initial points of the complex plane converge to the (double) root by applying the iterations of Newton's method.


\item   For the polynomial
$f(x)=\frac{7}{8}x^5+\frac{23}{2}x^4+\frac{459}{8}x^3+\frac{541}{4}x^2+151x+65$

Make a plot that colors in different colors the points of the complex plane, according to which root of $f$ they approximate 
by iterating 
the associated  Newton'd method function.  Explain the picture obtained. (If you feel like it, you can add the roots of the polynomial to your picture...)

\item For the polynomial $p(z)=z^3-2 z$ find  the fixed points and  the points of period two and three. Show how are the points of periods two and three arranged in orbits.\emph{(Hint: Using \emph{fsolve, option complex} may  help in the computations.)}


\item (EXTRA CREDIT) Consider the polynomial $p(x)=x^2+c$ where $c$ is a real number. Describe the corresponding basins
of attraction of associated Newton function.





\item Consider the polynomial $P(z)=z^3+(0.125+0.545i) z+1.125+0.545i $. 
\begin{enumerate}
\item Plot (in different colors) the (different) basins of attraction of the associated Newton function.
\item Make a procedure that for each point in the complex plane, computes iterates of this point under the Newton function. It should compute at most 50 iterates, but it should stop when an iterate is "close enough" to a root (we will take $abs(f(z))<0.1$ as a measure of "close enough"). This procedure should return the number of iterations performed until being "close enough" to a root, or the maximum number of iterations (50).
\item Show that the orbit of z=0 does not go to a root under iteration of the associated Newton function. Describe what happens with this orbit. 
\item Are there more points in the complex plane with an that exhibits similar behavoir (to the orbit of z=0)? 
If your answer  is yes, show an example of an orbit whose behavoir is similar to the behavoir of the orbit of $z=0$.
\end{enumerate}



\item Consider the quadratic polynomial $P(z)=z^2+c$ where $c$ is a complex number. For each of the following values of $c$, first compute the "fate" of the orbit of $0$. Second, compute the filled Julia set. 
\begin{enumerate}
\item $c=-0.1-0.75i$
\item $c=0.12-0.75i$
\item $c=0.451+0.21 i$
\item $c=-0.5-0.55 i$
\item $c=-0.23+0.45i$
\end{enumerate}
Can you see any connection between the fate of the orbit of $0$ and the shape of the filled Julia set?
(Hint: Check whether different "pieces" of the set seem to be connected to each other or not). You can produce a picture with a grid with a small number of points in Maple and then check a more precise picture in the webpage

http://math.bu.edu/DYSYS/applets/JuliaIteration.html


\item Create a procedure that takes a polygon and a \textbf{linear} transformation 
yields as output the result of applying the transformation  to the  polygon. Find the 
coordinates of  the linear transformation that sends the 
blue (larger) square to the pink (smaller) square. Apply the transformation to the blue square. 
Test your result by plotting the two squares in the same graph. (Remark: In this exercise, you are asked to work with a \emph{linear} transformation, in class we worked with affine transformations.)

%\includegraphics{squares.eps}


\item Create a procedure that takes as input a positive integer and two real numbers
$a$ and $b$ 
and produces as output (the list of points corresponding to) 
an $n$-gon centered at $(a,b)$. Using this procedure, obtain a list of 21 decagons centered in 
$(0,0),(1,1),..(20,20)$ and plot them all in the same graph.


\item 
Create a procedure that takes a list of decagons and a linear transformation
gives as output the result of applying the linear transformation 
to all the decagons.
Using your procedure, rotate each of the decagons of your list by an angle of $\pi/4$. Plot 
the  decagons and their images in the same graph.




\item \begin{enumerate}

\item  Measure the length at each stage in constructing the Cantor set.  
Since the Cantor set is made by removing intervals, each of our 
measurements exceeds the length of the Cantor set, but we can look for 
a pattern and deduce the actual length. To begin, we cover the Cantor 
set with one interval of length 1. Next, we cover it with two intervals 
of length 1/3, so its length is less than 2/3. Continue this line of 
reasoning and make some conclusion about the length of the Cantor set.

\item Now measure the lengths of the intervals removed in forming the 
Cantor set and see what remains. For example, first we remove one 
interval of length 1/3, then two intervals of length 1/9, and so on. 
Using a calculator, add up the lengths removed (1/3 + 2/9 + ... ). What 
do you get for the length of the Cantor set?

\item  Do your answers for (a) and (b) agree?
\end{enumerate}



\item Compute perimeter and area of the snowflake

\includegraphics[scale=0.2]{snowflake.eps}


\item \begin{enumerate}
\item Find the IFS parameters to generate atractor  of the Picture: a 
right gasket of side length 2 and compute the similarity dimension.

\includegraphics[scale=0.5]{ex1.eps}

\item Find the IFS parameters to generate atractor  of the Picture: a 
right gasket of side length 4 and compute the similarity dimension.

\includegraphics[scale=0.4]{ex2.eps}

\item Find the IFS parameters to generate atractor  of the Picture: a 
right gasket of side length 6 and compute the similarity dimension.

\includegraphics[scale=0.3]{ex3.eps}

\item Find the IFS parameters to generate  a 
right gasket of side length s (where s is any positive integer) and 
compute the similarity dimension.


\item  Do the e and f parameters (the "translation part " of the 
parameters of the similarity ) have any effect on the dimension of the 
resulting fractal?

\end{enumerate}


\item \begin{enumerate}
\item  Compute the similarity dimension of the Cantor set 
formed from 
the unit interval by removing the middle half of the interval (as 
opposed to removing the middle third, in the usual construction).

\item  Compute the similarity  dimension of the Cantor  set formed from the 
unit interval by removing the middle 2/3 of the interval.

\item  Compute the similarity dimension of the Cantor s set formed from the unit 
interval by removing the middle 1/5 of the interval.
\end{enumerate}


\item Compute the similarity dimension of the Cantor set formed from the unit 
interval by removing the middle segment of length t, where t is any 
number $0 < t < 1$.

\item Compute IFS parameters and the similarity dimension of the following fractal.

\includegraphics[scale=0.3]{squares.eps}






\end{enumerate}

\enddocument








\end{document}

