Created
December 18, 2016 14:08
-
-
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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