% LaTex2e
\documentclass[12pt]{article}
%\usepackage{amssymb,latexsym}

\def\iff{\leftrightarrow}


\oddsidemargin 5pt \evensidemargin 5pt \marginparwidth 68pt
\marginparsep 10pt \topmargin 10pt \headheight 10pt
\headsep 15pt \footskip 35pt
\textheight = 625pt  \textwidth 440pt \columnsep 10pt \columnseprule 5pt

\pagestyle{myheadings}
\def\la{\langle}  \def\ra{\rangle}
\def\header{{\hfill Final\hfill A. Miller \hfill Fall 2003
                                       \hfill Math 210\hfill}}
\markboth\header\header
\newcount\probno
\newcount\total
\newwrite\examTBLFile



\probno=0


\def\prob#1{\advance\probno by 1  \vfill \newpage % \par
    \noindent\the\probno . (#1 pts)\advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}

\def\finishtbl{
    \immediate\write\examTBLFile{Total \string& \the\total
    \string& \qquad \string\\ \string\hline}
     }

%%% \outer\def\answer{ {\par\bigskip Circle your answer.} \par\medbreak

\newwrite\ans
\immediate\openout\ans=answers
\outer\def\answer{\par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\answerx{ \par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\putanswer{\par\medbreak
  \immediate\write\ans{}
  \copytoblankline}
\def\copytoblankline{\begingroup\setupcopy\copyans}
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
     \catcode`\|=12\obeylines}
{\obeylines \gdef\copyans#1
  {\def\next{#1}%
  \ifx\next\empty\let\next=\endgroup%
  \else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
\def\printanswers{\newpage\begin{center} Answers \end{center}
    \immediate\closeout\ans\input answers}

%\def\answer{\par\bigskip\bigskip\bigskip\noindent Answer: \par}


\begin{document}

\bigskip

Show all work.  

Simplify your answers.  

Circle your answer.

\bigskip

No notes, no books, no calculator, no cell phones, no pagers, no
electronic devices. 


\par\vskip .25in
\begin{center}
Name\makebox[3in]{\hrulefill} \\
\end{center}

\bigskip
Circle your Discussion Section:
\begin{verbatim}
       DIS 332   9:55 R 395 VAN HISE            
       DIS 331   9:55 T  52 BASCOM            
       DIS 335 12:05p T 123 INGRAHAM            
       DIS 336 12:05p R 114 INGRAHAM
\end{verbatim}
\bigskip

\begin{center} \Large
 \begin{tabular}{||c|c|c||} \hline\hline
  Problem & Points & Score \\  \hline\hline
   \input{exam.tbl}
  \hline \hline
 \end{tabular}
\end{center}

\immediate\openout\examTBLFile=exam.tbl

\bigskip
 
Solutions will be posted shortly after the exam:
www.math.wisc.edu/$\sim$miller/m210



\setcounter{page}{0}

\newpage 

\prob{32} % 1.2 -23  from exam 1
Let A and C be sets with $A\subseteq C$. 
Suppose that $n(A)=4$ and $n(C)=12$.  
In how many different ways can you select $B$ so that 
$A\subseteq B$, $B\subseteq C$, and $n(B)=6$?

\answer $28$


\prob{32} % 2.4 - ? from exam 1
At another ballroom dance lesson there are the same 4 girls and 5 boys.  
Recall that one of the boys
is Mortimer who has a secret crush on one of the girls, Hortense.  At
the end of the lesson the instructor puts slips of paper
with the boy's names in a bucket and slips of paper with the girl's
names in another bucket.  He randomly draws one boy's name and one girl's name
and has the couple demonstrate the Waltz.  He then returns the two
slips to their respective buckets and repeats the drawing procedure
and has this couple demonstrate the Rumba.   

\bigskip (a)  What is the probability that Mortimer and Hortense demonstrate
both dances?

\vfill 

(b)  What is the probability that Mortimer and Hortense demonstrate at
least one of the two dances? 

\vfill

\answer (a) $1/400$  (b) $39/400$


\prob{32} % from exam 2m see p.242  - like problem 8 exam 2
A farmer wishs to mix two feeds for her dairy herd  to provide the necessary
calories, vitamins, and minerals at minimum cost. The amounts of each found in
feeds $F_1$ and $F_2$ are as follows. $F_1$ provides 3 units per pound of
calories, 1 unit per pound of vitamins, and 1 unit per pound of minerals. 
$F_2$ provides 4 units per pound of calories, 1 unit per pound of vitamins, and
5 units per pound of minerals. The minimal requirements per cow per day are 340
calorie units, 100 vitamin units,  and 150 mineral units.  $F_1$ costs 3
dollars per pound and $F_2$ costs 5 dollars per pound.   If the farmer wants to
minimize the total cost of her feed mix,  how many pounds of each feed should
she use?
\answer Minimize $z=3x+5y$ subject to 
$$x,y\geq 0$$ $$3x+4y\geq 340$$
$$x+y\geq 100$$  
$$x+5y\geq 150$$ 
The critical points are
$(0,100),(60,40), (100,10),(150,0)$. The minimum occurs
at $x= 100$ pounds of $F_1$ and $y=10$ pounds of $F_2$.

\prob{32} % 5.3 from exam 2
Find all solutions of the systems of equations:

$$x-y+3z=4$$
$$2x+y =2$$
$$x+z=2$$
\answer There are infinitely many solutions. One description of this
set is: $z$ anything, $y=2z-2$, and $x=2-z$.

\prob{32} % p. 157 Campbell-Spencer
A hotel chain is considering the construction of a resort hotel at a
certain beach. On sunny days in the summer season, the hotel can expect to
fill its anticipated 200-room facility. On rainy days during the summer
season, the experience of existing hotels shows that a 50 per cent capacity
can be expected, while on cloudy days a 75 per cent capacity can be
expected. The Weather Bureau records indicated that during the summer
season at that location, there is a 70 per cent probability of clear
sunny weather, 10 per cent probability of rainy days and 20 per cent
probability of cloudy days.  Let $X$ be a random variable denoting
the number of rooms rented on one day in the summer.  What is the expected
value of $X$?  

\answer $E(X)=200(.7)+100(.1)+150(.2)=180$. 


\prob{20} % chapter 8.3-18
Consider a Markov chain whose transition matrix is 
$$A=\left[
\begin{array}{ccc}
.3 &  0  & .7  \\
.2 &  .1 & .7 \\
.4 &  .6 & 0  \\
\end{array}\right]
$$
In which state is the sytem least likely to be in the long run and
what is the probability that it is one of the other two states?

\answer The stable vector is $({16\over 51}, {14\over 51}, {21\over 51})$
so the answer is ${37\over 51}$


\prob{20} % chapter 8
(Drunkard's walk).  A drunk is stumbling along a sidwalk. He randomly  lurches
forward at each step. With equal probability he lurches either one unit
straight forward, or one unit forward and one unit left, or one unit forward
and one unit right.  You can visualize his progress by thinking of him as
walking along the integer points $(m,n)$ in the plane. If he is at the point
$(m,n)$, then he lurches upward to one of the points $(m-1,n+1)$, $(m,n+1)$, or
$(m+1,n+1)$.  See example walk below left.

The y-axis is a wall. 
If he is at any point $(1,n)$ and tries to
move to $(0,n+1)$ at the next step he bounces off the wall and moves
to $(1,n+1)$ instead, so he is twice as likely to move to $(1,n+1)$ as
to $(2,n+1)$.

The line $x=5$ is the gutter, if he falls into it he can't get out.


(a) Draw a Markov graph using the states $1,2,3,4,5$ representing the 
$x$-coordinate of his position.  Find the transistion matrix $A$.

(b) What is the probability that starting at the point
$(3,0)$ that he takes $100$ steps and does not fall into the gutter?
(You may express your answer in terms of $A^n$ for appropriately chosen
$n$, please do not explicitely calculate $A^{100}$.)



\bigskip

\unitlength=1.00mm
\special{em:linewidth 0.4pt}
\linethickness{0.4pt}
\begin{picture}(60.00,50.00)(8,8)
\put(10.00,10.00){\line(1,0){50.00}}
\put(10.00,10.00){\line(0,1){35.00}}
\put(20.00,5.00){\makebox(0,0)[cc]{1}}
\put(30.00,5.00){\makebox(0,0)[cc]{2}}
\put(40.00,5.00){\makebox(0,0)[cc]{3}}
\put(50.00,5.00){\makebox(0,0)[cc]{4}}
\put(60.00,5.00){\makebox(0,0)[cc]{5}}
\put(5.00,20.00){\makebox(0,0)[cc]{1}}
\put(5.00,30.00){\makebox(0,0)[cc]{2}}
\put(5.00,40.00){\makebox(0,0)[cc]{3}}
\put(30.00,20.00){\circle{2.00}}
\put(30.00,30.00){\circle{2.00}}
\put(20.00,40.00){\circle{2.00}}
\put(40.00,10.00){\circle{2.00}}
\put(38.00,11.00){\vector(-1,1){7.00}}
\put(30.00,21.00){\vector(0,1){6.00}}
\put(29.00,31.00){\vector(-1,1){7.00}}
\put(22.00,41.00){\vector(1,1){7.00}}
\put(30.00,49.00){\circle{2.00}}

\put(70.00,30.00){\circle{8}}
\put(70.00,30.00){\makebox(0,0)[cc]{1}}

\put(90.00,30.00){\circle{8}}
\put(90.00,30.00){\makebox(0,0)[cc]{2}}

\put(110.00,30.00){\circle{8}}
\put(110.00,30.00){\makebox(0,0)[cc]{3}}

\put(130.00,30.00){\circle{8}}
\put(130.00,30.00){\makebox(0,0)[cc]{4}}

\put(150.00,30.00){\circle{8}}
\put(150.00,30.00){\makebox(0,0)[cc]{5}}

\end{picture}

\def\third{{1\over 3}}
\def\twothird{{2\over 3}}

\answer (a) 
$$A=\left[
\begin{array}{ccccc}
\twothird &  \third  & 0 & 0 & 0  \\
\third &  \third & \third & 0 & 0 \\
0 & \third &  \third & \third & 0   \\
0 & 0 & \third &  \third & \third  \\
0 & 0 & 0 & 0 & 1\\
\end{array}\right]
$$
(b) $1-entry_{3,5}(A^{100})$


\prob{20} % 9.2 -15
A car is advertised in the newspaper as follows:  You receive a cash bonus $B$
of \$3275 together with your car (i.e., the reverse of a down payment).  In
return for which you must pay 30 monthly payments $p$ of \$398 each.    The
first payment is to be made exactly six months after you receive the car and
cash bonus.     If the monthly interest rate for car loans is $i=.004825$ per
month, what is the cost $C$ of the car?  This is the same as asking what would
you expect to pay for the car in cash on the day of the sale, instead of the
bonus plus payments deal being offered.

\answer The buyer gets the bonus $B$ and the car or equivalently
the cash value of the car $C$. 
The seller gets the present values of the 30 payments. 
In a fair deal each one gets the same, otherwise they will not be willing
to make the exchange.
Hence
$$B+C={p\over{(1+i)^6}}+{p\over{(1+i)^7}}+\cdots+{p\over{(1+i)^{35}}}$$
where $B=3275$, $p=398$, and $i=.004825$. So 
$$C={p\over{(1+i)^6}}+{p\over{(1+i)^7}}+\cdots+{p\over{(1+i)^{35}}}-B$$
Using the geometric series formula this can also be written:
$$C={p\over{(1+i)^6}}
\left({{1-{1\over{(1+i)^{30}}}}
\over 
{1-{1\over{(1+i)}}}}\right)-B$$



\prob{20} % 9.3 -15

Mrs Jones wants to buy her son Max an IPOD for a present. She plans to pay for
it by making two deposits in her savings account.  The first deposit she makes
on Nov 1, 2003 and the second on Dec 1, 2003.   The second deposit will be
twice as large as the first.  On Feb 1, 2004 she pays for the \$300 IPOD by
withdrawing the money from her account.  Her savings account earns $1/2$\% a
month in interest.   What is the size of the smaller deposit?

\answer Let $i=.005$ and let $p$ be the amount of the first deposit. 
The amount of the second deposit is $2p$.  
The amount in the savings account on Feb 1 is $p(1+i)^3+2p(1+i)^2$.
Hence
$$300=p(1+i)^3+2p(1+i)^2$$
and so
$$p={300\over{(1.005)^3+2(1.005)^2}}$$


\finishtbl

\printanswers

\end{document}


