f22t3cs121-Lec4-The Meaning of Loops
f22t3cs121-Lec4-The Meaning of Loops
Prof Sane
1. What is a Computation / Program
a. Any steps of any sort that produce sequences of values in collections of boxes
2. Sequences of values
a. values of i → 1, 2, 3, 4, …
b. values of S → 1, 3, 6, 10, …
c. S(1) → 1*(1+1)/2, S(2) → 2*(2+1)/2 and so on
d. This formula S of 1 to n == n*(n+1)/2 is true for every step of the sequence
3. What is compound interest and if you can remember the formula or ideally
derive it.
4.
Derivation of Compound interest
a0 : P
a1 : a0 + a0*r ; a1 = a0(1 + r)
an = a0 * (1 + r)^n
Rohan
Compound interest is a system for incurring interests on a principal amount.
Rather than applying the interest to the base amount like simple interest, it applies
it to the new value with the interest.
Pratik Patil
Compound interest is the interest on a loan or deposit calculated based on both
the initial principal and the accumulated interest from previous periods. The
formula for compound interest is A = P(1 + r/n)^(nt), where A is the final amount, P
is the principal, r is the annual interest rate, n is the number of times the interest is
compounded per year, and t is the number of years.
Pratik Patil2
Ishaan
Compound interest is interest calculated on a particular amount of money, which updates
after every iteration. This means that the interest rate stays constant, but the principal
amount increases by the amount of interest calculated in one unit of time.
Formula - A = P(1 + r/n)^nt
P - Principal Amount
r - Rate of Interest
n - Number of times interest is compounded per year
t - Time in Years
A - Amount
Mukund Tekriwal
Compound interest is when you are adding the interest earned by you into the principal amount after each interest term.
Amount = P [ 1 + r/100]^n
P = principal amount
n = number of years
To use loops for calculating compound interest, use the simple interest formula for each year.
P
Deevankumar
Gurpreet
Interest on last year’s amount each time
Amount ( 1 + interest/100)^t
Nidhi
A = P * ( 1 + R/N)^NT
Kinjal
Compound interest increases from the amount of the interest accumulated from all
previous time periods.
A= final amount
r= interest rate
A = Final Amount
P = principal sum
R = rate of interest
N = number of times interest is compounded in a time period (usually a year)
T = time period
Formula => A = P(1 + (R/N)) ** (NT)
Kaavya Rajasekar
● A = amount
● P = principal
● r = rate of interest
● n = number of times interest is compounded per year
● t = time (in years)
Compound interest is when you earn interest on both the money you've saved and the interest you earn.
The compound interest formula can be derived with the help of of simple interest, formulas as shown below.
S.I = (PRT/100)
Where; P is the principal amount, R is the rate of interest and T denotes the time.
The simple interest = CI for one year
Amount = SI+P
This total amount is now the principal for second year as per the CI concept: Hence P(for second year) = P(1+R/100)
Therefore, the amount after the 2nd year is again= SI+P= P(1 + R/100)
Now, Cl = A - P
CI = P * (1 + R/100) ^ n - P
CI = P[(1 + R/100) ^ n - 1]
Hence proved.
Piya Shah
A = p(1+(r/100))^t
CI = A - p
A = amount
p = principle
r = rate of interest
t = time
CI = compound interest
Sneh Pahuja
What is compound interest
F = final amount
T = time
P = principal amount
R = rate of interest
F1 = P + P*r/100
For the next time period the new P, F1 becomes the new principal amount for interest
F2 = F1 + F1*r/100
= P+P*r/100 + {(P + P*r/100) * r /100}
= P(1 + r/100) + {P(1 + r/100)* r/100}
= P(1 + r/100)(1 + r/100)
= P (1 + r/100)^2 which is time t
= P(1 + r/100)^t
To get interest we have to subtract principal
= P(1 + r/100)^t - P