Skip to content

Instantly share code, notes, and snippets.

@MarcoF1
Last active December 2, 2021 03:50
Show Gist options
  • Save MarcoF1/300c863b79df0fd9a1120e6377295ec3 to your computer and use it in GitHub Desktop.
Save MarcoF1/300c863b79df0fd9a1120e6377295ec3 to your computer and use it in GitHub Desktop.
# Bain Fund
# FV = projected cash flow for each year (amount you expect to receive)
# n = number of periods out the cash flow is from the present
def present_value(FV, n, discount_rate=.1):
return FV/((1 + discount_rate)**n)
if __name__ == "__main__":
gross_rates_of_return = [.05, .15, .25, .35, .45]
fund_start_size = 200000000 # 200 million
for rate in gross_rates_of_return:
installments = [fund_start_size/4, fund_start_size/4, fund_start_size/4, fund_start_size/4]
for year in range(1, 10):
# each investment is split into 4 equal parts and done within the first 4 years
if year <= 5:
# installment #1
installment_number = 0
installments[installment_number] = installments[installment_number] + installments[installment_number]*rate
if year > 1 and year <= 6:
# installment #2
installment_number = 1
installments[installment_number] = installments[installment_number] + installments[installment_number]*rate
if year > 2 and year <= 7:
# installment #2
installment_number = 2
installments[installment_number] = installments[installment_number] + installments[installment_number]*rate
if year > 3 and year <= 8:
# installment #2
installment_number = 3
installments[installment_number] = installments[installment_number] + installments[installment_number]*rate
rate_present_value = present_value(sum(installments), 10)
print("rate return: ", rate,
" present value ", rate_present_value,
" worth? ", rate_present_value > fund_start_size
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment