// Numbas version: exam_results_page_options {"name": "number of time periods - compound interest (annual only)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "number of time periods - compound interest (annual only)", "statement": "

If you are unsure of how to do a question, click on Reveal answers to see the full working. Then, once you understand how to do the question, click on Try another question like this one to start again. Do each question repeatedly to ensure you have mastered it.

", "advice": "

We are asked to find the number of time periods using compound interest. Therefore we will use the compound interest equation

\n

$S=P(1+i)^n$,

\n

where $S$ is the future value, $P$ is the present value, $i$ is the interest rate per time period and $n$ is the number of time periods.

\n

In our situation we have, 

\n

$S=\\var{S}$

\n

$P=\\var{P}$,

\n

$i=\\var{ipa}\\%=\\var{ipadec}$,

\n

and therefore we have

\n

$\\var{S}=\\var{P}\\left(1+\\var{ipadec}\\right)^n$,

\n

which we need to rearrange to solve for $n$.

\n

\n

We want to get $n$ by itself. We start by dividing both sides by $\\var{P}$ (to remove the multiplication by $\\var{P}$)

\n

$\\displaystyle \\frac{\\var{S}}{\\var{P}}=\\left(1+\\var{ipadec}\\right)^n$.

\n

Now, notice that $n$ is a power. To work out what $n$ is we will need to bring it down, in order to do this we apply $\\log$ to both sides

\n

$\\displaystyle \\log\\left(\\frac{\\var{S}}{\\var{P}}\\right)=\\log\\left(\\left(1+\\var{ipadec}\\right)^n\\right)$.

\n

We do this in order to apply the log law $\\log(x^n)=n\\log(x)$ which allows us to bring the power down

\n

$\\displaystyle \\log\\left(\\frac{\\var{S}}{\\var{P}}\\right)=n\\log\\left(1+\\var{ipadec}\\right)$.

\n

Notice that on the right hand side, $n$ is now multiplied by $\\log\\left(1+\\var{ipadec}\\right)$. Since we want $n$ by itself, we divide both sides by $\\log\\left(1+\\var{ipadec}\\right)$

\n

$\\displaystyle \\frac{\\log\\left(\\frac{\\var{S}}{\\var{P}}\\right)}{\\log\\left(1+\\var{ipadec}\\right)}=n$.

\n

\n

Calculating this we find 

\n

$n\\approx \\var{n}$

\n

but we don't round this in the traditional sense since we require an entire time period to elapse for the interest to be paid, therefore we always round up to the nearest whole number.

\n

That is, we need to wait $\\var{nrounded}$ time periods (years).

", "extensions": [], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "Using interest compounded yearly determine the interest rate"}, "variable_groups": [], "functions": {}, "variables": {"years": {"name": "years", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "n/period[1]"}, "ipa": {"name": "ipa", "templateType": "anything", "description": "

\\var{period[2]}\\left(\\left(\\frac{\\var{S}}{\\var{P}}\\right)^{\\frac{1}{\\var{n}}}-1\\right)

", "group": "Ungrouped variables", "definition": "random(1..7#0.1)"}, "n": {"name": "n", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "log(S/P)/log(1+ippdec)"}, "ippdec": {"name": "ippdec", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "ipadec/period[1]"}, "ipadec": {"name": "ipadec", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "ipa/100"}, "P": {"name": "P", "templateType": "anything", "description": "

present value

", "group": "Ungrouped variables", "definition": "random(1000..100000#1000)"}, "S": {"name": "S", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "ceil(P+random(0.3..1#0.05)*P)"}, "period": {"name": "period", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "[random('yearly','annually'),1]"}, "test": {"name": "test", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "P*(1+ipadec/period[1])^(n)"}, "nrounded": {"name": "nrounded", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "ceil(n)"}}, "tags": [], "parts": [{"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"correctAnswerStyle": "plain", "variableReplacements": [], "customMarkingAlgorithm": "", "minValue": "nrounded", "type": "numberentry", "maxValue": "nrounded", "useCustomName": false, "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "showFractionHint": true, "correctAnswerFraction": false, "customName": "", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "mustBeReduced": false, "allowFractions": false, "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 1}], "type": "gapfill", "useCustomName": false, "showCorrectAnswer": true, "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

You deposit $\\$\\var{P}$ into a bank account with an interest rate of $\\var{ipa}\\%$ per annum compounded {period[0]}. How many years will it take for the balance to be at least $\\$\\var{S}$? 

\n

\n

[[0]] years

", "unitTests": [], "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"js": "", "css": ""}, "rulesets": {}, "ungrouped_variables": ["P", "S", "years", "period", "ipa", "ipadec", "ippdec", "test", "n", "nrounded"], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}