The Loneliest Integer

Since I started my PhD I’ve spent a lot of effort setting myself goals each week to make sure I actually get something done. Sadly, because this is the real world and my brain doesn’t take real world things into account, my attempts at meeting these goals have been an omnishambles. Consider the goal I set myself the week before last; get my particular algorithm working. Does it work?

Well, of course it doesn’t!

What a silly rhetorical question.

Or at least, it didn’t until just now! In a bid to be able to show my supervisor that I have actually done some work in the past month, I have spent eight hours today trying to find out why the hell my algorithm worked on the nice easy “test case” but not on the real-world “difficult” problem. I tracked down the root of the problem, but didn’t know how to solve it. Here’s a picture that sums it up;

This picutre, imaginatively titled "ITDOESNTWORKWHYOHWHYDOESNTITWORK.png"

This picture is imaginatively titled “IT_DOESNT_WORK_WHY_OH_WHY_DOESNT_IT_WORK.png”

The black lines and the blue lines should be going the same way. They aren’t. The black lines are what my program does, the blue lines are what it SHOULD do – I only know where the blue lines are because I calculated them by hand. The thing is that until just now I had no freaking idea why it was doing this. Because I’d spent an entire day doing maths and it wasn’t working. Because 8 hours sitting staring at a computer screen saying “what’s wrong?” over and over and over and over again sends you just a LITTLE BIT crazy. I may have come out with the following at one point;

I’ve got a Real Array called ‘Problems’ and it’s 99 elements long! #NerdJayZ

The problem was sending me up the wall (and it was 10pm by this point), so I went back to basics and redid some of my maths. What did I get wrong? A big thing? Did I miss a term out of the equation? Did I integrate instead of differentiating? Did I start out by writing down the wrong function?

Oh, I just put a 1 in somewhere there should have been a 0. That’s innocuous enough, right? I mean – what difference could just a 1 possibly make?? Well, when I removed the 1 it did this;

This picture inevitable entitled "IT_WORKS_OH_THANK_FUCK_IT_WORKS.png"

This picture is inevitably entitled “IT_WORKS_OH_THANK_FUCK_IT_WORKS.png”

Sometimes I hate Mathematics with a real passion.

Advertisements

About stoove

A physicist, researcher, and gamesman. Likes to think about the mathematics and mechanics behind all sorts of different things, and writing up the thoughts for you to read. A competent programmer, enjoys public speaking and mechanical keyboards. Has opinions which might even change from time to time.
This entry was posted in General Science, Opinion, Physics and tagged , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s