Skip to content

Instantly share code, notes, and snippets.

@erikbern
Created February 15, 2019 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikbern/6021303b17619dbb8bf3a181142e0794 to your computer and use it in GitHub Desktop.
Save erikbern/6021303b17619dbb8bf3a181142e0794 to your computer and use it in GitHub Desktop.
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