26 Sep 2008
Linklog for Sep 15 to Sep 22
Stuff I found funny, interesting, just plain disturbing, or for my own personal benefit.
Stuff I found funny, interesting, just plain disturbing, or for my own personal benefit.
… now I’ve got two problems.
Apparently, a long running joke. I first heard it in 2004, I think, from a coworker who read it on a programmer’s blog he was following. Unfortunately, I can’t find it anymore. I think it was a Python developer, as that’s the technology this particular coworker was fond of.
Is this it?
We found it particularly funny, as the work we were doing at the time (a lot of ASP.NET, Web Services, and XML Serialization) involved a lot of work with XML and XSLT stylesheets, and it seemed every time we finally thought we had figured out all the rules to the game, someone went and changed all the playing pieces. We never seemed to be able to apply what we had already learnt or written to any new problems, and always had to start each time from scratch.
Occasionally, in the middle of a work day, you’d hear one of us blurt out, “Yes!” And, by that, you could invariably always tell that person had just got their XML Stylesheet working.
It was also around that time that I proposed my hypothesis that, “I could solve any problem, given a time machine… and a big enough stick.”
All that reminds me of some posters my dad used to have hanging on the walls of his office when I was a kid. They were of course posters detailing the laws of Murphy. A couple of my favourites being, “Build a system that even a fool can use, and only a fool will use it,” and, “Eat one live toad first thing in the morning and nothing worse will happen to you the rest of the day.”
Classic stuff.
From a draft started on 11 June 2008:
I’ve always had a keen preference for most things mathematical. In school, my favourite subjects were always Math, Algebra, Physics, Chemistry, Calculus, and Geo-Trig. I had a high proficiency for it and, not surprisingly, that was why I liked them so much. I kept being shocked and thne thrilled at how much overlap there was and how many interdependencies there were between the different studies, and how it all moved like a well oiled machine.
That’s not to say I found all Mathematics enjoyable. Perhaps surprisingly, given my current field of work, Logic was a subject I struggled with. Oh, I was fine with the symbols and equations, but as soon as the curriculum started mixing in the ambiguities of the English language, my comphrehension level lowered quite drastically. I have no problems with spelling or grammar (I just get lazy sometimes), and will even correct people almost to the point of them threatening physical violence.
I have no problems rattling off coherent thoughts in essay form, but as soon as you try to adhere it to a logical argument, for some reason, my brain turns to cabbage. Oh, I can fake it very well, but I generally only do so for comical effect.
The higher levels of Linear Algebra also give me palpitations. I struggled all through my last Linear Algebra class in university. I understood the basics. I grasped the concept of matrices in their basic form and the equations they represented. But at a certain point, which I still haven’t been able to locate, a disconnect grew between the matrix manipulations we were performing and the underlying equations we were trying to solve. Jiggery-pokery with pivot columns turned into hocus-pocus and I suffered through the rest of the class just hoping to make good educated guesses.
The last subject I had trouble with was Statistics and Probability. I saw, and in most respects still do, Statistics as no less a pseudo-science or voodoo than Astrology, Alchemy, or Phrenology. I’m guessing a career in Quantum Mechanics is not waiting for me. I’d include Intelligent Design in that list of outlaw sciences, but it’s not even a pseudo-science, it’s a religion (but that’s for another time).
Statistics seems to be one of those sciences that is specifically designed to be counter-intuitive, and any similarities to common sense is purely by chance (no pun intended).
Which brings me to my point. I just saw the movie 21 last night and, needless to say given its subject, it involves some math-related exposition. One such example near the beginning of the movie is when Kevin Spacey’s character, Professor Micky Rosa, proposes a problem he calls the “game show problem” (more commonly known as the Monty Hall Problem or possibly also the Three Prisoners Problem), which basically goes as follows:
A contestant is presented with three doors and is asked to choose one. One of the doors hides a reward, while the other two do not. The host knows what lies behind each door. Upon making his/her choice, the contestant is shown what’s hidden behind one of the doors not chosen (the prize door will never be revealed). The host then gives the contestant the option to switch his/her choice to the only remaining unrevealed door. The question is: Is it in the contestant’s best interest to switch the choice?
Spoiler: Common sense tells us no, it doesn’t matter. It’s a 50/50 shot.
Mathematicians, however, would tell you that it does matter. In fact, they would tell you that you should always switch your choice. They would tell you you have a 66% chance to win the prize.
Huh?
This is also the conclusion reached in the movie as well. Being a fairly well-known problem, and one that flies in the face of common-sense, countless explanations are offered with varying attempts at explaining it simply, none of which seemed to give me any satisfaction. Though I’ll admit, the second table in the Aids to Understanding section of the Wikipedia article explain it quite well. The trick of the original problem is that the host knows where the prize lies, and at times his hand is forced depending on the original choice of the contestant.
I’m anything but an expert on probability and statistical analysis, but here’s how I arrived at a solution that makes sense to me. My first reaction, being a programmer, was to build a simple program that tooks a couple of inputs (numbers of choices, i.e. 3, and number of iterations, i.e. 10 times, 100 times, 1000 times, etc…), define an array to act as doors, use a random number generator to shuffle the position of the car and to make the contestant’s decision, reveal empty doors (as per the stated host’s behavious), and then tally the number of times the contestant wins by switching his choice.
Rather than think it all out into an algorithm ahead of time, i just took to the keyboard and started writing code, adjusting for the rules of the game as I went along. After a few minutes, it came abundantly clear to me why the mathematicians were correct. In a roundabout way, my program essentially aimed to disprove that always switching your choice is more beneficial.
Because the results of the game are either you win the prize or you don’t, I found it easier to think of the problem in terms of its complement. Going with the assumption that we are always going to switch our answer, the only times we’ll lose is when we initially chose the door with the prize. So because the chance of choosing the door with the prize is 1/3, the chance of winning is 1 - (1/3) or 2/3.
Now maybe that’s the wrong way to think about it, but like I said, probability’s never been my strong suit.
I wonder if any studies have been done regarding Deal or No Deal…
So in my constant quest to find ways of off-loading everything I do onto one pocket-sized device, my iPhone, I’ve now got myself on an eBook kick. I now carry my iPhone with me practically 90 to 95 percent of the time, compared to probably only 20% of time tops with my old phone. And now since my iPod and cell phone are one and the same, I never miss a call now when I’m listening to music on my iPhone.
I’m hoping the same theory holds true for these eBooks. By having them there at the ready, just a few finger taps away, I should theoretically be able to get back into reading. The problem is I don’t have an hour and a half commute into work anymore like I did a few years ago, so I don’t bother bringing a book with me these days. And like hell I’m going to give anyone at work the chance to see me take a book into the bathroom!
So I started to check out a few eBook reader apps for the iPhone. I’ve heard plenty of good things about eReader, but it seems to only be tied to the one eBook format.
Oh right, that’s the other thing. It would seem everyone likes their own format over everyone else’s. As Andy Tanenbaum said, “The nice thing about standards is that you have so many to choose from.”
I’ve also tried Stanza, which seems to have a lot more flexibility in terms of the formats it can import and export, and it really satisfies the geek quotient, because it really makes you want to start delving into specification documents and writing scripts to do all kinds of XML, HTML, and RTF manipulation to create the perfect eBook. Bookshelf is another one, and it sounds similar to Stanza in functionality, but I’m turned off a bit by the comparatively steep price (compared to free) of the app until I’m sure reading eBooks is something I even feel comfortable doing on a regular basis (or if it’ll become just another way for me not to read the books I want to read).
In the end, I decided on eReader for the time being. As much as I want to have the flexibility that Stanza offers, it’s kinda weak so far in terms of what it does do. Ideally, the best app for doing this eBook syncing would be one with that all too familiar iLife interface (i.e. iTunes, Mail, Yojimbo, Comic Book Lover, etc…). In other words, something that’ll let you edit the meta data like title, author, chapters, cover art, etc… The document-based interface Stanza has now doesn’t really suit a syncing app.
I tried converting/making my own from stuff I’ve found online, but after an hour of getting mediocre results, I realized my time was better spent doing other things. For now, I’ve signed up to Fictionwise.com as it carries a lot of the books I’m interested in reading.
I was going to sign up to download the movie for free in a couple weeks, but I couldn’t be bothered…
Your friendly neighbourhood admin is Bob Maguire. Feel free to contact me with questions or comments.
Valid XHTML | CSS | Powered by WordPress