Skip to content

Instantly share code, notes, and snippets.

@laerreal
Created March 28, 2019 21:13
Show Gist options
  • Save laerreal/6a24eef9028921dbbbb4f483c03a4493 to your computer and use it in GitHub Desktop.
Save laerreal/6a24eef9028921dbbbb4f483c03a4493 to your computer and use it in GitHub Desktop.
from random import choice
# https://www.youtube.com/watch?v=HzbObZRCy9U
cards = [(True, True), (False, False), (True, False)]
N = 100000
matches = 0
for _ in range(N):
c = choice(cards)
matches += (c[0] == c[1])
print("%f" % (float(matches)/float(N)))
@laerreal
Copy link
Author

0.665360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment