hmmph. couldn’t run a program over the network… I know I’m close now, though… I just need to figure out a way to tell the computers here at school how to find my computer at home. My home computer can’t connect to the school’s X-Server for some reason. Rather annoying.
So Bio201 sucked. Boring stuff today. Math was boring, and yet interesting…. We talked about Newton’s Method. Newton’s Method lets you find an approximation of a point where a line crosses the X-axis (ie, X-intercept).
It’s really a genius little algorithim… it works like this:
Take a line: y=2x^3+4x^2-1
Where’s it going to cross the X axis? Well, _y_ is going to be negative at x=0 (y=-1). It’s going to be positive at x=1 (y=5).
So the line crosses the X axis somewhere between 0 and 1, right? Right.
Plug a number (we’ll call it _z_) between 0 and 1 into this equation:
alternatively it looks like this:
----- + z = a
where y(z) is the equation of the the line _y_ at point _z_, and y`(z) is the derivative of the line _y_ at point _z_.
and you get an approximation, _a_. _a_ is a point between 0 and 1 on the X-axis, that is relatively close to the X-intercept. Now, thats a fair approximation, but it could be really far off. So let’s plug our _a_ into that same equation, as _z_ this time.
We’ll get another _a_, probably different from the first one. This one should be closer to the X-intercept. Now here’s the kicker – you can keep doing this for as long as you like, and you will keep getting closer and closer to the right answer. The more the _a_ values start looking alike, the closer and closer you are.
That’s killer! I’ll explain better *why* it works later. But it’s a really clever little idea. Why does it suck? Well, cuz its math, silly. And why bother doing all that crap, when you can plug it into your calculator and get the right answer quicker? You’ll probably want to use a calculator to get the answer anyways when you divide!
No, the really cool part is that this would make a really neat program to write. You could do it it C, C++ or Java or something… you’d have to make a few sub-routines (functions, methods, whatever you like to call em) and a library backend wouldn’t be a bad idea for taking derivatives of stuff. It’s a great beginner to intermediate program to work on.
So its another one to try on a lazy day.
Sorry it was so long, I had to cram an hour’s lecture into a single journal entry.