Steve and Barry's closing out

If you look carefully, you'll see a "Store Closing" banner on the left, and a "New Styles Arriving" banner on the right. They're the same store, mind you!

Java and Scientific Computing

Lately, I've been using Java for something I never imagined I would: Running time bound simulations and collecting statistics. This started from an Advanced AI homework, which required us to evaluate different strategies for solving the 8 Puzzle.

Depth First and Breadth First search -- the most brute force of them all -- are real processor hogs. They take a good amount of time to get through solutions. I set up my simulations to try 8 puzzle combinations in groups. Each group had members which were an equal number of moves away from the solution. I'll call this the "distance" of a group from the solution. I started looking at groups with distances 1 through 10. The idea was to see how depth first search scaled with distance, while using multiple boards to average out the time (since boards were randomly generated). The simulation started out fine, but somewhere half way through, Java ran out of heap space causing me to lose half an hour worth of simulations. Terrific. So I fixed the heap space with a JVM switch to allocate 768 M. This time, Java didn't seem to die on space, but for some reason, started halting randomly. Here's a section of the simulation output. The first column is the distance of the board and the second is the run time in microseconds.


4 4.265305
4 0.399163

4 8058.812957

4 0.495941

4 4.762955

Now, the simulation is set up, to repeat a given run 5 times, to average out run times. So, the same board configuration is run 5 times for a given algorithm. The numbers above are the run times of the same algorithm on the same damn board! What gives!? A 4 microsecond difference is probably justifiable, but a full 8000 microseconds?


Now, I'm not sure if Java / the JVM is entirely to blame for such random spikes. In order to validate that, I'd have to rewrite this simulation in C++ and post similar numbers. Somehow, I doubt that the deviation in run times will not be this high. As of now, I'm treating this as an open problem. I'm certainly not assigning blame to Java, but its definitely complicit!

More to come.

[And no, there were no other CPU hogging processes running on the box at simulation run time. Certainly none that would cause such spikes.]

Are you a wanna-be Buffet?

Buy low, Sell high.

a.k.a Buy now.

Cubaholics Anonymous

Lately, I've been involved with a 3 dimensional species of puzzle that involves moving square shaped tiles around. Also known in technical parlance as "The Rubik's Cube". Up, down, right, away and right inverse goes my head. My fingers accordingly flex, extend, adduct, abduct and rarely circumduct (If you didn't understand those terms, go look up a kinesiology book (no I'm not a kinesiology major (and no, I do not like Lisp))). Such motion is usually accompanied by the creaking sounds of my aging cube.

Recently however, said creaking sounds have been replaced by their more intellectually acoustic cousins, called "speech".

"Hey, look at that guy. Think he's he okay?"
"You think he's gesturing at me?"
"Oh gosh, the poor fellow must be suffering from one of those diseases I heard about on TV!"
"You keep doing that son and next time, even if you have a cube with you, I'll give you a ticket." [1]

Yes, I am now a victim of Imaginary Cubesolveritis. To cut a long story short, if my fingers aren't already solving a cube, scribbling equations on a sheet of paper, typing away at a keyboard or stuffing food down my throat, then they're restlessly trying to solve an imaginary cube.

Its almost as though the urge to twist and turn faces and slices in a cube, is a wholly natural and evolutionary response to huge stacks of work lying right in front of me. The larger my pending work gets, the more I want to solve the cube. Till now, the only levee that deterred me from expending large swathes of time on the cube, was the fact that I did needed the cube to work on it.

This Saturday however, disaster struck this little home in Houghton, MI. The levee broke, releasing large amounts of solution attempts at my fingers. Who would have known? Katrina, Gustav, Ike and then ... Rubik. Tragedy I tell you, Tragedy.

... to be continued.

[1] The comment therein, is a result of a wholly unfortunate interaction between me, an imaginary cube, my car, a police officer and a stop sign (in that order) late Sunday night.
Note to self: Never take the stop sign overly seriously again. Not serious enough to wait a little more than a minute anyway.

Perhaps...

... I should just continue blogging here? Yes, all previous attempts of mine to work on my own blog scripts have been a terrific disaster. I hardly ever remember any of them leaving pre-alpha stages even.

Just perhaps.