// Numbas version: finer_feedback_settings {"name": "cash flow amount - annuity due", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["years", "period", "ipadec", "ipa", "n", "P", "C", "Crounded"], "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"variableReplacements": [], "marks": 0, "prompt": "
Suppose you borrow $\\$\\var{P}$ to buy a house. The term of the loan is $\\var{years}$ years, and you will need to make {period[0]} repayments on the loan at the beginning of each {period[2]}. Interest is $\\var{ipa}\\%$ per annum compounding {period[0]}. Calculate the size of your monthly repayment.
\n\n$\\$$ [[0]] (to the nearest cent)
", "useCustomName": false, "gaps": [{"variableReplacements": [], "allowFractions": false, "marks": 1, "notationStyles": ["plain", "en", "si-en"], "minValue": "C", "useCustomName": false, "showCorrectAnswer": true, "precisionMessage": "You have not given your answer to the nearest cent.", "unitTests": [], "precisionType": "dp", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "scripts": {}, "maxValue": "C", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showPrecisionHint": false, "showFeedbackIcon": true, "precisionPartialCredit": 0, "customName": "", "strictPrecision": true, "precision": "2"}], "showFeedbackIcon": true, "showCorrectAnswer": true, "unitTests": [], "customName": "", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "scripts": {}, "sortAnswers": false}], "variable_groups": [], "extensions": [], "advice": "You are asked to find the cash flow amount of an annuity due (since the payments are at the beginning of each period) and we are given the present value of the annuity. Therefore we will use the present value of an annuity due formula
\n$\\displaystyle P=\\frac{C}{i}\\left(1-\\frac{1}{(1+i)^n}\\right)(1+i)$
\nwhere $P$ is the present value, $C$ is the cash flow per period, $i$ is the interest rate per period, and $n$ is the number of periods.
\nIn our situation we have,
\n$P=\\var{P}$,
\n$i=\\frac{\\var{ipa}\\%}{\\var{period[1]}}=\\frac{\\var{ipadec}}{\\var{period[1]}}$,
\n$n=\\var{years}\\times \\var{period[1]}=\\var{n}$,
\nand therefore we have
\n$\\displaystyle \\var{P}=\\frac{C}{\\left(\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)}\\left(1-\\frac{1}{\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)^\\var{n}}\\right)\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)$
\nwhich we need to rearrange to solve for $C$.
\n\nWe want to get $C$ by itself. We start by multiplying both sides by $\\left(\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)$ (to remove the division of $C$ by it on the right hand side)
\n$\\displaystyle \\var{P}\\left(\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)=C\\left(1-\\frac{1}{\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)^\\var{n}}\\right)\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)$
\nNext we will divide both sides by $\\left(1-\\frac{1}{\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)^\\var{n}}\\right)\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)$ (to remove the multiplication by it on $C$)
\n$\\displaystyle \\frac{\\var{P}\\left(\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)}{\\left(1-\\frac{1}{\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)^\\var{n}}\\right)\\left(1+\\simplify[unitDenominator]{{ipadec}/{period[1]}}\\right)}=C$
\nCalculating this we find
\n$\\begin{align}C&\\approx \\var{C}\\\\&=\\$\\var{Crounded}\\quad \\text{(to the nearest cent)}\\end{align}$
", "name": "cash flow amount - annuity due", "variables": {"P": {"templateType": "anything", "definition": "random(100000..1000000#1000)", "description": "", "name": "P", "group": "Ungrouped variables"}, "period": {"templateType": "anything", "definition": "['monthly',12,'month']", "description": "", "name": "period", "group": "Ungrouped variables"}, "ipadec": {"templateType": "anything", "definition": "random(0.01..0.06#0.0001)", "description": "", "name": "ipadec", "group": "Ungrouped variables"}, "ipa": {"templateType": "anything", "definition": "ipadec*100", "description": "", "name": "ipa", "group": "Ungrouped variables"}, "Crounded": {"templateType": "anything", "definition": "precround(C,2)", "description": "", "name": "Crounded", "group": "Ungrouped variables"}, "n": {"templateType": "anything", "definition": "years*period[1]", "description": "", "name": "n", "group": "Ungrouped variables"}, "years": {"templateType": "anything", "definition": "random(20,25,30)", "description": "", "name": "years", "group": "Ungrouped variables"}, "C": {"templateType": "anything", "definition": "(P*(ipadec/period[1])/(1-1/(1+ipadec/period[1])^n))/(1+ipadec/period[1])", "description": "", "name": "C", "group": "Ungrouped variables"}}, "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.
", "metadata": {"description": "Financial maths. Repayments on a home loan.", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "functions": {}, "rulesets": {}, "tags": [], "type": "question", "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/"}]}