1. We have already found a variant expression and threshold for Conditions 1 and 2, showing that randomFractal does not result in infinite recursion. For Condition 3, we must show that the method has correct behavior for the stopping case. In this case, (rightX - leftX) is no more than STOP, and therefore the line segment does not need further dividing. We only need to draw the current line segment, which is what the method does. In Condition 4 of the inductive reasoning, we assume that the two recursive calls correctly generate a random fractal for the two smaller line segments we have created. Putting these two smaller random fractals together correctly gives us the larger random fractal.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here