Graphics Programs Reference
In-Depth Information
a 10-year period. So parts (e) and (f) relate more to investing than to
saving.Butsupposethemarketina5-yearperiodreturns13%,15%,
3%, 5%, and 10% in five successive years, and then repeats the
cycle. (Note that the [arithmetic] average is 8%, though a geometric
mean would be more relevant here.) Assume $50,000 is invested at
the start of a 5-year market period. How much does it grow to in
5 years? Now recompute four more times, assuming you enter the
cycle at the beginning of the second year, the third year, etc. Which
choice yields the best/worst results? Can you explain why? Compare
the results with a bank account paying 8%. Assume simple annual
interest. Redo the five investment computations, assuming $10,000
is invested at the start of each year. Again analyze the results.
3. In the late 1990s, Tony Gwynn had a lifetime batting average of .339. This
means that for every 1000 at bats he had 339 hits. (For this exercise, we
shall ignore walks, hit batsmen, sacrifices, and other plate appearances
that do not result in an official at bat.) In an average year he amassed 500
official at bats.
(a) Design a Monte Carlo simulation of a year in Tony's career. Run it.
What is his batting average?
(b) Now simulate a 20-year career. Assume 500 official at bats every
year. What is his best batting average in his career? What is his
worst? What is his lifetime average?
(c) Now run the 20-year career simulation four more times. Answer the
questions in part (b) for eachof the four simulations.
(d) Compute the average of the five lifetime averages you computed in
parts (b) and (c). What do you think would happen if you ran the
20-year simulation 100 times and took the average of the lifetime
averages for all 100 simulations?
The next four problems illustrate some basic MATLAB programming skills.
4. For a positive integer n , let A ( n )bethe n × n matrix withentries a ij =
1 / ( i + j 1). For example,
1
2
1
3
1
.
1
2
1
3
1
4
A (3) =
1
3
1
4
1
5
The eigenvalues of A ( n ) are all real numbers. Write a script M-file that
prints the largest eigenvalue of A (500), without any extraneous output.
( Hint : The M-file may take a while to run if you use a loop within a loop
to define A . Try to avoid this!)
Search WWH ::




Custom Search