Skip to content

Instantly share code, notes, and snippets.

@amlwwalker
Created November 5, 2016 12:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amlwwalker/45f3309922f9ae06ee33fcf75f911a59 to your computer and use it in GitHub Desktop.
Save amlwwalker/45f3309922f9ae06ee33fcf75f911a59 to your computer and use it in GitHub Desktop.
Given a 10 percent chance of a 100 times payoff you should take that bet every time. But you're still going to be wrong nine times out of 10
from random import randint
print "Given a 10 percent chance of a 100 times payoff you should take that bet every time. But you're still going to be wrong nine times out of 10"
humanGuess = 4
humanMoney = 10
#first we need a random number, of 1 to 10
for i in range (1,100):
randomNumber = randint(1,10)
print "Riches: ", humanMoney
if (randomNumber == humanGuess):
humanMoney += 100
print "Riches: ", humanMoney
break
else:
humanMoney -= 1
if (humanMoney == 0):
print "the human is broke: ", humanMoney
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment