Archive for June, 2008

Basilisk

Friday, June 20th, 2008

This is a very scary but brilliant science fiction short story. What a concept - an image that kills you if you remember it.

Sometime I'd like to write a story exploring and extending this concept, following a top-secret research group as they carefully reverse-engineer the Parrot to determine how to make images that can kill non-English speakers, and images which are more quickly acting. Their discoveries show the original to be an extremely crude "sledgehammer" for the human visual cortex and develop much clever and subtler images. Not all of them are deadly - some images can make people do things (immediately or in response to some later stimulus) before erasing themselves.

Yet another family of images creates particular emotional responses in their viewers - fear, joy, sorrow, comfort. One image in particular is programmed to make the viewer believe the image to be beautiful, and indeed test subjects report the image to be the most beautiful thing that they have ever seen - almost painful in its beauty. No-one who sees it ever feels quite the same way again, though most report the experience as positive - their spirits are lifted to know that such beauty is possible in the world. But if it is science that creates this effect, is it art?

Hakmem 2

Thursday, June 19th, 2008

I found the original hakmem to be a terrific read when I discovered it years ago - some really interesting bits of mathematics, puzzles, short programs, algorithms and hardware hacks. There is material enough in there to inspire several lifetimes worth of research.

But the world has come a long way in 36 years, and I think we're overdue for a sequel. I'm not the only person who thinks so.

Things that should be in Hakmem 2:

  • Quake's fast inverse square root.
  • Simon Tatham's Infinity Machine.
  • Puzzle: Solve Tetris on a grid of width 4. Tetris can only be lost, never won, so solving it means finding an algorithm that allows one to play indefinitely no matter what pieces are given. Btw, Tetris on a grid of width 4 is a fun game - very different strategies apply than for normal Tetris though.
  • Crash course in geometric algebra.
  • Hardware: The Joule Thief.
  • Use of space filling curves to make 2D maps of 1D spaces (or n-D binary spaces).
  • Techniques for drawing fractals (IFS, L-systems, escape time)
  • Solutions to Pentominoes on various grids
  • How to draw the INT curve from Godel, Escher, Bach (there are some clues here).
  • Top ten Perl one-liners.
  • Software Transactional Memory
  • Parsing using Parsing Expression Grammars

As well as a compendium of handy techniques, hakmems can be thought of as a zeitgeist - a gauge of what hackers are (or should be) thinking about at the time they were written.

Come to think of it, a lot of my blog entries would make good Hakmem 2 entries. Hmm...

Sugar rotation

Wednesday, June 18th, 2008

A while ago I was absent-mindedly twiddling a cylindrical jar of sugar that I used to keep at work (for tea purposes) and I noticed that when I rolled the jar across my desk it would stop quite quickly due to the friction of the sugar against itself.

Then I got to wondering what would happen if you put the jar of sugar on some sort of spit or lathe like device that would keep it turning over (not so fast that the sugar would spin around with the jar) and if the jar was a good insulator. The energy put in as rotation would build up in the sugar, heating it up and (presumably) eventually turning it into caramel. Weird.

XKCD movie

Tuesday, June 17th, 2008

I love the comic XKCD. I have a dream that one day an epic movie based on it will be made. I suspect that to be true to the original, it would have to consist of a series of short vignettes, only some of which have continuity.

As well as the overarching themes of "romance, sarcasm, math and language" it would have to have sudden adventure, geeks, physics, love, dreams, surreal imagery, raptors, red spiders, lisp, dadaism, algorithms, tin apples, meat cereals, wikipedia, "your mom" jokes, references to Richards Feynman and Stallman, and quite possibly the the map of all ideas that anyone has ever had.

It would be truly awesome. But it's probably even more awesome in my imagination than it would be in reality.

Magic inflation-linked currency

Monday, June 16th, 2008

Imagine if one measured the amount of money one had as a fraction of the total amount of money in the world rather than in arbitrary units. That way, when inflation happens, the number representing the amount of money you have goes down rather than prices going up.

Obviously that would be rather difficult to do with old-fashioned coins and notes but it would be trivial for a Cryptonomicon-style completely electronic currency. We'd probably use units of trillionths or thereabouts (or maybe "year 2000 dollars") to avoid having to write too many zeroes (and avoid accidents miscounting them).

