Skip to content

Instantly share code, notes, and snippets.

@moocowmoo
Last active October 8, 2019 21:07
Show Gist options
  • Save moocowmoo/b56c8206ad77367bd6832ab8f51778ee to your computer and use it in GitHub Desktop.
Save moocowmoo/b56c8206ad77367bd6832ab8f51778ee to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
def selection_probability(mns, blocks):
p_pool = mns / 10
p_prob = 1.0 - ((float(p_pool - 1) / float(p_pool)) ** float(blocks))
return "{:0.2f}%".format(p_prob * 100)
masternode_count = 4387
print '{0:>2} {1:>8} {2:>8}'.format("hour", "blocks", "prob")
for hour in [1, 2, 3, 4, 6, 8, 10, 12, 18, 24, 30, 36, 42, 48, 72, 96]:
blocks = 23.07 * hour # avg 2.6m per block == 23.07 blocks per hour
print '{0:>4} {1:>8.2f} {2:>8}'.format(hour, blocks, selection_probability(masternode_count, blocks))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment