Compounded Interest rate with Python

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

What supposed to be an interest rate to make 1usd savings per day for 365 days to become 30000

To find the interest rate that would make daily savings of $1 grow to $30,000 over 365 days, we
can use the formula for the future value of a series of equal payments (an annuity), with interest
compounded daily.

The future value FVFVFV of an annuity can be calculated using the formula:
FV=P×(1+r)n−1rFV = P \times \frac{(1 + r)^n - 1}{r}FV=P×r(1+r)n−1

Where:

 PPP is the amount saved daily ($1)


 rrr is the daily interest rate
 nnn is the total number of payments (365)
 FVFVFV is the future value ($30,000)

Given FV=30,000FV = 30,000FV=30,000, P=1P = 1P=1, and n=365n = 365n=365, we need to


solve for rrr.

Rearranging the formula to solve for rrr: 30,000=1×(1+r)365−1r30,000 = 1 \times \frac{(1 +


r)^{365} - 1}{r}30,000=1×r(1+r)365−1

This equation is complex to solve algebraically, so we'll use numerical methods to find rrr. Let's
calculate this using Python.

To achieve a future value of $30,000 from daily savings of $1 over 365 days, the required annual
interest rate would be approximately 51833.51%. This is an extraordinarily high interest rate and
is not feasible in any standard financial scenario. It suggests that reaching $30,000 from such
small daily savings in such a short period is unrealistic under normal financial conditions.

from scipy.optimize import fsolve

# Define the function based on the formula

def future_value_daily_savings(r, P, n, FV):

return P * ((1 + r)**n - 1) / r - FV

# Constants

P=1 # Daily savings amount in USD


n = 365 # Total number of days

FV = 30000 # Future value in USD

# Initial guess for the interest rate

initial_guess = 0.1

# Solving for the daily interest rate

daily_interest_rate, = fsolve(future_value_daily_savings, initial_guess, args=(P, n, FV))

# Converting the daily interest rate to an annual interest rate

annual_interest_rate = (1 + daily_interest_rate) ** 365 - 1

annual_interest_rate

You might also like