'''
I could understand the explanation of the Monty Hall problem
but needed some more evidence

References:
  http:
  http:
  http:
'''
from random import randrange

doors, iterations = 3,100000  

def monty_hall(choice, switch=False, doorCount=doors):
  
  door = [False]*doorCount
  
  door[randrange(doorCount)] = True

  chosen = door[choice]

  unpicked = door
  del unpicked[choice]

  
  
  
  alternative = True in unpicked

  if switch:
    return alternative
  else:
    return chosen

print 
print doors, , iterations, 

print ,
print sum(monty_hall(randrange(3), switch=False)
          for x in range(iterations)),
print , iterations, 
print ,
print sum(monty_hall(randrange(3), switch=True)
          for x in range(iterations)),
print , iterations,