Question 1162507
```python?code_reference&code_event_index=2
import pandas as pd

# Given values
fv = 2500000
annual_rate = 0.08
compounding_frequency = 4
years = 2
n = years * compounding_frequency
i = annual_rate / compounding_frequency

# Calculate Payment (PMT)
# FV = PMT * ((1 + i)**n - 1) / i
pmt = (fv * i) / ((1 + i)**n - 1)

# Sinking Fund Schedule
schedule = []
balance = 0

for period in range(1, n + 1):
    interest = balance * i
    increase = pmt + interest
    balance += increase
    schedule.append({
        "Quarter": period,
        "Payment": pmt,
        "Interest Earned": interest,
        "Increase in Fund": increase,
        "Fund Balance": balance
    })

df_schedule = pd.DataFrame(schedule)

# Format for output
print(f"Quarterly Payment: {pmt}")
print(df_schedule)

# Write to CSV
df_schedule.to_csv("sinking_fund_schedule.csv", index=False)


```
```text?code_stdout&code_event_index=2
Quarterly Payment: 291274.49783440644
   Quarter        Payment  Interest Earned  Increase in Fund  Fund Balance
0        1  291274.497834         0.000000     291274.497834  2.912745e+05
1        2  291274.497834      5825.489957     297099.987791  5.883745e+05
2        3  291274.497834     11767.489713     303041.987547  8.914165e+05
3        4  291274.497834     17828.329463     309102.827298  1.200519e+06
4        5  291274.497834     24010.386009     315284.883844  1.515804e+06
5        6  291274.497834     30316.083686     321590.581521  1.837395e+06
6        7  291274.497834     36747.895317     328022.393151  2.165417e+06
7        8  291274.497834     43308.343180     334582.841014  2.500000e+06

```

[file-tag: code-generated-file-0-1776522428876279223]

To calculate the quarterly payment for the sinking fund, we use the formula for the future value of an ordinary annuity:

$$FV = PMT \times \frac{(1 + i)^n - 1}{i}$$

Where:
* $FV = \text{RM } 2,500,000$ (The future amount needed)
* $r = 0.08$ (Annual interest rate)
* $m = 4$ (Quarterly compounding)
* $i = \frac{r}{m} = \frac{0.08}{4} = 0.02$ (Quarterly interest rate)
* $t = 2 \text{ years}$
* $n = t \times m = 2 \times 4 = 8$ (Total number of quarterly payments)

### 1. Quarterly Payment Calculation
Rearranging the formula to solve for $PMT$:

$$PMT = \frac{FV \times i}{(1 + i)^n - 1}$$
$$PMT = \frac{2,500,000 \times 0.02}{(1 + 0.02)^8 - 1}$$
$$PMT = \frac{50,000}{(1.02)^8 - 1}$$
$$PMT \approx \text{RM } 291,274.50$$

The quarterly payment required is **RM 291,274.50**.

### 2. Sinking Fund Schedule
The following schedule shows the accumulation of assets in the sinking fund over the 2-year period.

| Quarter | Payment (RM) | Interest Earned (RM) | Increase in Fund (RM) | Fund Balance (RM) |
| :--- | :--- | :--- | :--- | :--- |
| 1 | 291,274.50 | 0.00 | 291,274.50 | 291,274.50 |
| 2 | 291,274.50 | 5,825.49 | 297,099.99 | 588,374.49 |
| 3 | 291,274.50 | 11,767.49 | 303,041.99 | 891,416.48 |
| 4 | 291,274.50 | 17,828.33 | 309,102.83 | 1,200,519.31 |
| 5 | 291,274.50 | 24,010.39 | 315,284.89 | 1,515,804.20 |
| 6 | 291,274.50 | 30,316.08 | 321,590.58 | 1,837,394.78 |
| 7 | 291,274.50 | 36,747.90 | 328,022.40 | 2,165,417.18 |
| 8 | 291,274.50 | 43,308.34 | 334,582.84 | 2,500,000.02* |

*\*Minor difference due to rounding.*

The complete schedule has been saved to `sinking_fund_schedule.csv`.