This problem is solved by looking at the definitions of certain terms. APR (annual percentage return) is the percent that you would pay on the balance if you left it in the bank for a year with no compounding. This gets confusing because the APR is NOT the percent you would expect to pay in real life, where the interest gets applied and compounded (that real percent is the APY or annual percentage yield, which should be greater than APR).
To calculate the amount of debt you have at any given time, you actually need more information: the number of periods the interest is compounded in a year. You might expect in this situation it would be monthly, in which case that number would be 12. You divide APR by this number to obtain the rate used to calculate the interest at the end of each period.
The basic formula for a balance after t months with monthly compounded interest is the following:
`B = B_0 * (1+(APR)/12)^t`
`B_0` is the initial balance in this equation, and `B` is the balance after t months.
We need to make a modification here, because you are planning to pay 3% of the the balance every month (presumably what is on the balance of the bill, which also includes the interest charges). That would result in the following equation:
`B = B_0*(1+(APR)/12 - 0.03)^t`
Now, to get our result, we simply plug the numbers in:
`B = 5000 * (1+ 0.22/12 - 0.03)^t=5000*(0.9883)^t`
If the interest compounds at any frequency that is not monthly, you would need to modify the equation to get the proper function of t.