Tuesday, August 26, 2008

Turtle Day 2008



Thank you to all who made TMNT Day 2008 a success.



Click here to see previous TMNT Days.

COWABUNGA!




Fibonacci and the C++ conundrum (part deux)

A few days ago, I posted a C++ program that I wrote that was supposed to calculate the fibonacci sequence. It worked up to the 46th number, and then things went a little wonky. I started getting negative numbers for some odd reason. (See what happened: HERE)

'War&' left me a comment saying that I should change my 'int's (variables assigned as integers) to 'long's (variables assigned as long numbers, which are capable of storing more information),

Friday, August 15, 2008

You're a new nerd... you don't count.

Someone told me this a few days ago, and it's really been bugging me. I was told that because my nerd-dom was started because I watched Iron Man it doesn't count. I'm only a nerd because I married one. And I really hate that. The fact that really kills me is she really believes this. Do you? And if so why? Why can't someone become a nerd? Yea, I know being a nerd isn't easy. I know you went through a lot of bullshit in high school and junior high... you think I didn't? No, I didn't read comic books, no I didn't see Star Wars 18 times when it was in the theater, no I can't name every Marvel or DC character or Dark Horse or any other comic brand but does that really matter?

I tried to argue this point with her. That I was a vampire dork, and a book dork... but yet she insists. I don't count. Why not? I was picked on in junior high... no I wasn't really picked on in high school... but that is because I was the scary goth girl. I have worked at one bookstore or another since Ieft college. Doesn't that count for something? I think it should. I have 6 book cases in my tiny little 2 bedroom apartment. Not everyone can say that. My friends are all nerds in some form or another. I have Clifton... the physics nerd, Rachael the Renaissance Faire and sci-fi nerd plus faeries and all sorts of other nerdness... I have Drewie... the comic book nerd. I have been surrounded by nerd-dom for as long as I can remember but apparently that doesn't count.

So now I need your opinion... do I count? I have started down the path of true nerdness... I have started reading graphic novels and learning to play chess... but I have always been a fantasy nerd... and a fractal nerd... and a vampire dork... and a faerie geek... and so on. Isn't that enough?

Fibonacci and the C++ conundrum




DISCLAIMER: the following Blog post involves computer programming. If this sort of thing bores you or confuses you, you might as well not read any further and instead I advise you to check out something nonsensical like LOLCATS. I wouldn't want to ruin your interweb experience.
---------------------------------------------------------------------

I was wondering how difficult it would be to write a program that would calculate the fibonacci sequence. After giving it a bit of thought, I decided that it didn't seem too hard, so I wrote the program using C++ and compiled the code using Dev C++.




The code seems simple enough. It looks like this:



#include iostream
#include stdlib.h
using namespace std;

int main(){

int first, second, num1,num2,num3;
int index=1;

first=1;
second=1;

do{
num1=first;
num2=second;

num3=num1+num2;

cout<< num1 <<" ";
index++;

first=num2;
second=num3;

}while(index<=45);

cin.get();
return 0;
}



Unfortunately.... things didn't go EXACTLY as planned....

Monday, August 4, 2008

Old Ben

Mandelbrot Set:



The Mandelbrot set is an infinitely complex fractal, composed by using the following seemingly simple equation:




When various numbers are used in place of the variable C, after several iterations, they will either tend to lead toward infinity, or they will lead toward zero. When constructing the Mandelbrot set, not only are Real numbers used, but also Imaginary numbers (such as i, 2i, 3i etc... where 'i' is defined as the square root of negative 1). Any number that leads toward infinity is discarded, and all other numbers remaining are considered elements of the Mandelbrot set.


For example, c = 1 gives the sequence 0, 1, 2, 5, 26; which leads to infinity. As this sequence is unbounded, 1 is not an element of the Mandelbrot set.


On the other hand, c = i gives the sequence 0, i, (-1 + i), -i, (-1 + i), -i, which is bounded, and so it belongs to the Mandelbrot set.




Fun Fact:
Only after infinite numbers have been placed into the equation Z = Z2 + C, will the full set be truly created. Since it is impossible for humans (or even computers for that matter) to input INFINITE numbers into the equation, we will never know (and CAN never know) the FULL mandelbrot set!!


However...


When computed and graphed on the complex plane using several hundred, thousand, million etc... numbers, the Mandelbrot Set is seen to have an elaborate boundary, which does not simplify at any given magnification. This qualifies the boundary as a fractal.











The infinite complexity of the Mandelbrot set is illustrated below:












The video above shows a magnification of the Mandelbrot set. The song playing in the video is Jonathan Coulton's "Mandelbrot Set". If you listen to the lyrics, he explains how to construct a Mandelbrot set. He also mentions other fractals such as the Koch curve, Seirpinski gasket, and Cantor Ternary Set.


ENJOY!!