// Numbas version: exam_results_page_options {"name": "number of time periods - compound interest", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"js": "", "css": ""}, "variable_groups": [], "ungrouped_variables": ["P", "S", "years", "period", "ipa", "ipadec", "ippdec", "test", "n", "nrounded"], "metadata": {"description": "Using interest compounded at common time intervals (except yearly) determine the interest rate per annum", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "extensions": [], "variables": {"ippdec": {"templateType": "anything", "name": "ippdec", "definition": "ipadec/period[1]", "group": "Ungrouped variables", "description": ""}, "ipadec": {"templateType": "anything", "name": "ipadec", "definition": "ipa/100", "group": "Ungrouped variables", "description": ""}, "period": {"templateType": "anything", "name": "period", "definition": "random([random('half-yearly','semiannually'),2],['quarterly', 4],['monthly',12],['daily', 365])", "group": "Ungrouped variables", "description": ""}, "nrounded": {"templateType": "anything", "name": "nrounded", "definition": "ceil(n)", "group": "Ungrouped variables", "description": ""}, "S": {"templateType": "anything", "name": "S", "definition": "ceil(P+random(0.2..0.9#0.05)*P)", "group": "Ungrouped variables", "description": ""}, "P": {"templateType": "anything", "name": "P", "definition": "random(1000..100000#1000)", "group": "Ungrouped variables", "description": "

present value

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

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

"}}, "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=\\frac{\\var{ipa}\\%}{\\var{period[1]}}=\\simplify[unitDenominator]{{ipadec}/{period[1]}}$,

\n

and therefore we have

\n

$\\var{S}=\\var{P}\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\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+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\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+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\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+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)$.

\n

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

\n

$\\displaystyle \\frac{\\log\\left(\\frac{\\var{S}}{\\var{P}}\\right)}{\\log\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\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.

", "tags": [], "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.

", "parts": [{"sortAnswers": false, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "useCustomName": false, "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 time periods will it take for the balance to be at least $\\$\\var{S}$? 

\n

\n

[[0]] time periods

", "gaps": [{"mustBeReduced": false, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "extendBaseMarkingAlgorithm": true, "useCustomName": false, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "minValue": "nrounded", "variableReplacements": [], "maxValue": "nrounded", "scripts": {}, "showCorrectAnswer": true, "marks": 1, "customName": "", "type": "numberentry", "unitTests": [], "mustBeReducedPC": 0, "customMarkingAlgorithm": ""}], "variableReplacements": [], "scripts": {}, "showCorrectAnswer": true, "marks": 0, "customName": "", "type": "gapfill", "unitTests": [], "customMarkingAlgorithm": ""}], "rulesets": {}, "functions": {}, "name": "number of time periods - compound interest", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}