Answer:
the formula to calculate modified duration of bonds:
modified duration = [1 - (1 + y)⁻ⁿ] / y
modified duration = [1 - (1 + 10%)⁻⁴] / 10% = 0.317 / 10% = 3.17 years
if you want to determine the Macaulay duration = modified duration x (1 + yield) = 3.17 years x 1.1 = 3.49 years
The modified duration shows how a bond's value can change as a result of a change in the interest rate.