If the square root of people produce half of the value, how many times higher than the average salary should the salary of the top people be?
import math
def run(number, percent):
# print('| %9.2f | %6.2f%% | %6.2f%% |' % (number, percent, percent / number))
nxt = math.sqrt(number)
if 2 * nxt > number:
return percent / number
return run(nxt, percent / 2.)
for exp in range(5):
number = math.pow(10, exp + 1)
top = run(number, 100.)
avg = 100. / number
print('| %6.0f | %5.2f%% | %6.3f%% | %7.2fx |' % (number, top, avg, top / avg))