One advantage of such a way of measuring money would be that the effects of inflation would be rather more obvious to people (at least, those of us who keep a more careful eye on our bank accounts than we do on the consumer price indexes) and might therefore discourage inflation somewhat. It would feel more like a tax (which, of course, is what it really is when it comes down to it - a very fair tax, I think, since the people with large reserves of cash seem to be the people who can best afford to pay taxes).

Another advantage is that it becomes easier to compare prices over time (since you don't have to adjust for inflation). A third is that things that tend not to be index linked (but which really should be, like salaries) would be more likely to.

A side effect would be that the velocity of money would greatly increase - cash would be a hot potato.

Use derivatives for SOI

Sunday, June 15th, 2008

This is an elaboration on a point from an earlier blog post.

Synchronous orbit iteration is a way of speeding up the calculation of fractals. The idea comes from the observation that the orbits of nearby points follow similar trajectories for a while. So one can take a rectangular array of points and subdivide them once a rectangular array no longer approximates them
well.

It seems to me that a better way to do this might be to compute some the derivatives of the iteration function and iterate them instead of a grid of points, for the same reason that the accuracy of numerical integration is usually better improved by switching to a higher-order method than by decreasing the step size.

This method simplifies the algorithm which determines whether to subdivide or not (just see if the magnitude of the highest derivative exceeds some limit, rather than looking for rectangularity - which amounts to the same thing for the second derivative).

It's also even easier to subdivide - instead of interpolating to find the intermediate iteration points, just evaluate the Taylor series.

Of course, I'll need to do some experiments to determine if this is truly a better method (at the moment there are some more fundamental changes that my fractal plotter needs before I can play with this sort of thing). As far as I can tell nobody's ever tried it before, though. Classical SOI is difficult enough to get right.

Everything I needed to know about life, I learned from "The Very Hungry Caterpillar"

Saturday, June 14th, 2008
  • When you are hungry, eat.
  • Fruit is good for you.
  • Eating too much junk food will give you a stomach ache.
  • Green leaves can cure all ills.
  • When you are not hungry anymore, stop eating.
  • When you want to change yourself, hide away while you do it.
  • Anyone can become something beautiful.

Genetic engineering - a danger to roads?

Friday, June 13th, 2008

A common argument against genetic engineering seems to be a perceived danger that a genetically engineered organism will escape into the wild and run rampant, smothering forests and other natural habitats.

However, this seems to be very unlikely to me. If such a successful organism were possible, evolution would have found it already.

If some species is going to spread rapidly, it is going to have to be in a niche that hasn't existed on evolutionary timescales. For example, suppose it is possible to have an organism which lives on road asphalt (extracting its energy from that material and in the process breaking it down) or concrete. If such an organism is possible it would likely take evolution tens or hundreds of thousands of years to find it (by which time, hopefully we will not be so reliant on it for our transportation needs).

But when genetic engineering is thrown into the mix (even if no organism is deliberately designed to eat roads) it is as if we are creating a whole new way of evolving (essentially genetic mutations that change many things at once and don't destroy the viability of the organism). The consequences seem likely to be a drastic increase in evolutionary speed, and consequently the more rapid filling of niches by genetically engineered organisms and their descendants.

It seems to me that it isn't the forests that we should be worried about with genetic engineering - it's the roads.

Background music for books

Thursday, June 12th, 2008

Normally when I read books I don't have music playing in the background as it's too distracting. But there have been occasions when (for one reason or another) I found myself reading a book and listening to music at the same time, and actually being able to concentrate on and enjoy both, particularly when the mood of the music seemed to fit the mood of the book.

It seems to me that this (with a bit of high tech magic) could be an entirely new multimedia experience - a system that plays appropriate music while you read.

It would be kind of difficult to implement, though, because everyone reads at different speeds and the speed isn't even consistent for a given person. So you'd need a computer program which can "recompose" music so that certain musical events can happen on demand. This isn't completely unheard of - I remember hearing about a roller coaster which had synchronized music which had to solve a similar problem (a roller coaster runs at different speeds depending on the mass of its payload.

Then you'd just need a system that could track your eyes to find out which bit of the book you were reading at any given moment.

Probably not possible yet but maybe in a few years.

Dreamland

Wednesday, June 11th, 2008

As I child I used to like to imagine that when I went to sleep, I would meet up with friends in dreamland and go on adventures with them. Only the friends I would meet up with wouldn't be my friends from my waking life, they would be different people from around the world (though consistent from night to night). I wonder if I got the idea from a book or a TV show?