Created
February 15, 2019 04:56
-
-
Save erikbern/6021303b17619dbb8bf3a181142e0794 to your computer and use it in GitHub Desktop.
This file contains 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 numpy | |
import scipy.optimize | |
from matplotlib import pyplot | |
cs = numpy.linspace(0.01, 0.99, 100) | |
ks = [] | |
for c in cs: | |
def f(log_k): | |
k = numpy.exp(log_k) | |
return (c/k + 1-c)*k**0.6 | |
res = scipy.optimize.minimize(f, 0) | |
optimal_log_k, = res.x | |
ks.append(numpy.exp(optimal_log_k)) | |
pyplot.semilogy(cs, ks) | |
pyplot.grid() | |
pyplot.xlabel('Fraction of the time spend on real work') | |
pyplot.ylabel('What multiple engineers should you hire') | |
pyplot.savefig('2x-engineer-productivity.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment