Happy Flat Earth day!

As I write this, it is still March 14 where I am, which is of course celebrated by many as pi day.

The popular media in their explanations of the significance of pi, often presents it as being the ratio of the circumference to the diameter of a circle. This is claimed to apply to circles of any size, whether they be the size of atoms or galaxies, or anything in between. Not only is this almost always presented without any caveats, it's even emphasized to be universally true.

Let's take a look what this really means. First, we need to define what a circle is, and it's simply the set of all points in a two-dimensional space that are an equal distance from some centre. Twice that distance is of course the diameter. If you take a piece of rope and tie one end down, pull the rope taut, then walk around keeping it taut, the rope guides you along a circle, eventually leading you back to the point you started at.

Twice the length of rope is of course the diameter. So, how far did you walk?

If your answer, as all the pi day hype celebrates, is pi times the diameter, then you've just passed the admission test for the flat earth society!

Ask a round-earther this question, and they may hand you a rope that reaches from Santa's Workshop to Singapore. By the time you're done walking, you would have supposedly walked (plus swam where you couldn't walk... and yes, the rope floats) a circumference four times the length of the rope, or twice the diameter. But of course we're told over and over the circumference is pi times the diameter not twice, so clearly something's wrong with the round-earthers, right?

It must be a conspiracy.

Now excuse me while I go celebrate the day by eating a pie. From McDonald's.



I spotted these bottles years ago in the local Safeway and more recently at World Market. Maple Syrup in bottles identical to these is very common in Canadian gift shops, where it makes perfect sense given Canada produces some 3/4 of the world's Maple Syrup. Unlike the bottles in Canada however, these are labelled as being a product of Vermont.


The Maple Leaf has long been the national symbol of Canada. It's used on the Canadian flag; not just the current one, but also the Canadian Red Ensign used for the hundred years preceding it. It goes back well before that too, being recognized even when Canada was but a colony in New France. I could go on, but there's even a whole book on the subject.

How dare these Vermonters package their product using a Canadian symbol? This just wreaks of trademark infringement and misrepresentation! Outrageous!

(tapping self on shoulder) Dude, what's in the bottles?

I was right!

Editing some code that I'd written several years ago, I found a spot where it seemed I'd made a subtle mistake; I thought I'd put in a wrong equation. Then I realized I was right. Later, I figured out when.

I am not alone... (or: welcome to the club 156)

Today is/was pi day. Yippie! Happy Birthday Einstein!

All together, now...


At my summer job before coming to Berkeley, the subject once came up of how many digits of pi I have memorized. About 4 years earlier, I'd had 162 digits memorized, but by then I'd forgotten a few. I was down to 156.

These 156 digits were what I'd memorized when bored with grade 9 math class. The other 6 were learned when I tried to pick it up again in anticipation of pi day, 1991, when myself and a number of other OSCSS alumni got together and visited the CityTV speakers' corner.

Despite attempts to add to it since then, the 156 has remained pretty much fixed. Additional digits seem to get stored in a different part of my brain from this core, and have never really stuck quite the same way. I always have a pause in the transistion after the 481117, and often can't continue at all.

This year, some people decided to chalk up the pavement circling Evans Hall, home of Berkeley's Math Department, with countless digits of pi, and assorted pi related grafitti. In addition to writing it in arabic numerals, there were chinese characters of the digits written below it... up to a point.

The chinese digits stopped at.... digit 156. *blink*

The Ultimate Answer to Life, The Universe, and Everything

Is well known to be 42, having taken Deep Thought 7-1/2 million years of pondering to find and check. Thoroughly.

The Ultimate question on the other hand is another story. It's sometimes purported to be "What do you get if you multiply six by nine", but of course this is only the product of Arthur Dent pulling random scrabble letters out of a sack. This is about as likely to be the question as, say, what a piece of toast with the image of the Virgin Mary burned into it might ask a person after a night of heavy drinking.

I am pleased to announce that I now know the question.

How long is the draft of chapter 5 of Luns' dissertation?

Not what was meant.

While waiting for a meeting today, I played a little bit with an old problem.

In introductory computer science classes introducing recursion, it's common to use computing the Fibonacci sequence as an example of where recursion seems a natural fit but is a bad idea. A common assignment is to write a non-recursive function for finding the n'th Fibonacci number. When I got this problem back in grade 10, I submitted something to the effect of:
int f(int n){
    return (pow((1+sqrt(5))/2,n)-pow((1-sqrt(5))/2,n))/sqrt(5);
The teacher being an English teacher by training, did not appreciate this and deducted marks for not adequately explaining in my comments how it worked. Of course I deliberately didn't bother explaining since I didn't expect he would understand it anyway.

I seem to remember the same problem coming up in a class during my undergrad when they were teaching big-O notation. One assignment would have been to determine the complexity of finding the n'th Fibonacci number recursively. So, I wrote a recursive function (what I played with today was deriving the recurrance relation from scratch again):
void fl(int n, int *fo, int *lo){
    int f, l;

    if (n%2) { 
        fl(n-1, &f, &l);
        *fo = (f+l)/2; *lo = (5*f+l)/2;
    } else if (n) {
        fl(n/2, &f, &l);
        *fo = f*l;     *lo = (5*f*f+l*l)/2;
    } else {*fo=0;     *lo=2;}

int fib(int n){
    int f, l;

    fl (n, &f, &l);
    return f;
This looks all the world like O(log(n)) to me, but the textbook answer is that its exponential complexity.

I wonder if they've come out with better textbooks since then.

Shlemiel the Painter

I find myself reminded today of an old joke which I think I'd read from a book in grade 3. I seem to recall that it was on the bottom row, three shelves away from the south door of the Secord school library. But I digress. Here's a copy of it that I dug up - I don't remember the painter's name being what it is, but aside from the foreign currency it seems to be about what I remember.
Shlemiel gets a job as a street painter, painting the dotted lines down the middle of the road. On the first day he takes a can of paint out to the road and finishes 300 yards of the road. "That's pretty good!" says his boss, "you're a fast worker!" and pays him a kopeck.

The next day Shlemiel only gets 150 yards done. "Well, that's not nearly as good as yesterday, but you're still a fast worker. 150 yards is respectable," and pays him a kopeck.

The next day Shlemiel paints 30 yards of the road. "Only 30!" shouts his boss. "That's unacceptable! On the first day you did ten times that much work! What's going on?"

"I can't help it," says Shlemiel. "Every day I get farther and farther away from the paint can!"

25 years later
Every day, as I try to get started with writing, I'm spending more and more time re-reading what I've already written to figure out where I've left off, what ends I've left dangling, and what I need to adjust to better support what I put in next. I'm dying for this chapter to end so I can move this paint can.

Monkey See, Monkey Do

I haven't been to my office for a while now, but there's a new sign posted by the water cooler that reminds me of an experiment I did a while ago. I've long wanted to find an appropriate vodka bottle label to stick on the cooler, but that's another matter.

I rarely use the water cooler as I have some reservations about its sanitation. People seem too impatient to wait for all the water to stop flowing when they fill their bottles/mugs, and the last trickle of water after they remove their container accumulates in a drip tray which nobody bothers to empty. The old water cooler had lots of mold growing in that tray as a result, which made the cooler very unappealing to me.

I don't know who changes the bottles on the cooler, but there's typically a row of bottles next to the cooler, new ones still having their lids on them, and the used ones sitting all with their mouths wide open. Sometimes there's a pile of the used lids on the floor beside the cooler, or sometimes they end up in the nearest garbage can, but the used bottles were all set down just as they came off the cooler. The open tops were another reason for my wariness towards the cooler: the used bottles are open to dust or other contaminants getting into them, and I have no idea to what length the water vendor goes to sanitize their bottles before refilling.

Sometimes when I'm here late at night, I wander around to clear my head a bit, and am bored enough to look a bit at whatever catches my eye. One night I happened to notice the bottle on the cooler was empty, and was bored enough to change it. After opening the new bottle, I took its lid and put it onto the emtpy bottle that I just took off the cooler. This happened to be the first bottle change after a fresh shipment of bottles, so the empty bottle I put the lid on, was the only empty bottle.

I didn't touch the cooler after that, but over the next few days, the row of empty bottles beside the cooler all had lids on them.

Kettle, meet pot (or acid)

There's a woman who I occasionally run into riding the local buses who often tries to strike up a conversation with whoever she can grab. Her style of 'conversation' is rather taxing - she'll ask some question, and if you try to offer any more discussion than a simple one-sentance answer, she usually cuts you off with her own thoughts on the matter and rambles on until she has another question. I'm pretty sure she's schizophrenic, with her trains of thought running off into rather bizzare directions, often colouring things as black or white, and showing little regard for what people are comfortable with discussing.

I generally try to avoid engaging her, but one bus ride home a few weeks ago was empty enough that I failed to escape her. She started off with relatively normal introductory questions, and I answered one of them saying I'm working on my PhD. This led to the question of whether I'm stressed out or not, and then she started off on a monologue about how people deal with stress.

At one point, she says "people deal with it in different ways... some people go on trips". Her saying that struck me as a little funny - I would generally say 'travel' or 'vacation' rather than use the word 'trip' in that manner. Trying to humour her a little bit, I smirked and pointed out to her "when you said 'trips', that brought Timothy Leary to mind".

I was utterly unprepared for her reaction. "I don't think I can finish talking to you. You think in strange ways." and then she goes off muttering about how "you have a weird brain... I can't go on talking to you..." I just shrugged and let it be - her ranting about how weird am I displaced the usual stream of questions, and I was quite glad to not have any more of them to answer.

I guess it's not called Permanent head Damage for nothing.