Friday, June 30, 2006

Advances, schmadvances

Sometime ago I bought some stamps. I thought that planes would be nice for a change, and I bought them without paying much attention. Only later I realized my mistake...

Welcome to American Advances in Aviation, 37c stamp collection!

B-29 Superfortress: the advanced armament... including remote controlled gun turrets... long-range bomber...

P-80 Shooting Star: ... jet fighter... made history in 1950 by winning the first all-jet aerial combat...

PBY Catalina: ... many still fly in nonmilitary roles.

247: ... first modern commercial airliner...

YB-49 Flying Wing: ... jet-propelled bomber... technology finally caught up with vision in the B-2 stealth bomber.

B-24 Liberator: ... heavy bomber... high-lift wing airfoils and retractable "roller-type" bomb bay doors were... innovations.

P-47 Thunderbolt: ... lightweight interceptor... immense multipurpose fighter...

F6F Hellcat: A WWII workhorse... easy to mass produce and maintain...

35 Bonanza: ... in continuous production since 1947...

Ercoupe 415: ... introduced safe, practical technologies for general aviation...

Aha. So in other words we have:

WAR: 6
WAR, originally: 1
Non WAR: 3

Sigh... we should be ashamed that most of these so called advances were made with the explicit purpose of killing people.

The lawyer bill is served

No more SCO for you, my friend.

Thursday, June 29, 2006

The cogwheels

A new day starts in the morning, and thus comes a new Perelman problem for you.

There are two cogwheels, a large one with 24 teeth, and a small one with 8 teeth. They are geared together such that the large one stays fixed in the center while the small one rotates around. How many revolutions will the small cogwheel perform while going once around the large cogwheel?

Tuesday, June 27, 2006

We can be honest if we look at a piece of paper

What a disappointment --- people behave in a more proper manner when faced by a photocopy of a pair of eyes. We could do it on our own, but no. What kind of very young kids are we?

Monday, June 26, 2006

The typists

This is the first problem from Perelman's books I chose to write about. One thing you have to be aware of is that the solution provided by him is extraordinarily simple. For example, I thought of resorting to calculus for the problem below. The suggested approach left me feeling like a complete idiot. So here you go: are you up to it?

Two typists have to type up a report. One of them is faster, and would need 2 hours to type it. The other one is slower, and would need 3 hours instead. But if they share the work, they would be able to finish it sooner. What is the minimum time they need to do the work together?


In the days of the Soviet Union, there was a fabulous book editing house called Mir. They took the best books they had and translated them into a multitude of languages. As the wall fell, so did Mir and now those fantastic books cannot be obtained anymore. It is a true pity, since the translations and editions were perfect.

I have an original copy of "Recreative Problems and Experiments", by Yakov Isidorovich Perelman. Mr. Perelman was more than a gifted bookwriter. Besides making all sorts of mathematical problems extremely interesting and fun to read, he also had a thing for different problems.

Eventually I got hold of more of his "recreative" books on mathematics, physics, and many other things. I had a great discussion about them with a friend today, and as a result I have decided to start reproducing the problems once a day or two. Hopefully you will find them interesting. The solution will be posted with the next problem.

Good luck!

Saturday, June 17, 2006

Scene Radio

Oh wow, I had not noticed it before, but has an electronica radio called Nectarine! How nice of them --- good, good stuff!!!

Sunday, June 11, 2006

Oh, so THAT is why...

So people that show how much they are pissed off get noticed quickest? Interesting...

Here are some other ways to get noticed real quick.

Wednesday, June 07, 2006

Brain surgery? No problem!

While working on the benchmarks between hashing and binary search, I found a way to improve how hashed collections are implemented in VisualWorks.

So I simply changed how Set and all its subclasses manage objects in their internal storage array.

I didn't need to recompile the whole development environment, much less bring VisualWorks down. None of that. Just apply the changes and then tell all those collections to rehash themselves.

Oh, by the way... time to have it done: less than 10 minutes!!!

Priceless. Isn't Smalltalk a nice place to work in? :)

Hash vs Binary Search

Ah yes, I just couldn't help it. Take a look at this article. The last paragraph essentially states that the performance advantage of hashing over binary search disappears as the data set grows.

This, even when the complexity of hash lookup is O(1), while that of binary search is O(log n). The article finishes by going as far as saying that this performance loss "is a good thing"... ???...

I'm sorry, but there is no way that can possibly be true. So to see what's the deal with that kind of assertions, I decided to run some tests myself.

I set up an array with integers from 1 to 10 million. I used binary search to look up the first million integers in this array. It took 22+ seconds*.

But of course, looking up 7 million integers in a set with 10 million integers took just 3+ seconds. In other words, it was roughly 50 times faster.

If O(1) cannot beat O(log n), it is anything but a "good thing". In fact, chances are it is because something is busted in the hash table department!!!

* My computer is far from state of the art.

Tuesday, June 06, 2006

A less famous quote from Alan Kay

If you don't read for fun,
you won't be fluent enough to read for purpose.

Saturday, June 03, 2006

The Smalltalk World Tour is on!

The comments of my previous post just made me realize we need something like a permanent wiki page where we can organize Smalltalker meetings. Thus, I started a Smalltalk World Tour page in Cincom's Wiki. Hopefully this works out for everybody!