tags:

views:

550

answers:

10

Would learning to program fractals help think clearly about certain set of programming problems?

+2  A: 

From what I remember you'll get a good handle on recursion if nothing else...maybe a little bitmap level programming as well...

Jason Punyon
There's no need to use recursion for plotting fractals. Most fractals I'm aware of, such as the Mandelbrot set use simple iteration.
recursive
Even when they are done with recursion, it is recursion with a limit, which would refactor to iteration anyway. Or at least every example I have seen has an explicit limit.
EBGreen
how else would recursion handle orbits and fixed points? IIRC there's a proof that for all N>=1 there exist cyclic nonterminating orbits of length N in the Mandelbrot set.
Jimmy
Stop being so pedantic about recursion. OF COURSE fractals will help teach recursion! +1
dwc
A: 

Any kind of programming experience is useful. So yes it is.

Especially for:

  • math problems
  • basic algorithms
  • and of course fractal programming
Gamecat
A: 

It'll maybe give you practice in implementing mathematical formulae.

Eclipse
A: 

Some fractals are good visual examples for explicit recursion; if you have a hard time with that concept, they might be good problems to work. You can start with "turtle graphics" style fractal paths like the Hilbert curve, or the classic "snowflake" fractal.

Many fractal-generation methods use heavy-duty number crunching (e.g., Mandelbrot and Julia sets). Number crunching is of course a field in itself, and tweaking your fractal generator to run as fast as possible can be a nice exercise in optimization.

comingstorm
A: 

I don't think programming fractals will teach you anything in particular. Depending on the fractal, I suppose it might teach you a bit about math or fractals in general.

However, I do think fractals are fun as an introduction to programming, and beginners/students are often fascinated by the result, be it more graphic fractals like mandelbrot or julia sets, or more easy to understand L-systems.

Of course, if you're new to programming, it'll also hopefully teach you a lot about programming in general. If nothing else, fractals are interesting to look at.

roe
A: 

when I was an undergrad, we used fractal drawing to power our work in parellel processing. It gets fairly computationally intensive quickly, so having multiple CPUs available to do the work lets you see a visible increase in efficiency.

So, along with recursion, I'd say it helps with learning how to balance CPU load across parallel processors.

... or if the equipment isn't available, it probably teaches you Zen-like patience. :)

bethlakshmi
+1  A: 

Fractals got me thinking about complex numbers and branch-points. Whether that was a good thing is, I suppose, a matter of opinion. :-)

Adrian Pronk
don't be ridiculous, of course that's a good thing :)
simon
+3  A: 

Fractal programming would introduce you to recursion, iteration, graphics programming concepts, image processing, and user interface design. From a mathematics point of view, you would learn about geometry, complex numbers, Mobius transformations (Kleinian fractals), Affine transformation (IFS fractals), root-finding methods (Newton fractals).

And on top of all this, you get the reward of seeing your efforts result in strange and unusual images.

+1  A: 

If you are a beginner such activity will surely help you to improve your skills. Apart from that programming fractal visualizations depending on the fractal type and the goal you set may give you some specific skills or knowledge like:

  • working with graphics, image processing;
  • understanding recursion and recursive structures;
  • optimization techniques;
  • low-level program optimizations;
  • understanding how computer operates (e.g. why resolution would be normally limited -> floating point precision and error accumulation);
  • parallel programming;
  • some mathematical improvement and extend your range of interest;
  • understanding various technologies (e.g. you can code Mandelbrot set in PixelBender which is really fast since may be executed on GPU);
  • understanding complex compression algorithms (e.g. some kind of fractal compression);
  • creativity (e.g. you invent your own fractal set coloring algorithm);
  • much more else :)

It is indeed a versatile and interesting field, lots of things to explore and learn. I used to draw fractals a lot :)

dragonfly
A: 

Great idea! I think coding up fractals makes a great "etude" (study) sized program. It has some nice features this way: generally you won't require much 3rd party code, they can be implemented in a reasonably short amount of time (and complexity) and you get something nice too look at in the end which also verifies your work.

Also there are loads of basic issues in both mathematics and the implementation of numerical algorithms that you will bump into if you do this.

From something as simple as a basic Mandelbrot set generator you can branch out into all sorts of issues as commenters have mentioned. Even sticking with just that, though, you can learn about optimization techniques (why is my generator so slow) and numerical issues (why can't I zoom past here), but also if you want to a bit of color theory (what's L*a*b* space anyway) and other bits and pieces.

Have fun!

simon