NavigationUser loginCMS by Drupal |
RecreationRandom non-repeating sequencesWhile doing some research for an upcoming paper, I came upon a 2008 blog post describing a special case of the following interesting problem:
[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…
I'm done with The OnionI've been a huge fan of The Onion, the satirical newspaper originally published by the University of Wisconsin, for about 15 years now. I've purchased their books and audiobooks, downloaded their videocasts to my TiVO, etc. That ended tonight…
Won a poker tournament yesterdayI won a poker tournament last night. It wasn't a big tournament: 20 people playing at an American Legion Hall in North Portland, with the rake mostly going to charity. $20 buy-in, with payouts of $225/$125/$75. By the time I bought a round of drinks and threw in some charity money, I came home with about $150…
ANSWERS: AntonymsHere's the answers to antonyms:
Explanations available on request. Antonyms: a little word puzzleI keep wanting to blog about my latest tiny piece of software, but I keep having one more bug or feature. So instead, I've cooked up this little word game. Tell me what you think of it…
|