Skip to content

Instantly share code, notes, and snippets.

@ttycelery
Created January 23, 2023 13:26
Show Gist options
  • Save ttycelery/020601c98d6aab557a11c79163480ac8 to your computer and use it in GitHub Desktop.
Save ttycelery/020601c98d6aab557a11c79163480ac8 to your computer and use it in GitHub Desktop.
Simulate monero.win winning probability
# Test how profitable is monero.win
# it's not :/
import random
import time
balance = 0.1
bet_size = 0.01
profit_per_bet = 0.009
losing_digit = 8
iterations = 100
charset = '0123456789abcdef'
w = 0
l = 0
for i in range(1, iterations + 1):
if balance < bet_size:
print('can not continue, balance is less than bet size')
break
print(f'bet #{i}:\t balance={balance}, win={w} (p={w/i}), loss={l} (p={l/i})')
guesses = charset
for _ in range(losing_digit):
offset = random.randint(0, len(guesses) - 1)
guesses = guesses[:offset] + guesses[offset+1:]
last_digit = random.choice(charset)
if last_digit in guesses:
balance += profit_per_bet
w += 1
else:
balance -= bet_size
l += 1
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment