title: Monty Hall Python Simulation
body: <p>So I was working on simulating the monty hall problem in python, and I obtained the solution from the Harvad Stats 111 course. The function below is supposed to reveal a door that isn't the prize door or the guess door. However, I'm confused as to what two parts of the functions do. First of all, what does the bad.any() do, and why is it necessary. Isn't it enough to simply say "if not bad". And secondly what exactly does the last line achieve.</p>
  
  <p>Thanks a lot</p>
  
  <pre><code>def goat_door(prizedoors, guesses):
  
  #strategy: generate random answers, and
  #keep updating until they satisfy the rule
  #that they aren't a prizedoor or a guess
  result = np.random.randint(0, 3, prizedoors.size)
  while True:
      bad = (result == prizedoors) | (result == guesses)
      if not bad.any(): #DON'T UNDERSTAND THIS
          return result
      result[bad] = np.random.randint(0, 3, bad.sum()) #DON'T UNDERSTAND THIS
  </code></pre>