Skip to content

Instantly share code, notes, and snippets.

@mebusw
Created December 18, 2016 14:08
Show Gist options
  • Save mebusw/0db32413a77b109e4565007d802b01ce to your computer and use it in GitHub Desktop.
Save mebusw/0db32413a77b109e4565007d802b01ce to your computer and use it in GitHub Desktop.
given a team can finish 1~6 feature of same size per day, then how many days can you commit to finish 20 features?
import random
TIMES = 10000
def once(acc=0, days=0):
return days if acc >= 20 else once(acc + random.choice(xrange(1,7)), days + 1)
s1 = [once() for i in xrange(TIMES)]
s1.sort()
### 90% percentile
print s1[int(TIMES * 0.9)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment