Solutions to Background Knowledge Probe, Due August 27, 2010 

Math 489/889, Stochastic Processes and Advanced Mathematical Finance 

Steven R. Dunbar 

Department of Mathematics and Statistics 

University of Nebraska-Lincoln 

Lincoln, NE 68588,  

 

sdunbar@unl.edu 

www.math.unl.edu/~sdunbar 

>
 

Problem 1 

\item % Present value calculations
 Suppose that you win $10,000 in the Nebraska Lottery Mega Millions game.  Your financial advise gives you the choice of the following payouts for the prize.
 \begin{enumerate}
   \item \$10,000 now
   \item \$10,300  1 years from now
   \item \$245 a year forever, starting now
   \item \$1,025 for each of the of the next ten years
 \end{enumerate}
Which is the most valuable prize in terms of present value?
 

Assume the interest rate is 3\% and is compounded continuously 

(roughly the est available rate at the time of writing this probe.) 

> with(finance);
 

[amortization, annuity, blackscholes, cashflows, effectiverate, futurevalue, growingannuity, growingperpetuity, levelcoupon, perpetuity, presentvalue, yieldtomaturity]
[amortization, annuity, blackscholes, cashflows, effectiverate, futurevalue, growingannuity, growingperpetuity, levelcoupon, perpetuity, presentvalue, yieldtomaturity]
(1.1)
 

(a) Has a present value of $100,000 

> `assign`(r, 0.3e-1); 1
 

0.3e-1 (1.2)
 

> apr := effectiverate(r, infinity);
 

0.30454534e-1 (1.3)
 

> apr_direct := exp(r)-1;
 

0.30454534e-1 (1.4)
 

> PVb := presentvalue( 10300, apr, 1);
 

9995.588995 (1.5)
 

> PVb_direct := 10300/exp(r*1);
 

9995.588995 (1.6)
 

> PVc := perpetuity(245, apr);
 

8044.779145 (1.7)
 

> PVc_direct := sum( 245/exp(r)^n, n = 1..infinity);
 

8044.779145 (1.8)
 

> PVd := annuity(1025, apr, 10);
 

8723.210932 (1.9)
 

> PVd_direct := sum( 1025/exp(r*n), n = 1..10);
 

8723.210941 (1.10)
 

>
 

> restart;
 

Problem 2 

\item %Interest calculations

A investment of \$232 will be worth \$312.18 in 2 years.  What is the
annual interest rate assuming quarterly compounding?  Assuming
     continuously compounded interest?
 

> apr := fsolve( 312.18 = 232.0*(1 + r/4)^8, r = 0..1);  # note the need for the interval to coach Maple to find positive solutions
 

.1512092724 (2.1)
 

> apr := fsolve( 312.18 = 232.00*exp(2*r), r);
 

.1484212864 (2.2)
 

> restart;
 

Problem 3 

\item %Calculating binomial probabilities
Each day a stock moves up one point or down one point with
     probabilities $1/3$ and $2/3$ respectively.  What is the
     probability that after 4 days, the stock will have returned to
     its original price?  Assume the daily price fluctuations are
     independent events.
 

The stock can return to its original price if and only in the four days, it has increased twice and decreased twice.  That is, out of four independent trials we have 2 successes (up days) and consequently 2 failures (down days). 

> prob := stats[statevalf,pf,binomiald[4,1/3]](2);
 

.2962962963 (3.1)
 

> prob_direct := binomial(4,2)*(1/3)^2*(2/3)^2;
 

`/`(8, 27) (3.2)
 

> evalf(%);
 

.2962962963 (3.3)
 

>
 

> restart;
 

Problem 4 

\item % Calculating binomial and geometric probabilities
Consider a roulette wheel consisting of 38 numbers, $1$ through $36$,
$0$ and double $0$.  If Bond always bets that the outcome will be one
of the numbers $1$ through $12$, what is the probability that Bond
will lose his first $5$ bets?  What is the probability that his first
win will occur on his fifth bet?
 

> prob_5_losses := ((38-12)/38)^5;
 

`/`(371293, 2476099) (4.1)
 

> evalf(%);
 

.1499507895 (4.2)
 

> prob_win_on_5 := ((38-12)/38)^4*(12/38);
 

`/`(171366, 2476099) (4.3)
 

> evalf(%);
 

0.6920805671e-1 (4.4)
 

>
 

> restart;
 

Problem 5 

\item % Calculating normal probabilities
If $X$ is a normal random variable with parameters $\mu = 10$ and
$\sigma^2 = 36$, compute
\begin{enumerate}
 \item $\Pr[ X > 5]$
 \item $\Pr[4 < X < 16]$
 \item $\Pr[X < 8]$
 \item $\Pr[X < 20]$
 \item $\Pr[X > 16]$
\end{enumerate}
 

> Pra := 1 - stats[statevalf,cdf,normald[10, 6]](5);
 

.7976716190 (5.1)
 

> Prb := stats[statevalf,cdf,normald[10, 6]](16) - stats[statevalf,cdf,normald[10, 6]](4);
 

.6826894922 (5.2)
 

> Prc := stats[statevalf,cdf,normald[10, 6]](8);
 

.3694413402 (5.3)
 

> Prd := stats[statevalf,cdf,normald[10, 6]](20);
 

.9522096477 (5.4)
 

> Pre := 1 - stats[statevalf,cdf,normald[10, 6]](16);
 

.1586552539 (5.5)
 

>
 

> restart;
 

Problem 6 

\item % Using normal approximation to the binomial
In $10,000$ independent tosses of a coin, the coin landed heads $5800$
     times.  Is it reasonable to assume the coin is not fair? Explain.

 

> mu := 10000/2; sigma := sqrt(10000*(1/2)*(1/2));
 

 

5000
50 (1)
 

> Z := (5432 - mu)/sigma;
 

`/`(216, 25) (2)
 

> significance := 1 - stats[statevalf,cdf,normald[0, 1]](16);
 

0. (3)
 

It is reasonable to believe the coin is not fair.  The coin came up heads more than 16 standard deviations away from the mean, an event that is virtually impossible under the null hypothesis that the coin is fair. 

> restart;
 

Problem 7 

Suppose that $X$ is a random variable having the probability 

 density function 

 $$ 

    f(x) = \begin{cases} R x^{R-1} & \text{ for $0 \le x \le 1$} \\ 0 & 

    \text{ elsewhere } \end{cases} 

 $$ 

    \begin{enumerate} 

      \item Determine the mean $E[X]$. 

      \item Determine the variance $\Var[X]$ 

      \item Determine the standard deviation. 

    \end{enumerate} 

 

> assume( R > 0);
 

> density  := R*x^(R-1);
 

`*`(R, `*`(`^`(x, `+`(R, `-`(1))))) (7.1)
 

> check_density := int( density, x = 0..1);
 

1 (7.2)
 

> mean := int( x*density, x = 0..1);
 

`/`(`*`(R), `*`(`+`(R, 1))) (7.3)
 

> variance := int( (x - mean)^2 * density, x = 0..1);
 

`/`(`*`(R), `*`(`^`(`+`(R, 1), 2), `*`(`+`(R, 2)))) (7.4)
 

> standard_deviation := sqrt( variance);
 

`/`(`*`(`^`(`/`(`*`(R), `*`(`+`(R, 2))), `/`(1, 2))), `*`(`+`(R, 1))) (7.5)
 

Problem 8 

\item %Calculating moments and variances. 

     %Adapted from Problem 40, page 78 of S. Ross, {\it Introduction 

     % to Probability Models}, S. Ross, Academic Press, 1985.  

If $X$ is a uniformly distributed random variable over $(0,1)$, then 

     calculate $E[X^n]$ and $\Var[X^n]$ for $n=1,2,3,\dots$ 

 

> assume(n, posint);
 

> nth_moment := int( x^n, x = 0..1);
 

`/`(1, `*`(`+`(n, 1))) (8.1)
 

> nth_variance := int( (x^n - nth_moment)^2, x = 0..1);
 

`/`(`*`(`^`(n, 2)), `*`(`^`(`+`(n, 1), 2), `*`(`+`(1, `*`(2, `*`(n)))))) (8.2)
 

> subs( n = 1, nth_variance);
 

`/`(1, 12) (8.3)
 

>
 

>