Documente Academic
Documente Profesional
Documente Cultură
Phooey!
The subject of AI brings out these same fears in many people - the
strange mysterious something called pattern recognition associated
with the field of higher computer science of Artificial Intelligence.
Relax! It really is very simple and easy to understand. After you
see what's going on you'll probably ask yourself "Why didn't I think
of that?".
Keeping that in mind, run the program called SMART and watch it
operate for a while. This compiled version of FRACAI.C picks a random
point on the screen and displays the successive iterations used to
determine if it belongs in the Mandelbrot set. Have a cup of coffee,
sit back, and see if you can figure out the criteria the program is
using to decide if it's time to move on to the next point.
Now press 'Esc' and the program will exit after it is done the current
point. Run the program called STUPID. The only difference between
SMART and STUPID is the variable 'IQ' in STUPID is set to zero. This
means the program does no pattern detection and goes strictly by
iterations before moving on to the next point. Let it run for as long
as you can stand to watch it.
Had enough? Ok, go ahead and say it, "You STUPID program! Can't you
see that your iterating on the same dumb points!?" And in truth, no
it can't.
What happens during the calculation is that sometimes 'i' and 'j'
converge onto one or more points and gets caught in and endless loop
of successive iterations producing the same 'i' and 'j' combinations.
Once it can be seen that the points have converged into a pattern
there is no need to continue iterating. Nothing to it!
Run the program SMART again and we'll continue. Have you got a
printout of FRACAI.C handy? Good.
The same applies for higher periodicities. Pick a point, any point,
and see if the iterations repeatedly come back the that point at a
fixed interval. If after a bit you don't see a pattern then you can
assume that the iterations have not converged yet. In that case we've
already gone through a number of iterations and maybe it's converged
into a pattern that doesn't include the point we chose earlier, so
pick another point.
The implementation I've found for far that works best is to double the
value of 'CheckEvery' whenever it picks a new point. This catches the
small periodicity patterns right off the bat and quickly expands it's
scope to catch the larger ones.
In theory there should be no need for an iteration limit in the
calculation process since the calculations will always, after some
period of time, either cause the program to bail out on overflow or
detect a convergence into a pattern. In practice after a certain
number of iterations I really don't care if a particular point
converges or not, I just want to get on to the next point.
You'll probably have noticed that I've been comparing points on the
screen rather than using the actual values of each successive 'i' and
'j'. There is a very good reason for this. Of the 15 significant
digits available in a double value roughly only half of those digits
are significant after many calculations due to roundoff errors
anyways. Besides, if I get a convergence that is beyond the
resolution of the video display then that's close enough for
government work!