Thursday, May 29, 2008

Coming Home

I should have posted this a very long time ago, but I've been rather busy with work and life.

It seems that since I got back from NY in April I've been running around doing something, or just being plain run down. I had my friend Anand in town, and we had a good time about Tokyo. Now Deifante has come, and we'll be off to the Virtual World Conference and Expo here in Tokyo. The reason D. is in town is because we are kicking off a new project that I am ostensibly leading, and D. is contracting to work with us on it.

However, I am now planning to pack up my family and head back to Canada for the first time in over 2 years. It will be L.'s first trip on an airplane, and my family's first time seeing L. in person.

If anyone I know in Calgary would like to meet me or M. or L., please drop me an email, and I will do my best to arrange it. :)

Tuesday, May 6, 2008

If I had a wedding, and I had tried this line at it, I think I would have lost exactly everyone

[Reads]


You that choose not by the view,
Chance as fair and choose as true!
Since this fortune falls to you,
Be content and seek no new,
If you be well pleased with this
And hold your fortune for your bliss,
Turn you where your lady is
And claim her with a loving kiss.

A gentle scroll. Fair lady, by your leave;
I come by note, to give and to receive.
Like one of two contending in a prize,
That thinks he hath done well in people's eyes,
Hearing applause and universal shout,
Giddy in spirit, still gazing in a doubt
Whether these pearls of praise be his or no;
So, thrice fair lady, stand I, even so;
As doubtful whether what I see be true,
Until confirm'd, sign'd, ratified by you.


-- BASSANIO, SCENE II. Belmont. A room in PORTIA'S house.

Thursday, May 1, 2008

So this is what my Degree comes to...

After many years of study, it comes down to solving logarithms in your head while you're trying to get to sleep.

How many rounds of Russian Roulette does it take before you have 50-50 or worse odds of surviving?

If we assume there is 1 bullet in a 6 chambered revolver, you have a 1/5 chance of having your wig pushed back, and 5/6 chance of taking another breath. The problem is that every time you play (and survive to play again), you're taking another trial with 5/6 odds, which gives you (5/6)^n probability of surviving after n rounds.

Problem is that when you multiply a number less than 1, you always get something smaller than what you started with. That means one day, you will bite the bullet. The question is, after how many tries?

We wish to solve the following for n:


(5/6)^n = 1/2
=> lg (5/6)^n = lg (1/2)
=> n * lg (5/6) = lg (1/2)
=> n * (lg(5) - lg(6)) = lg(1) - lg(2)
=> n * (lg(5) - lg(2) - lg(3)) = -1


Now here we reason that since lg() is a continuous, monotonically increasing function, by the intermediate value theorem:


2 < 3 < 4 < 5
=> lg(2) < lg(3) < lg(4) < lg(5)
= 1 < lg(3) < 2 < lg(5)


That gives us a tight enough bound for lg(3) ~ 1.5, considering the precision we need only to the nearest whole number, but the bound on lg(5) is pretty loose, so we'll need to do better.

We know that we can approximate an analytic function, as lg() certainly is, about a point "a" using its derivative:


lg(x) ~ lg(a) + lg'(x) * (x-a)


We also know that
 
lg'(x) = 1/(x * ln2)

where e ~ 2.7, so we take ln2 ~ 1.

Together this gives:

lg(5)
~ lg(4) + 1/5 * (5-4)
= 2 + 1.5 = 2.2


Going back to the original equation:

n * (lg(5) - lg(2) - lg(3)) = -1
=> n * (2.2 - 1 - 1.5) = -1
=> n = 1 / 0.3 = 3.3


Lets verify that we haven't wandered completely off-base by checking our calculation:

(5/6)^3 = 125 / 216 > 125 / 250 = 1/2
=> (5/6)^3 > 1/2

(5/6)^4 = (125 * 5) / (216 * 6) = 625 / 1296 < 1250 = 1/2
=> (5/6)^4 < 1/2


So there you have it: 3 rounds of everyone's favorite pastime gives you better than 50-50 odds, and 4 rounds give you worse than 50-50 odds. Running it through the calculator the next morning, you have a 57% chance of surviving 3 rounds, and 48% after 4.

Now, play a game of Russian Roulette and have a blast.