// Numbas version: finer_feedback_settings {"name": "Partial sum of an arithmetic sequence - birthday money", "extensions": ["random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["person", "pronouns"], "name": "A person"}], "metadata": {"description": "

The amount of money a person gets on their birthday follows an arithmetic sequence.

\n

Calculate the amount on a given birthday, then calculate the sum up to that point.

", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": ["m", "n", "c", "ci", "ni", "b", "first"], "functions": {}, "extensions": ["random_person"], "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "statement": "

{person['name']}'s parents deposit a uniformly increasing amount of money into a savings account for {pronouns['them']} every year on {pronouns['their']} birthday:

\n\n

{person['name']} wants to know the total amount of money that will be in this savings account, excluding interest, after {pronouns['their']} 21st birthday, if {pronouns['their']} parents maintain this pattern.

", "preamble": {"js": "", "css": ""}, "tags": ["Arithmetic sequences", "Arithmetic Sequences", "arithmetic sequences", "nth term", "partial sums", "random names", "sequences", "taxonomy"], "parts": [{"showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true, "prompt": "

How much money will {person['name']}'s parents deposit into the savings account on {pronouns['their']} 21st birthday, if {pronouns['their']} parents maintain this pattern? 

\n

£[[0]].

", "steps": [{"showFeedbackIcon": true, "marks": 0, "scripts": {}, "prompt": "

Use the arithmetic formula,

\n

\\[a_n = a_1 + (n-1)d, \\]

\n

where

\n", "type": "information", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true}, {"correctAnswerStyle": "plain", "scripts": {}, "maxValue": "{first}", "prompt": "

What is the value of $a_1$?

