Wednesday, April 05, 2006

Asian junk food and higher math

One of my coworkers just got back from Taiwan and brought back these little, individually packaged cakes for everyone. I looked closely at the pattern printed on the box, and I recognized it as a fractal -- specifically in the cos/cosh/exponential family. I pointed this out to her and wrote a little program to make a similar design:

coshz

The above image was generated using the iterative formula Z(n+1) = cosh(Z(n)). Z is a complex number, and n is an iteration counter. Z(0) is the initial condition, corresponding to the coordinates of a pixel in the image.

Each pixel in the image is colored according to the result of the iterative formula. If you have a calculator with a cosh function (the Windows Calculator utility has one: Hyp+cos), you can see for yourself that no matter what number you put in, when you keep hitting the cosh button, the number in the display keeps getting bigger until you reach numeric overflow. The question is how fast you get there. Points that are more yellow and green in my picture take longer to "escape" than points that are more red.

As for the cake, mmmmm... It had a pineapple filling and very high fat content. You don't need a degree in mathematics to understand this formula: SUGAR + FAT = TASTY.

As long as I'm on the subject of the oddities of Asian food packaging, I should also mention the bag of chips I recently got at my local Asian grocery. They were identified as bean crackers, but without any actual beans, unless you count the peanuts. It's hard to describe, but you can find more information about the product online. Mixed in with the assorted bean chips were dried anchovies, and these were displayed in larger-than-life photographic detail on the outside of the bag, heads and all. With their eyes staring out at me, how could I resist? I was disappointed, though; there weren't nearly as many anchovies as the packaging would lead you to believe.

0 Comments:

Post a Comment

<< Home