Aug 25, 2008

Large numbers are truly incredible

Here's a favorite example: every time you drink a glass of water, the odds are good that you will imbibe at least one molecule that passed through the bladder of Oliver Cromwell. It's just elementary probability theory.
--Richard Dawkins, The God Delusion, pg. 366

That's such a fascinating claim I had to do the math myself. Obviously, the water cycle is too complex to model exactly, but this is a guesstimate after all. To make things extra hard, let's bias all the numbers by rounding them to weaken the chances of this happning.

What number shall we use? How Stuff Works says there are 326 million trillion gallons of water on Earth. Let's round that up to 10^21. Let's assume an 8 oz glass of water for this experiment. And, according to the Wikipedia birth and death dates for Oliver Cromwell and a date subtractor, Cromwell lived 21,681 days. Again, let's make this more challenging, by assuming he only peed 1 fl oz a day. (One source I found said people pee 1.5 - 2 liters a day!) The rest are just conversion factors, which are not exact and of course depend on the temperature of the water. But the difference turns out to be many magnitudes, so the conversion factors only need to be correct to within one magnitude for the premise to hold.

1. How many mols H2O are in an 8 oz glass?

8 fl oz * 29 grams / fl oz * 1 mol H2O / 18 grams = 12.8 mol H2O, which we'll round down to 10 mol H2O

2. How many mols H2O are on the Earth?

10^21 gallons * 3.78 L / gal * 1000 grams / L * 1 mol H2O / 18 grams = 2.1 × 10^23 which we'll round up to 10^24 mol H2O

3. How many mols H2O did Oliver Cromwell pee?

21,681 days * 1 fl oz / day * 29 grams / fl oz * 1 mol H2O / 18 grams = 34,930.5 mols H2O which we'll round down to 10^4 mol H2O

So what does that give us? The percent of Cromwell's pee to the total water of the world is: 10^4 / 10^24 or 1 part per 10^20. That seems like a pretty small percentage. Yet in one glass of water, there will be

10 mol H2O * 6.0221415 × 10^23 molecules / mol = 6.02 * 10^24 molecules

So from a sample where we have a 1 in 10^20 chance of getting a molecule of Cromwell-water, we take 6 * 10^24 samples. Heck, by these probabilities, we'd have a likelihood of getting roughly 6000 molecules of water that once passed through Cromwell's bladder. I personally doubt that all the world's water mixes evenly, and most of it stays at the bottoms of the oceans, making the pool of drinkable molecules drastically smaller. And I believe the Cromwell probably peed more than 1 fl oz a day. And although I certainly concede the possibility that many of the water molecules that Cromwell passed may no longer exist because they were broken up by photosynthesis, I think it's still possible to say that "the odds are good".

Apr 7, 2008

Dreaming of the future...

(Prompted by this blog post on Nepomuk.)

I love envisioning the future; it makes me feel like Leonardo Da Vinci, sometimes. It's one of those areas where I know I can't be much worse than even experts. Plus, since I'm not actually predicting, just dreaming, it's OK if my predictions don't come true.

dream of KDE 4.5 with Nepomuk+Strigi power!!!
*There's a new Contact application that brings together all your email, IM, VoIP, and Facebook contacts.

*Amarok uses Last.fm to find all the similarities between your music collection and your Facebook friend's music. When playing songs, it shows a little note, saying "Your [friend / co-worker / brother] Joe likes this song too." With a right-click, you can suggest a track to any of your contacts.

*When I type someone's name in a search box, it gives me options to send an IM (if they are online), email, message their Facebook directly.... That might be in a "Contact" pane. In another pane, it might show pictures of Joe, emails/IM logs from Joe, Joe's Facebook/Twitter status, and files on my computer from Joe. Another pane provides suggestions of files I might want to send to Joe such as recent pictures of Joe I took, or something I've sent to many of Joe's friends.

*I can type "old english essay politics" in the search box, and it will find it even though the words "old", "english" and "essay" are not in the filename or the document itself. It found the word "politics" (and associated words like "democracy") in the file, detected the name of my English teacher, knew which years I was her student, and thus knew it was "old" even though I updated the file it last week.

*Bob sends me an email asking when the Block Party and ice-skating event is. Since the Block Party is scheduled on Facebook and the ice-skating event on my co-worker's Google Calendar, KMail asks "Do you want to tell Bob that the Block Party is this Tuesday and the ice-skating is Mar 23?" and will write a template email for me. In KDE's internal calendar, Bob is marked as "possibly attending" those events. If he later replies, "Great! See you there" KDE marks him as attending, and updates my grocery list accordingly. (Earlier I got an email saying I was responsible for bringing punch to the block party.)

*Haha, and now we're getting to where the fridge orders more food... I always end up there somehow. :-)

Those last few examples bordered on AI, but regardless, this is going to be a great leap. Using an ontology and marking the relationships between files will help computers finally understand what files are. I might have a scan of piano music, a photo I took on vacation, a drawing my brother made in the GIMP, and a screenshot of my desktop, and all the computer sees is four JPEG images. Once that limitation is breached, I think computers will become much more helpful to people.

Jan 12, 2008

KDE 4.0.0

The long awaited and much anticipated 4.0 release of KDE has arrived!  Due to the KWin release notes - the COMPOSITE_HOWTO, to be precise - I got KWin OpenGL effects working!  They're fairly smooth on my Nvidia card, although they don't seem quite as smooth as I remember Compiz being.  Hopefully it, or X, or the Nvidia drivers, will improve to make KWin 4 w/composite snappy.  (It's not really "snappy" at this point like KWin 3 is.)  I haven't managed to install the KDE Edu or KDE Multimedia modules yet, and I am stuck with the Plasmoids that aren't in extragear, but hopefully Ubuntu will get those re-packaged for 4.0 soon.  (The current packages for those things depend on RC2, I think.)

KDE 4.0 is not perfect.  I wish I could put the panel at the top of the screen, for instance.  But I could certainly live with it (although I probably won't). I may stick with KDE 3.8 for a few more months, until I start writing plasmoids, or some other killer feature drags me into the new millenium. By the time Amarok 2 is released, and Decibal is added, etc, I'll probably convert.  At the moment, GTK apps look really bad, probably because I don't have the appropriate qt-theming-for-gtk-apps thing installed.  I'm sure Kubuntu will figure that out for Hardy at the latest.  I may insist on making it work sooner by doing the appropriate Google or IRC dance.  We'll see. I'm proud to have helped the KDE project, albeit in very small ways.  (One or two bug reports and a miniscule excursion in bug triage, which I plan to continue, time allowing.)  Mostly, just because KDE is the darn best collection of applications for the free desktop.  But also, because of the enormous vision of the project, encompassing everything from Windows and Mac ports to integrating Plasma with Linux MCE.  It's a bright future.  The present is bright too, obviously.

(If your wondering, why on earth I'm polluting the world with yet another random-user-posts-his-KDE4-experience, it's mostly because it's past midnight, and I get confused and ramble/waste time after 12:00.)