Ummmm...What's the Probability that this thread will die within the next 24 hours??? ?????? :)
James
-----Original Message-----
From: Gavin Scott
Sent: Wednesday, March 01, 2000 12:10 PM
To: [log in to unmask]
Subject: Re: OT: Probability question
Gary puzzles along with the rest of us:
> Every time I hear this one I scratch my head in confusion.
The virtual coins don't lie:
10 REM contestant's Choice, prize Door, door Exposed by monty
20 INTEGER C,D,E
30 REM Total games, wins if the user Holds, winds if he Switches
40 LONG T,H,S
50 T=H=S=0
60 FOR I=1 TO 1000
70 REM Prize is behind...
80 D=INT(RND(0)*3+1)
90 REM Contestant Chooses...
100 C=INT(RND(0)*3+1)
110 REM Monty Exposes...
120 E=INT(RND(0)*3+1)
130 IF E=C OR E=D THEN 120
140 REM If user holds on...
150 IF C=D THEN H=H+1
160 REM If user switches...
170 IF C=1 THEN DO
180 IF E=2 THEN C=3
190 IF E=3 THEN C=2
200 GOTO 320
210 DOEND
220 IF C=2 THEN DO
230 IF E=1 THEN C=3
240 IF E=3 THEN C=1
250 GOTO 320
260 DOEND
280 IF E=2 THEN C=1
290 IF E=1 THEN C=2
320 IF C=D THEN S=S+1
330 T=T+1
340 NEXT I
350 PRINT USING 360;T,H,S
360 IMAGE 8D,2X,8D,2X,8D
>run
1000 363 637
So for 1000 trips to the Big Deal of the Day, keeping the original choice
resulted in 363 wins, but switching resulted in 637 wins!
G.
|