Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Monty Hall Paradox Rate Topic Display Mode Topic Options
Author
 Message
 Posted Wednesday, September 2, 2009 6:45 AM
 SSC-Addicted Group: General Forum Members Last Login: 2 days ago @ 10:49 AM Points: 415, Visits: 929
Post #781385
 Posted Wednesday, September 9, 2009 1:05 PM
 Forum Newbie Group: General Forum Members Last Login: Wednesday, September 9, 2009 9:40 PM Points: 1, Visits: 17
 (removed)
Post #785278
 Posted Wednesday, September 9, 2009 3:53 PM
 SSC Rookie Group: General Forum Members Last Login: Monday, August 31, 2015 2:16 PM Points: 38, Visits: 553
 That is an interesting puzzle. Here is another solution using a CTE instead of a loop.`-- Setupset nocount on-- Create a table to store the results.create table Doors( ID int , ChosenDoor int , WinningDoor int , WinLose as case when ChosenDoor = WinningDoor then 0 else 1 end -- Win = 1, Lose = 0);-- Use a CTE to generate 10,000 "contestants" and their chosen/winning doors.-- If the chosen door equals the winning door the contestant will switch when given the-- option and lose. Otherwise they will switch to the winning door and win.with Digits(i)as (select i from (select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9 union select 0) AS X(i))insert into Doors(ID, ChosenDoor, WinningDoor)select (D3.i * 1000 + D2.i * 100 + D1.i * 10 + D0.i) AS seq , abs(cast(cast(newid() as varbinary) as int)) % 3 + 1 ChosenDoor , abs(cast(cast(newid() as varbinary) as int)) % 3 + 1 WinningDoor from Digits as D0, Digits as D1, Digits as D2, Digits as D3-- Select the total number of winners (1) and losers (0).select WinLose , count(*) Totalfrom Doorsgroup by WinLose-- Clean-updrop table Doorsset nocount off`
Post #785394
 Posted Wednesday, September 9, 2009 4:07 PM
 SSC-Addicted Group: General Forum Members Last Login: 2 days ago @ 10:49 AM Points: 415, Visits: 929
 Very cool alternative. Thanks for sharing! :)
Post #785399
 Posted Monday, November 10, 2014 2:23 PM
 Valued Member Group: General Forum Members Last Login: Wednesday, April 8, 2015 10:43 AM Points: 71, Visits: 261
 I think this is bogus. The reason that I think it is bogus is that on the second bet you are excluding the door you picked from your first bet ONLY if it is not the right door. So you are adding new information. *******************What I lack in youth, I make up for in immaturity!
Post #1633275
 Posted Monday, November 10, 2014 4:41 PM
 SSC-Addicted Group: General Forum Members Last Login: 2 days ago @ 10:49 AM Points: 415, Visits: 929
 brosspaxedi (11/10/2014)I think this is bogus. The reason that I think it is bogus is that on the second bet you are excluding the door you picked from your second bet ONLY if it is not the right door. So you are adding new information.Thanks for sharing you're wonderful insight.
Post #1633321
 Posted Monday, November 10, 2014 4:42 PM
 SSC-Addicted Group: General Forum Members Last Login: 2 days ago @ 10:49 AM Points: 415, Visits: 929
 I am surprised anyone even found this old post. LOL.
Post #1633322
 Posted Tuesday, May 24, 2016 6:44 AM
 SSCrazy Eights Group: General Forum Members Last Login: Today @ 6:45 AM Points: 8,328, Visits: 858
 Interesting script.
Post #1789224

 Permissions