Page 3 of 5
Re: A little riddle
Posted: 13 Jun 2008, 02:39
by manored
I dont really know the diference between when and then, but as far as I know affirming something doesnt invalidates other possibility...
whats the issue with the other riddle?
Re: A little riddle
Posted: 13 Jun 2008, 03:18
by lurker
when - at the same time as
then - afterwards
The issue with the other riddle is that it was unclear whose disk the second person looked at. 'last' could mean the final man to be tested, but then you refer to the final man as 'third' seconds later, which makes it seem like 'last' is to be interpreted the other way, as 'previous'.
Re: A little riddle
Posted: 13 Jun 2008, 03:43
by PRO_rANDY
i didnt read any replies but u shud change for a 2/3 chance to win. EZ game
Re: A little riddle
Posted: 13 Jun 2008, 04:10
by manored
lurker wrote:when - at the same time as
then - afterwards
The issue with the other riddle is that it was unclear whose disk the second person looked at. 'last' could mean the final man to be tested, but then you refer to the final man as 'third' seconds later, which makes it seem like 'last' is to be interpreted the other way, as 'previous'.
Dam grammar :)
"the second could only see the one from the last man and know that the first had missed, but also failed." I think in this part leaves it is quite clear that the last man is diferent from the first, else I would have said "and know he had missed" instead of "and know the first had missed"
Re: A little riddle
Posted: 13 Jun 2008, 04:37
by lurker
manored wrote:I would have said "and know he had missed" instead of "and know the first had missed"
Good point.
Re: A little riddle
Posted: 13 Jun 2008, 10:04
by tombom
Oh and also bibim's second thing it now doesn't matter which you choose. I can't remember why but I know that having the host know which doors are which is a very important part of why the "normal" version is 2/3 for switching.
Re: A little riddle
Posted: 13 Jun 2008, 11:41
by SwiftSpear
tombom wrote:Oh and also bibim's second thing it now doesn't matter which you choose. I can't remember why but I know that having the host know which doors are which is a very important part of why the "normal" version is 2/3 for switching.
The only reason it's important is if the second player is capable winning as well. If the second player always loses he performs absolutely identically to the host who knows which door is empty, and therefore is irrellevant to the simulation. We could modify det's simulation so that the second player chooses randomly and the game drops every instance in which he wins from the statistics. In that case we'll see that the simulation is the same. Since you have a 1/3 chance of winning at the start, and one wrong element is always removed, your chances are always better if you switch.
Re: A little riddle
Posted: 13 Jun 2008, 12:39
by bibim
SwiftSpear wrote:We could modify det's simulation so that the second player chooses randomly and the game drops every instance in which he wins from the statistics. In that case we'll see that the simulation is the same.
I wouldn't be that sure

Re: A little riddle
Posted: 14 Jun 2008, 14:36
by SwiftSpear
bibim wrote:SwiftSpear wrote:We could modify det's simulation so that the second player chooses randomly and the game drops every instance in which he wins from the statistics. In that case we'll see that the simulation is the same.
I wouldn't be that sure

if the 1/3 of the games the second player wins count then it will significantly change the simulation, if they don't then the simulation remains identical.
Re: A little riddle
Posted: 14 Jun 2008, 16:22
by bibim
SwiftSpear wrote:bibim wrote:SwiftSpear wrote:We could modify det's simulation so that the second player chooses randomly and the game drops every instance in which he wins from the statistics. In that case we'll see that the simulation is the same.
I wouldn't be that sure

