// Numbas version: finer_feedback_settings {"name": "Arithmetic sequences in an ice cream shop", "extensions": ["random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "
Given the common difference and first term of an arithmetic sequence, work out the index of the nth term of the sequence.
\nFramed as a word problem with ticket numbers in an ice cream shop.
", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "type": "question", "ungrouped_variables": ["index", "d", "person"], "extensions": ["random_person"], "advice": "We know that every $\\var{d}^{\\text{th}}$ ticket after the first receives strawberry ice cream. So, the sequence of ticket numbers which get strawberry ice cream starts like this:
\n\\[ 1, \\var{d+1}, \\var{2d+1}, \\var{3d+1}, \\ldots \\]
\nThe numbers on the tickets for strawberry ice cream form an arithmetic sequence: the first term is $1$ and the common difference is $\\var{d}$.
\nWe can write down a formula for the $n^{\\text{th}}$ term in this sequence and rearrange it to find how many customers received strawberry ice cream before {person['name']}.
\nThe general formula for an arithmetic sequence is
\n\\[a_n = a_1 + (n-1)d \\]
\nwhere
\nWe know that $a_n = \\var{1+d*index}$, $a_1 = 1$, and $d = \\var{d}$, and we want to find $n$.
\nSubstituting these values from the formula gives
\n\\begin{align}
a_n &= a_1 + (n-1)d \\\\
\\var{1+d*index} &= 1 + (n -1)\\var{d}\\,.
\\end{align}
Now we rearrange this to find $n$:
\n\\begin{align}
\\var{1+d*index-1} &= \\var{d}n - \\var{d} \\\\
\\var{d*index +d} &= \\var{d}n \\\\
n &= \\var{(d*index + d)/d}.
\\end{align}
This is the number of people who received strawberry ice cream up to and including {person['name']}. Removing {person['name']} leaves $\\var{index}$ customers who received strawberry ice cream before {person['name']} did.
", "variable_groups": [], "statement": "When customers enter an ice cream shop they receive a numbered ticket for a free sample.
\nThere are $\\var{d}$ flavours of ice cream that the shop alternates through sequentially.
\nThe first ticket was number $1$ and the person with this ticket received strawberry ice cream.
\n{person['name']} was given ticket number $\\var{1+d*(index)}$ and also received strawberry ice cream.
", "name": "Arithmetic sequences in an ice cream shop", "parts": [{"correctAnswerFraction": false, "stepsPenalty": 0, "mustBeReducedPC": 0, "prompt": "How many customers before {person['name']} have tried the strawberry ice-cream?
", "showFeedbackIcon": true, "allowFractions": false, "minValue": "index", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "index", "mustBeReduced": false, "steps": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "information", "showCorrectAnswer": true, "prompt": "Use the arithmetic formula,
\n\\[a_n = a_1 + (n-1)d \\]
\nwhere
$a_n$ - The n$^{th}$ term in an arithmetic sequence
$a_1$ - The $1^{st}$ term in an arithmetic sequence
$n$ - Term number
$d$ - The common difference.
For this arithmetic sequence, what is $a_1$?
", "showFeedbackIcon": true, "allowFractions": false, "minValue": "1", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "1", "mustBeReduced": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain"}, {"correctAnswerFraction": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "prompt": "What is $d$?
", "showFeedbackIcon": true, "allowFractions": false, "minValue": "{d}", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "{d}", "mustBeReduced": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain"}], "marks": "3", "variableReplacements": [], "correctAnswerStyle": "plain", "showCorrectAnswer": true}], "tags": ["arithmetic sequence", "calculate the term number", "common difference", "nth term", "sequences", "taxonomy"], "preamble": {"css": "", "js": ""}, "functions": {}, "variables": {"person": {"description": "", "group": "Ungrouped variables", "definition": "random_person()", "name": "person", "templateType": "anything"}, "index": {"description": "", "group": "Ungrouped variables", "definition": "random(14..34 except [20, 21, 22, 30, 31, 32, 40])", "name": "index", "templateType": "anything"}, "d": {"description": "", "group": "Ungrouped variables", "definition": "random(6..12 except 10)", "name": "d", "templateType": "anything"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "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/"}]}]}], "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/"}]}