News

My Stats

  • Posts - 305
  • Comments - 223
  • Trackbacks - 82

Twitter












Tag Cloud


Recent Comments


Recent Posts


Article Categories


Archives


Post Categories


Entertainment


Friends


Tech/Geek


June 2009 Entries

Programming a Monty Hall Simulator


I mentioned that I was going to try to program a Monty Hall Problem simulator in my post yesterday entitled Losing My Marbles well it turns out that this is REALLY lame. Why? Well it is simple, there really isn’t much to it once you know the mechanics.

Pseudo Code:

Testing “always switch”:

  1. Pick a random number >= 1, <= 3. This is the door# where the car is hidden. Call this CarBehindDoor.
  2. Pick a random number >= 1, <= 3. This is the door# the contestant picked. Call this ContestantChoiceDoor.
  3. if CarBehindDoor = ContestantChoiceDoor then the contestant loses and we add one to LossCount.
  4. If CarBehindDoor != ContestantChoiceDoor then the contestant wins and we add one to WinCount.
  5. Go back to 1 (loop).

Testing “always stay”:

  1. Pick a random number >= 1, <= 3. This is the door# where the car is hidden. Call this CarBehindDoor.
  2. Pick a random number >= 1, <= 3. This is the door# the contestant picked. Call this ContestantChoiceDoor.
  3. if CarBehindDoor = ContestantChoiceDoor then the contestant wins and we add one to WinCount.
  4. If CarBehindDoor != ContestantChoiceDoor then the contestant loses and we add one to LossCount.
  5. Go back to 1 (loop).

Once this is written… it is painfully obvious that “Always Stay” results in a win 33% of the time and that “Always Switch” results in a win 66% of the time. *sigh* and I thought this would be a fun thing to write.

On a sad note I still wrote the test application and here are the results of a run of 100 million tests of “Always Switch”:
Wins: 66,667,053 Losses: 33,332,947

posted @ Friday, June 26, 2009 7:22 AM | Feedback (1) | Filed Under [ Personal ]


Losing My Marbles


I was talking to my girlfriend, IrishGirl (@irishgirl31 on Twitter), about the now famous (or is it infamous?) Monty Hall problem:

Contestants on a game show are given the choice of three doors: behind one door is a car; behind the others, goats. After a contestant picks a door, the show’s host, who knows what's behind all the doors, opens one of the previously unopened doors, which reveals a goat. He then asks the contestant, "Do you want to switch doors?" Should the contestant switch doors?

If you haven’t heard about it or read about it you should, Jeff Atwood has a great overview or go to the source Marilyn vos Savant -- wow I bet a lot of those PhDs and math professors wish she’d take down their quotes! Wouldn’t it be fun to take a class from James Rauff, Ph.D., Professor of Mathematics at Millikin University who said:

I have been a faithful reader of your column, and I have not, until now, had any reason to doubt you. However, in this matter (for which I do have expertise), your answer is clearly at odds with the truth.

and just heckle the hell out of him for being totally WRONG about this? Okay I shouldn’t pick on James… the exalted Paul Erdos didn’t believe the right answer either until a colleague wrote a computer simulation to prove it to him (Hmmm… that sounds fun actually, I think I might write a computer simulation in my spare time tonight).

To me the whole issue is an amazing study in how poor humans really are at understanding probabilities. Casinos know this fact VERY well and I’m sure this human flaw is a major reason casinos do so well, even in a down economy. People throw good money over bad in hope that the odds are NOW magically in their favor! Sorry chump doesn’t work that way!

Anyway I didn’t want this post to be a re-re-re-rehash of the original problem I really just wanted to say that it was a very nice intellectual conversation working through the Monty Hall problem with IrishGirl… because as I’ve learned you can’t truly explain something to someone else if you don’t fully understand it yourself. It took about fifteen minutes to convince her that you should ALWAYS change your initial choice after the host reveals the goat. Always. You will win 66% of the time if you switch and only 33% of the time if you don’t. Hurts the brain, huh?

All of this talk reminded me of how much I truly enjoy problem solving, logic, probability and statistics. I’m not very good at any of those things but I do enjoy having my mind bent on occasion. I’m not sure why but this simple logic problem has always stuck in my head. Yes I was actually asked this question back in the early ‘90s when I interviewed at Microsoft (it was a series of 6 hour long interviews to go from being an “a-“ to a “blue badge”). The answer is very simple but it makes you think a bit and you don’t need to draw a chart to solve it - and I guess that’s why I like it.

There are three sets of marbles: all white, all black, and mixed white & black
There are three velvet bags (think Crown Royal – as in you cannot see through them)
Each bag has a label attached to it: White, Black, or Mixed
Each bag contains one set of marbles
The labels on the bags are guaranteed to be incorrect
How many marbles do you need to pull to correctly re-label the bags? Explain your answer.

posted @ Thursday, June 25, 2009 4:54 PM | Feedback (3) | Filed Under [ Personal ]


Alimony: The Gold Digger Tax


The full title of this post is “Alimony: The Gold Digger Tax and why I refuse to call it spousal maintenance” but I thought that was too long for a blog post title. Hell it’s almost too long to Tweet!

Washington state calls alimony “spousal maintenance” – I can only imagine this is because alimony has a negative connotation and this state is so god damned bleeding heart liberal and so politically correct that we can not possibly call something what it is… we must call it something less offensive so the that lazy gold digging sack of fat that receives the alimony feels better about extorting money from an ex spouse for doing abso-fucking-lutely nothing.

With child support and alimony combined I pay my soon-to-be-ex (STBX) $34000 per year. That means that for doing nothing she earns more than 37.71% of the US households! On top of that there is no tax on $16000 of that (the child support portion) so really <insert some math stuff here> she makes more than like 40% of US  households. She does not work. She watches a LOT of FoodTv and eats a lot of bon-bons I guess.

So then STBX puts ME on the spot when my son wants to do things like computer programming camp this summer and tells him “if Dad can’t pay for it then you can’t go.” Unfair! I pay his mother $16,000 per year for child support (well a bit less than half of that is for his little sister but you get my point!). Son, if your lazy-assed Mom would get a JOB then she could use the money I pay her every month for things like computer programming camp!

Did I mention that this lazy, unemployed Gold Digger has an iPhone? Yep she and my son (he bought his with his own money, sure, but she pays the monthly bill!) BOTH have new iPhones. WOW.

posted @ Friday, June 19, 2009 4:37 PM | Feedback (5) | Filed Under [ Personal ]