404 THE HANDBOOK OF PORTFOLIO MATHEMATICS
actual value atRR(.6,10) just presented (i.e., 10 billion iterations forq= 10
actually versus 6,250,000! This is .000625 of the time!):
qRR(.6)
1 0.015873
2 0.047367
3 0.07433
4 0.097756
5 0.118505
6 0.136475
7 0.150909
8 0.16485
9 0.178581
10 0.191146
11 0.202753
12 0.209487
13 0.21666
14 0.220812
15 0.244053
16 0.241152
17 0.257894
18 0.269569
19 0.276066
20 1
Note that atq=20 we haveRR(.6)=1. This is merely an indication
that we have overflowed the value for a long data type in Java.^8 This is still
far from the asymptote.
Also note the floating point roundoff error even atq=1. This value
should have been 0.015625, not 0.015873.
These calculations were performed by extending the class of the previ-
ous Java program earlier in this chapter, and is included herein:
import java.awt.;
import java.io.;
import java.util.*;
public class MaxTWR4VARWithProbs extends MaxTWR4VAR{
double probs[][];
double probsarray[];
double probThisB;
(^8) Again, all of the code presented here can, even under present-day Java, be made
far more efficient and robust than what is shown here. This is merely presented as
a starting point for those wishing to pursue these concepts in code.