Sunday, May 13, 2007

Friends and Strangers

This is a post for all you Facebook users out there...

At one time or another, you've probably heard of the so-called birthday paradox. Roughly put, if you grab 23 random strangers off the street, there's a 50% chance that 2 of them will have exactly the same birthday. It's an interesting property about the world. You can observe it yourself by looking through the birthdays of your friends on social networking sites like Facebook.

Perhaps more interesting is a cute theorem I read about today, similar to the birthday paradox. I found it after trawling a mathematics webcomic (yes, they exist), then linking to a page on Ackermann's function, then linking to Graham's number, then linking to Ramsey theory, and finally linking to the theorem on friends and strangers. This theorem says that "if you take 6 random people off the street, you can guarantee that either 3 are mutual acquaintances, or 3 are mutual strangers". Think of that next time you do a triple-date organised by a friend. No matter who else attends, you are guaranteed that 3 people there have never seen each other before, or that 3 people already know each other. Or both.

I will now return to my regular schedule of self-inflicted thesis pains...

P.S. You may have noticed the six-degrees of connection in the above text. I swear that was completely unintentional. ;)

Wednesday, May 09, 2007

Lend A Wrist?

I have to say, this wrist brace is kind of cool. It feels soft, fits well, looks very funky. But I also have to say:

For !@#$% sake! When is my wrist going to stop hurting? :(

I've adjusted the keyboards at work and home to improve the angle of my wrist and elbows while typing. Right now I'm sitting very upright so that my shoulders are back. I probably look like I have another one of these aluminium rods stuck elsewhere. Still doesn't seem quite right, as I get some pain in the wrist and right elbow, but it's getting there.

Friday, May 04, 2007

Tune Up

I went to see the physio again today. Her opening line was: "Hi Peter! So is this a tune up? Or something more serious?". Luckily it was just a tune-up. My back was slightly out of alignment, as was a bone in my right arm. Nothing worse than I've had, but was a good idea to go the physio. She was rather impressed that I hadn't been in since February - the exercises seem to be working. Though she and I both predict that I'll be back in to see her in a few months.

I mentioned that the because of the pain in my right wrist I had tried immobilising it overnight by wrapping in a towel, a drink coaster, and a one-size-fits-all knee brace. She suggested that I get an actual wrist brace instead and use it while typing and sleeping, which is damn close to 24 hours... As it costs me $65 to go to the physio, and my wrists affect my long-term employment prospects, I figure that getting a good wrist brace is worthwhile. I bought one for $45 and am typing with it now. It certainly immobilises quite nicely the wrist. Now I just need to see if I end up with elbow problems. ;)

I have a related story with a more Canadian aspect. I bought the wrist brace from was a relatively young and chatty female pharmacist. We were talking and started comparing the concept of wrist braces to shoes, in that you should try them on and you don't want to get something that won't do the job. She then commented on how bizarre it is to see some people wearing some shoes like thongs all the way through the winter. Her choice of words sent off alarm bells in my head, so I asked "Are you actually from Canada?". She immediately knew why I asked: "Haha, yeah. We always used to call them thongs when we were kids, but then people started wearing the other type of thong, and suddenly we kids were told to call the things on our feet flip-flops." That explains some things.

Anyway, I'm likely to go back and get another wrist brace for my left hand if this one works out.

Wednesday, May 02, 2007

Thunderstorm

We never ever get thunderstorms in Vancouver. Really. Well, except for today. I was so happy to see a flash of light and a big roll of thunder. I remember being told the thunder was the sound of the gods playing pool/billiards/snooker. I miss those times, sitting back and imagining Thor sinking the white ball or something.

Memory Lane

When I started my thesis, it wasn't on distributed constraint satisfaction. At least, not to the degree it is now. It was originally focused on parallelised constraint satisfaction. As part of my research into parallelised constraint satisfaction I did some work on hypertree decomposition. I've recently decided to include that back in my thesis. It's quite the trip back down memory lane to look at the program I wrote so many years ago. It was only ever used by me, yet had an interactive mode with online help.

$ ./red-decomp 

Interactive mode. Type 'help' for a list of available commands
--------------------------------------------------------------

decomp> help

Commands can be given as arguments to this program, prefixed by a '-'.
Alternatively, interactive mode is used by supplying no arguments.

Available commands are:
  build <s> <v> [ <c2> <c3> ... <cn> ]
     Generates a problem with random seed s, v variables,
     c2 extra binary constraints, c3 extra ternary
     constraints, etc.
  generate [ <v> [ <c> [ <s> ] ] ]
     Generates a problem with v variables, c extra
     constraints, and random seed s.
  write [ <filename> ]
     Writes a problem description to a file.
     If no filename is given then stdout is used.
  read [ <filename> ]
     Reads a problem description from a file.
     If no filename is given then stdin is used.
  decompose [ <w> [ <v> ] ]
     Constructs a hypertree decomposition graph for
     the current problem, with maximum width w.
     If v is supplied it sets the verbosity level.
  extract [ <filename> [ <filename> ] ]
     Extracts a hypertree decomposition from the
     above graph, and writes it in dot format to
     the first filename. If two filenames are given
     all hypertree decompositions (as a directed graph)
     is written to the second file.
  print [ <filename> ]
     Prints the decomposition graph. If a filename is
     given the graph is written to the file.
  statistics [ <filename> ]
     Writes statistics about the decomposition, like
     problem sizes, CPU times, etc. If a filename is
     given then the information is written to the file.
  test [ <filename> ]
     Writes the statistics in a really brief form
     useful for when conducintg experiment.

Pity that I forgot to document which version of the program actually worked...