Sunday, April 20, 2008

[tool] SQL Server 2005 settings: copy column names and show line numbers

Helpful settings found in Tools ... Options today:

1) Copy column names / heading when copying from grid results


2) Show line numbers

Monday, April 14, 2008

[log] "21" Movie Game Show Host Three Doors Problem Explanation

Went to see 21 last night, and none of the us got the gameshow host door explanation. Is it really better to switch? Yes, it is. Here is my explanation. This is not a math problem, but rather a logic problem

Game setup
> Three doors. One with prize and two with goats.
> Prize and goats randomly hid behind the doors.
> The host knows which door has the prize

Game play
> First, contestant picks a door, but not open it
> Next, the host MUST open a door with a goat, BUT, cannot open the contestant's door
> After the host opens the door showing the goat, the contestant can stay with his original choice, or, switch to the other door.
> Should the contestant stay or switch?

What the movie said
> The move said that it's better to switch. That switching will win 2/3 of the time. And I agree.

Why is it better to switch?
> The critical point here, is that the host CANNOT open the contestant's door, which limits what he can do, when the contestant's first round choice is a goat door.

> So let's say, that the contestant always chooses door 1, which is as good a random choice as any.

> Now, consider the case when the prize is NOT in door 1.
>     In that case, the host only has one choice of door to open.
>        For example, if Prize is in door 2, the host HAS to open door 3.
>     Let's think about what happens if we switched (this is the critical point!) -- in this case, the contestant is GUARANTEED to win, if he SWITCHED
>     (What causes that "guaranteed win" from the switch? It's because the game show host cannot open the contestant's door. So he is always eliminating the other goat door.)

> And now, how often is the prize NOT in door 1?
>     2/3 of the time!

> And that is why, 2/3 of the time, the "switch" choice will win

But wait! What about when the contestant picked the right door to begin with? switching will lose!
>     Yes, of course. But, how often is the Prize is behind door 1?
>     Only 1/3 of the time.

Come again. Why is the second round pick NOT 50/50?
> It's because the host could NOT open the contestant's door. If he could, then the "guaranteed win" scenario above would not be true.

Other fun explanation and debates on this problem. I also created a simulation just to make sure I'm not out of my mind.