", "mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "marks": "0.2", "minValue": "{first}", "allowFractions": false, "correctAnswerFraction": false, "variableReplacements": [], "mustBeReduced": false}, {"correctAnswerStyle": "plain", "scripts": {}, "maxValue": "{b[1]}", "prompt": "

What is the value of $d$?

", "mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "marks": "0.2", "minValue": "{b[1]}", "allowFractions": false, "correctAnswerFraction": false, "variableReplacements": [], "mustBeReduced": false}, {"showFeedbackIcon": true, "marks": 0, "scripts": {}, "prompt": "

Now use the formula to calculate $a_{21}$.

", "type": "information", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true}], "gaps": [{"scripts": {}, "showpreview": true, "answer": "{first+b[1]*(20)}", "showFeedbackIcon": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "type": "jme", "vsetrange": [0, 1], "checkvariablenames": false, "marks": 1, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "variableReplacements": [], "expectedvariablenames": []}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "stepsPenalty": 0}, {"showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true, "prompt": "

How much money will {person['name']}'s parents have added to this savings account over $21$ years in total, including the money that {person['pronouns']['their']} parents will deposit into the account on {person['pronouns']['their']} $21^{st}$ birthday?

\n

£[[0]].

\n

", "steps": [{"showFeedbackIcon": true, "marks": 0, "scripts": {}, "prompt": "

The sum of an arithmetic sequence $a_1, a_2, \\ldots, a_n$ is calculated by the following formula.

\n

\\[\\sum\\limits_{i=1}^n{a_i}=\\frac{n}{2}(a_1+a_n)\\text{.}\\]

", "type": "information", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true}], "gaps": [{"correctAnswerStyle": "plain", "scripts": {}, "maxValue": "{21*(first+first+b[1]*(20))/2}", "mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "marks": 1, "allowFractions": false, "minValue": "{21*(first+first+b[1]*(20))/2}", "correctAnswerFraction": false, "variableReplacements": [], "mustBeReduced": false}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "stepsPenalty": 0}], "rulesets": {}, "variables": {"b": {"templateType": "anything", "definition": "repeat(random(10..25 #5), 3)", "description": "

a

", "group": "Ungrouped variables", "name": "b"}, "m": {"templateType": "anything", "definition": "repeat(random(2..10),5)", "description": "", "group": "Ungrouped variables", "name": "m"}, "n": {"templateType": "anything", "definition": "repeat(random(3..9),7)", "description": "", "group": "Ungrouped variables", "name": "n"}, "ci": {"templateType": "anything", "definition": "repeat(random(6..20),10)", "description": "", "group": "Ungrouped variables", "name": "ci"}, "person": {"templateType": "anything", "definition": "random_person()", "description": "

A random person

", "group": "A person", "name": "person"}, "c": {"templateType": "anything", "definition": "repeat(random(3..13 except[10]),8)", "description": "", "group": "Ungrouped variables", "name": "c"}, "first": {"templateType": "anything", "definition": "random(10..15 #5)", "description": "

first term in the sequence

", "group": "Ungrouped variables", "name": "first"}, "pronouns": {"templateType": "anything", "definition": "person['pronouns']", "description": "", "group": "A person", "name": "pronouns"}, "ni": {"templateType": "anything", "definition": "repeat(random(19..40),10)", "description": "", "group": "Ungrouped variables", "name": "ni"}}, "advice": "

We are told that {person['name']}'s parents deposit a uniformly increasing amount of money into a savings account for {person['name']} every year on {person['name']}'s birthday.

\n

We are also given the amount of money that {person['pronouns']['their']} parents deposit into the account on {person['pronouns']['their']} first $3$ birthdays:

\n\n

a)

\n

To calculate the amount of money {person['name']}'s parents would deposit into the savings account on {person['pronouns']['their']} 21st birthday, if {pronouns['their']} parents maintained this pattern, we use the equation

\n

\\[a_n=a_1+(n-1)d\\text{,}\\]

\n

where

\n\n

To identify the first term and common difference of the sequence we can use a table like the one below.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$n$$1$$2$$3$
$a_n$$\\mathbf{\\var{first}}$$\\var{b[1]+first}$$\\var{b[1]*2+first}$
First differences$\\mathbf{\\var{b[1]}}$$\\mathbf{\\var{b[1]}}$
\n

The first term and common difference have been highlighted in bold: $a_1 = \\var{first}$ and $d = \\var{b[1]}$.

\n

Now we can use these to calculate $a_{21}$, giving us

\n

\\begin{align}
a_{21}&=\\var{first}+\\var{b[1]} \\times (21-1) \\\\
&=\\var{first+b[1]*(20)}\\text{.} \\\\
\\end{align}

\n

So, assuming that {person['name']}'s parents do maintain this pattern, on {pronouns['their']} 21st birthday {pronouns['their']} parents will deposit $£\\var{first+b[1]*(20)}$ into the savings account.

\n

b)

\n

We are now asked to calculate the total amount of money that {person['name']}'s parents will have added to this savings account over 21 years, including the money that {pronouns['their']} parents will deposit into the account on {pronouns['their']} 21st birthday.

\n

This question involves calculating the sum using the equation

\n

\\[\\sum\\limits_{i=1}^n{a_i}=\\frac{n}{2}(a_1+a_n)\\text{.}\\]

\n

We know from part a) that

\n

\\begin{align}
a_1&=\\var{first},\\\\
n&=21,\\\\
a_{21}&= \\var{first+b[1]*(20)}.
\\end{align}

\n

Using our formula for the sum,

\n

\\begin{align}
\\sum\\limits_{i=1}^n{a_i}&=\\frac{n}{2}(a_1+a_n)\\\\
&=\\frac{\\var{21}}{2}(\\var{first}+\\var{first+b[1]*(21-1)})\\\\
&=\\var{21*(first+first+b[1]*(20))/2}\\text{.}
\\end{align}

\n

Therefore, over 21 years {person['name']}'s parents will have added a total of $£\\var{21*(first+first+b[1]*(20))/2}$ to this savings account!

", "name": "Partial sum of an arithmetic sequence - birthday money", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hannah Aldous", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1594/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hannah Aldous", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1594/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}