Philosophical Multicore

Sometimes controversial, sometimes fallacious, sometimes thought-provoking, and always fun.

Keyboard Genetic Algorithm

Posted by Michael Dickens on April 13, 2008

With help from Bilfo, I have designed a program in Ruby to score keyboard layouts, and a genetic algorithm program to determine the best layout. I got the idea from Michael Capewell who in turn got the idea from Peter Klausler. Unfortunately, because Ruby is a fairly high-level language, it takes a while to do things that could be done faster in Java or C.

I ran the program for 6 hours, and it generated this layout:

w f l m ; j p y , ‘
r s n t d h i o a e
z x c g v u b k . q

Through the scoring program, it got 6.3. However, Dvorak scores 5.8 on the genetic algorithm program. It has not yet generated a layout better than Dvorak.

Notes on the above layout:

The home row looks good. The 8 most common letters are on the home row, but e is on the pinky which is not good. I also notice that, like Dvorak, all the vowels are on one side of the keyboard. Other potential problems here are that C is on the bottom row, which some people like because it makes ctrl-c easy, but in terms of letter frequency it’s not the best spot. Also h and i are on the same finger, and hi is a pretty common digraph. Other than that, same-finger usage looks good.

Hmm, what is same finger usage? That is when the same finger is used twice in a row, like ed on QWERTY. It is a very bad thing, and slows down your typing a lot.

NOTICE: There is currently a small bug in the program which may cause a problem with scoring. The development team is working hard to fix it.


Leave a Reply

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

You are commenting using your 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

%d bloggers like this: