Tech

Putting cryptoloop back in Debian

For reasons detailed in Debian Bug #559961 the cryptoloop module has been dropped from the Debian kernel as of the 2.6.32-trunk binary packages. I've filed a complaint at that bug. I know what I'm doing, and am unhappy that the Debian kernel maintainers have taken it upon themselves to gratuitously delete functionality from the Linux kernel image…

Notes on getting Debian Gnome Bluetooth working

This is a rought-draft page that I'm making to take some notes on how I got the Debian Gnome Bluetooth support to work this time around. Bluez and its supporting utilities are an endless source of frustration and perhaps even of nightmare, so it's probably a good idea to have some notes…

Random non-repeating sequences

While doing some research for an upcoming paper, I came upon a 2008 blog post describing a special case of the following interesting problem:

Given an alphabet of n symbols, construct a uniformly-selected sequence of m of these symbols, with the sequence containing no duplicate symbols.

[Updated 2009/12/14] The difficulty arises when both m and n are large. The obvious method is a rejection method: repeatedly pick a random symbol from the alphabet and check whether you've picked it already. If not, append it to your target number. The problem is that the duplicate check seems to require log m time even if you code it cleverly, giving an asymptotic performance of O(m log m). Hash tables can help some, but ultimately you're going to waste a lot of time checking for the unlikely case that you've generated a duplicate.

There were various solutions given in the comments, but none of them were optimal. A spoiler follows…

Everything broke at once

I woke up yesterday morning in Tuscon. A lovely day…

Laziness weirds programming 2

This is a pretty clean definition of the Sieve of Eratosthenes in Haskell. Type it at the ghci command line and evaluate it to get a large list of primes before you get bored…

Syndicate content