if the 1/3 of the games the second player wins count then it will significantly change the simulation, if they don't then the simulation remains identical.
No they don't count, as you said before, because it's stated there is nothing behind his door.
Re: A little riddle
Posted: 25 Jun 2008, 20:18
by bibim
I've made a small Perl script to simulate the two riddles. It's clearly not optimized at all, I just wanted to make an easily understandable implementation, nearest as possible from the "real game".
Here it is.
And here is the result:
Code: Select all
anonymous@localhost:~$ ./riddles.pl 1
Winning rate when keeping the same door: 33.062
Winning rate when changing door: 66.938
anonymous@localhost:~$ ./riddles.pl 2
Winning rate when keeping the same door: 49.793
Winning rate when changing door: 50.207
Re: A little riddle
Posted: 26 Jun 2008, 12:54
by Dragon45
good lord det, ocaml?
i should write a brainfuck simulation of this just to spite you
Re: A little riddle
Posted: 26 Jun 2008, 14:42
by SwiftSpear
Perl is a mindfuck...
well... I'm not familiar with the syntax at all, but I can't figure out what's going on either way.
Still... the second problem is no different from the first, knowledge of the correct door is irrelevant if some arbitrary higher entity prevents you from selecting the correct door every time anyways.
The problem is that we're dropping 1 third of our simulations, and in those simulations the player has always selected the wrong door first. So basically, since we have an initial chance of 2/3 to select a wrong door first, but a 50% chance of ending the simulation every time a wrong door is selected, we've altered the simulation in a way the rules didn't explicitly describe... Although it is interesting how that effects the statistics, and it was something I didn't initially suspect, it's still technically breaking our rules since the ignorant player somehow magically fails to select the correct door every time via the riddle, however, our simulation changes that in such that he succeeds most of the time, but we just ignore those instances. Evidently it's not as trivial a difference as I would have initially thought.
Re: A little riddle
Posted: 26 Jun 2008, 17:13
by bibim
SwiftSpear wrote:Still... the second problem is no different from the first, knowledge of the correct door is irrelevant if some arbitrary higher entity prevents you from selecting the correct door every time anyways.
I don't see what you mean :/
SwiftSpear wrote:The problem is that we're dropping 1 third of our simulations, and in those simulations the player has always selected the wrong door first. So basically, since we have an initial chance of 2/3 to select a wrong door first, but a 50% chance of ending the simulation every time a wrong door is selected, we've altered the simulation in a way the rules didn't explicitly describe...
No, we simply are taking into account conditional probabilities... Actually, this is the real difference between the 2 riddles: in the first riddle, we know that the other person will open a bad door even before we choose our first door. So when the other person opens the bad door, it doesn't alter the probability to have chosen the good door initially (1/3). These two events are independent. Whereas in the second riddle, the fact that the door opened by the other guy isn't the good one gives us information. As you explained, he has more chance to open a bad door if we chose the good door initially. These two events are dependent. So the fact that he chose randomly a bad door increases our chance to have the good door to 1/2. That's why we can't simulate these 2 riddles in the same way.
SwiftSpear wrote:Although it is interesting how that effects the statistics, and it was something I didn't initially suspect, it's still technically breaking our rules since the ignorant player somehow magically fails to select the correct door every time via the riddle, however, our simulation changes that in such that he succeeds most of the time, but we just ignore those instances. Evidently it's not as trivial a difference as I would have initially thought.
I don't understand :/ The riddle only speaks about one iteration of the game, and we know that the other guy has opened a bad door. What we are doing in the Perl script is simply performing this game several times, in order to obtain an approximation of the probabilities. But to obtain this approximation we have to be in the exact case of the riddle, i.e: we have to drop iterations where the other guy chooses the good door because in our single case, he chose a bad one...
Re: A little riddle
Posted: 26 Jun 2008, 22:13
by Dragon45
okay i somehow ended up writing a brainfuck interpreter in python last night
i'll try and write an actual python simulator for the Monty Hall problem sometime later...
Re: A little riddle
Posted: 26 Jun 2008, 22:47
by Kloot
Python version is trivial:
Code: Select all
import random
numGames = 10000
gameDoors = [0, 1, 2]
playerDoors = [0, 1, 2]
switch = True
wins = 0
losses = 0
for i in range(numGames):
playerDoor = random.choice(gameDoors)
prizeDoor = random.choice(gameDoors)
if (playerDoor == prizeDoor):
gameDoors.remove(prizeDoor)
else:
gameDoors.remove(playerDoor)
gameDoors.remove(prizeDoor)
hostDoor = random.choice(gameDoors)
if (switch):
playerDoors.remove(playerDoor)
playerDoors.remove(hostDoor)
playerDoor = playerDoors[0]
playerDoors = [0, 1, 2]
if (playerDoor == prizeDoor):
wins += 1
else:
losses += 1
gameDoors = [0, 1, 2]
winPerc = (float(wins) / numGames) * 100
lossPerc = (float(losses) / numGames) * 100
print "wins: %d (%.2f%%), losses: %d (%.2f%%)" % (wins, winPerc, losses, lossPerc)
Code: Select all
switch = True
python ./MontyHall.py
wins: 6665 (66.65%), losses: 3335 (33.35%)
switch = False
python ./MontyHall.py
wins: 3283 (32.83%), losses: 6717 (67.17%)
Re: A little riddle
Posted: 26 Jun 2008, 23:05
by tombom
swiftspear is just _wrong_ and it's depressing that he won't accept this
Re: A little riddle
Posted: 26 Jun 2008, 23:44
by bibim
Kloot wrote:Code: Select all
playerDoor = random.choice(gameDoors)
prizeDoor = random.choice(gameDoors)
gameDoors.remove(prizeDoor)
hostDoor = random.choice(gameDoors)
Well, I dont know Python at all, however it seems you forgot to remove the playerDoor from the gameDoors before choosing the hostDoor. Maybe that would explain why you have "win ratio when keeping door" + "win ratio when switching" != 100% ...
Re: A little riddle
Posted: 27 Jun 2008, 00:30
by Kloot
Oops, nice catch. Post is bugfixed now.

Re: A little riddle
Posted: 27 Jun 2008, 03:44
by manored
Just remembered another riddle: There are 2 men, one is the "correct" and the other is the "false". The correct always tells the truth and the false always lies. You must discover who is who, but you can only do so by making a single question that both will answer. What question must you make?