// Numbas version: finer_feedback_settings {"metadata": {"licence": "None specified", "description": ""}, "timing": {"timedwarning": {"action": "none", "message": ""}, "allowPause": true, "timeout": {"action": "none", "message": ""}}, "showstudentname": true, "name": "Demo", "showQuestionGroupNames": false, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 1, "name": "Group", "questions": [{"name": "Algebra: Parsing algebraic expressions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}], "statement": "

This is a non-calculator question

", "functions": {}, "ungrouped_variables": [], "metadata": {"description": "

Several questions about converting between algebra and worded descriptions is asked

", "licence": "None specified"}, "preamble": {"js": "", "css": ""}, "parts": [{"maxAnswers": 0, "showFeedbackIcon": true, "prompt": "

Match the worded descriptions with their algebraic expressions.

", "warningType": "none", "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "shuffleAnswers": true, "choices": ["

{proca1}

", "

{proca2}

", "

{proca3}

", "

{proca4}

"], "layout": {"expression": "", "type": "all"}, "marks": 0, "matrix": [["0.5", "-2", "-2", "-2"], ["-2", "0.5", "-2", "-2"], ["-2", "-2", "0.5", "-2"], ["-2", "-2", "-2", "0.5"]], "type": "m_n_x", "variableReplacements": [], "unitTests": [], "minAnswers": "4", "minMarks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "answers": ["

$ \\frac{\\var{a[0]}a-\\var{a[1]}}{\\var{a[2]}} $

", "

$  \\frac{\\var{a[0]}(a - \\var{a[1]})}{\\var{a[2]}}$

", "

$  \\var{a[0]}(\\frac{a}{\\var{a[2]}} - \\var{a[1]}) $

", "

$ \\frac{\\var{a[0]}a}{\\var{a[2]}} -\\var{a[1]}$

"], "scripts": {}, "shuffleChoices": true, "customMarkingAlgorithm": "", "maxMarks": "2"}, {"maxAnswers": 0, "showFeedbackIcon": true, "prompt": "

Write the following algebraic expression as a procedure: $\\simplify[basic]{{alg[rand[0]]}}$

", "warningType": "none", "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "shuffleAnswers": true, "choices": ["

Step 1

", "

Step 2

", "

Step 3

", "

Step 4

", "

Step 5

"], "layout": {"expression": "", "type": "all"}, "marks": 0, "matrix": [["0.2", "-1", "-1", "-1", "-1"], ["-1", "0.2", "-1", "-1", "-1"], ["-1", "-1", "0.2", "-1", "-1"], ["-1", "-1", "-1", "0.2", "-1"], ["-1", "-1", "-1", "-1", "0.2"]], "type": "m_n_x", "variableReplacements": [], "unitTests": [], "minAnswers": "5", "minMarks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "answers": ["

Pick a number

", "

{stepsb[0]}

", "

{stepsb[1]}

", "

{stepsb[2]}

", "

{stepsb[3]}

"], "scripts": {}, "shuffleChoices": false, "customMarkingAlgorithm": "", "maxMarks": 0}, {"maxAnswers": 0, "showFeedbackIcon": true, "prompt": "

Write the following algebraic expression as a procedure: $\\simplify[basic]{{alg[rand[1]]}}$

", "warningType": "none", "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "shuffleAnswers": true, "choices": ["

Step 1

", "

Step 2

", "

Step 3

", "

Step 4

", "

Step 5

"], "layout": {"expression": "", "type": "all"}, "marks": 0, "matrix": [["0.2", "-1", "-1", "-1", "-1"], ["-1", "0.2", "-1", "-1", "-1"], ["-1", "-1", "0.2", "-1", "-1"], ["-1", "-1", "-1", "0.2", "-1"], ["-1", "-1", "-1", "-1", "0.2"]], "type": "m_n_x", "variableReplacements": [], "unitTests": [], "minAnswers": "5", "minMarks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "answers": ["

Pick a number

", "

{stepsc[0]}

", "

{stepsc[1]}

", "

{stepsc[2]}

", "

{stepsc[3]}

"], "scripts": {}, "shuffleChoices": false, "customMarkingAlgorithm": "", "maxMarks": 0}, {"unitTests": [], "vsetRange": [0, 1], "showPreview": true, "showFeedbackIcon": true, "vsetRangePoints": 5, "prompt": "

Re-write the following procedure as an algebraic expression.  Use the letter $b$ for the letter picked at the start.

\n

Pick a number. {stepsd[0]}. {stepsd[1]}. {stepsd[2]}. {stepsd[3]}.

", "extendBaseMarkingAlgorithm": true, "answerSimplification": "basic", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "scripts": {}, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "checkVariableNames": false, "failureRate": 1, "marks": 1, "showCorrectAnswer": true, "answer": "{alg[rand[2]]}", "type": "jme", "expectedVariableNames": [], "variableReplacements": []}, {"unitTests": [], "vsetRange": [0, 1], "showPreview": true, "showFeedbackIcon": true, "vsetRangePoints": 5, "prompt": "

Re-write the following procedure as an algebraic expression.  Use the letter $b$ for the letter picked at the start.

\n

Pick a number. {stepse[0]}. {stepse[1]}. {stepse[2]}. {stepse[3]}.

", "extendBaseMarkingAlgorithm": true, "answerSimplification": "basic", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "scripts": {}, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "checkVariableNames": false, "failureRate": 1, "marks": 1, "showCorrectAnswer": true, "answer": "{alg[rand[3]]}", "type": "jme", "expectedVariableNames": [], "variableReplacements": []}, {"unitTests": [], "vsetRange": [0, 1], "showPreview": true, "showFeedbackIcon": true, "vsetRangePoints": 5, "prompt": "

Re-write the following procedure as an algebraic expression.  Use the letter $b$ for the letter picked at the start.

\n

Pick a number. {stepsf[0]}. {stepsf[1]}. {stepsf[2]}. {stepsf[3]}.

", "extendBaseMarkingAlgorithm": true, "answerSimplification": "basic", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "scripts": {}, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "checkVariableNames": false, "failureRate": 1, "marks": 1, "showCorrectAnswer": true, "answer": "{alg[rand[4]]}", "type": "jme", "expectedVariableNames": [], "variableReplacements": []}], "variables": {"proca3": {"templateType": "anything", "name": "proca3", "definition": "\"Pick number, \"+proca[2]+\", \"+proca[1]+\", \"+proca[0]", "description": "", "group": "part a"}, "b": {"templateType": "anything", "name": "b", "definition": "vector(shuffle([random(2,4,8),random(3,9),5,7,11,13]))", "description": "", "group": "part b to f"}, "stepsf": {"templateType": "anything", "name": "stepsf", "definition": "[procbd[seq[rand[4]][0]], procbd[seq[rand[4]][1]],procbd[seq[rand[4]][2]],procbd[seq[rand[4]][3]]]", "description": "", "group": "part b to f"}, "rand": {"templateType": "anything", "name": "rand", "definition": "shuffle([0,1,2,3,4])", "description": "", "group": "part b to f"}, "stepse": {"templateType": "anything", "name": "stepse", "definition": "[procbd[seq[rand[3]][0]], procbd[seq[rand[3]][1]],procbd[seq[rand[3]][2]],procbd[seq[rand[3]][3]]]", "description": "", "group": "part b to f"}, "proca4": {"templateType": "anything", "name": "proca4", "definition": "\"Pick number, \"+proca[0]+\", \"+proca[2]+\", \"+proca[1]", "description": "", "group": "part a"}, "stepsc": {"templateType": "anything", "name": "stepsc", "definition": "[procbd[seq[rand[1]][0]], procbd[seq[rand[1]][1]],procbd[seq[rand[1]][2]],procbd[seq[rand[1]][3]]]", "description": "", "group": "part b to f"}, "proca": {"templateType": "anything", "name": "proca", "definition": "[\"multiply by \"+a[0], \"subtract \"+a[1], \"divide by \"+a[2]]", "description": "

proc

", "group": "part a"}, "proca2": {"templateType": "anything", "name": "proca2", "definition": "\"Pick number, \"+proca[1]+\", \"+proca[0]+\", \"+proca[2]", "description": "", "group": "part a"}, "alg": {"templateType": "anything", "name": "alg", "definition": "[expression(\"(\"+b[0]+\"b - \"+b[1]+\")^2 + \"+b[2]), expression(\"(\"+b[0]+\"b)^2 - \"+b[1]+\"+\"+b[2]), expression(b[0]+\"b^2 - \"+b[1]+\"+\"+b[2]), expression(\"(\"+b[0]+\"(b+\"+b[2]+\"))^2-\"+b[1]), expression(b[0]+\"(b^2 - \"+b[1]+\") +\"+b[2])]", "description": "", "group": "part b to f"}, "stepsb": {"templateType": "anything", "name": "stepsb", "definition": "[procbd[seq[rand[0]][0]], procbd[seq[rand[0]][1]],procbd[seq[rand[0]][2]],procbd[seq[rand[0]][3]]]", "description": "", "group": "part b to f"}, "procbd": {"templateType": "anything", "name": "procbd", "definition": "[\"Multiply by \"+b[0], \"Subtract \"+b[1], \"Add \"+b[2], \"Square\"]", "description": "", "group": "part b to f"}, "proca1": {"templateType": "anything", "name": "proca1", "definition": "\"Pick number, \"+proca[0]+\", \"+proca[1]+\", \"+proca[2]", "description": "", "group": "part a"}, "seq": {"templateType": "anything", "name": "seq", "definition": "[[0,1,3,2],[0,3,1,2],[3,0,1,2],[2,0,3,1],[3,1,0,2]]", "description": "

Sequence of steps

", "group": "part b to f"}, "a": {"templateType": "anything", "name": "a", "definition": "vector(shuffle([random(2,4,8),random(3,9),5,7,11]))", "description": "", "group": "part a"}, "stepsd": {"templateType": "anything", "name": "stepsd", "definition": "[procbd[seq[rand[2]][0]], procbd[seq[rand[2]][1]],procbd[seq[rand[2]][2]],procbd[seq[rand[2]][3]]]", "description": "", "group": "part b to f"}}, "rulesets": {}, "tags": [], "advice": "", "variable_groups": [{"variables": ["a", "proca", "proca1", "proca2", "proca3", "proca4"], "name": "part a"}, {"variables": ["rand", "b", "procbd", "seq", "alg", "stepsc", "stepsb", "stepsd", "stepse", "stepsf"], "name": "part b to f"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question"}, {"name": "Differentiation: product or chain", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}], "tags": [], "metadata": {"description": "

8 questions. Each one requires product rule or the chain rule. Functions randomised.

", "licence": "None specified"}, "statement": "", "advice": "

See 11.3, 11.4 and 11.5.

", "rulesets": {}, "variables": {"a": {"name": "a", "group": "coefficients etc", "definition": "map(random(2..7),j,0..7\n)", "description": "

a*f0(f1(x)+d)

\n

a*f0(b0x + d0) * f1(b1x + d1)

", "templateType": "anything"}, "prod": {"name": "prod", "group": "functions", "definition": "map(expression(a[j]+\"*\"+f[rand[j][0]][0]+b0[j]+\"*\"+var+\"+\"+d0[j]+f[rand[j][0]][1]+\"*\"+f[rand[j][1]][0]+b1[j]+\"*\"+var+\"+\"+d1[j]+f[rand[j][1]][1]),j,0..7\n)", "description": "", "templateType": "anything"}, "d0": {"name": "d0", "group": "coefficients etc", "definition": "map(0,j,0..7)", "description": "

a*f0(b0x + d0) * f1(b1x + d1)

", "templateType": "anything"}, "rand2": {"name": "rand2", "group": "Ungrouped variables", "definition": "repeat(if(random(-2..2)>0,1,0),8)", "description": "

40% odds of getting product rule, 60% odds of chain rule

", "templateType": "anything"}, "rand": {"name": "rand", "group": "Ungrouped variables", "definition": "shuffle([\n [6,2],\n [7,1],\n [8,1],\n [9,2],\n [6,random(8,9)],\n [7,random(8,9)],\n [9,random(6,7)],\n [8,random(6,7)]\n ])", "description": "

[
0[\"(\"+b0[0]+\"*\",\")\"],
1[\"(\",\")^\"+n1],
2[\"(\",\")^\"+n2],
3[\"1/(\",\")\"],
4[\"1/((\",\")^\"+n3+\")\"],
5[\"sqrt(\",\")\"],
6[\"sin(\",\")\"],
7[\"cos(\",\")\"],
8[\"e^(\",\")\"],
9[\"ln(\",\")\"]
]

\n

\n

don't use 0 for product rule

", "templateType": "anything"}, "f": {"name": "f", "group": "functions", "definition": "[\n [\"(\"+b0[0]+\"*\",\")\"],\n [\"(\",\")^\"+n1],\n [\"(\",\")^\"+n2],\n [\"1/(\",\")\"],\n [\"1/((\",\")^\"+n3+\")\"],\n [\"sqrt(\",\")\"],\n [\"sin(\",\")\"],\n [\"cos(\",\")\"],\n [\"e^(\",\")\"],\n [\"ln(\",\")\"]\n ]", "description": "", "templateType": "anything"}, "prod'": {"name": "prod'", "group": "functions", "definition": "map(expression(a[j]+\"*\"+b0[j]+\"*\"+f'[rand[j][0]][0]+b0[j]+\"*\"+var+\"+\"+d0[j]+f'[rand[j][0]][1]+\"*\"+f[rand[j][1]][0]+b1[j]+\"*\"+var+\"+\"+d1[j]+f[rand[j][1]][1]+\"+\"+a[j]+\"*\"+f[rand[j][0]][0]+b0[j]+\"*\"+var+\"+\"+d0[j]+f[rand[j][0]][1]+\"*\"+b1[j]+\"*\"+f'[rand[j][1]][0]+b1[j]+\"*\"+var+\"+\"+d1[j]+f'[rand[j][1]][1]),j,0..7\n)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "coefficients etc", "definition": "map(random(-3..3 except([0,1])),j,0..7)", "description": "", "templateType": "anything"}, "comp": {"name": "comp", "group": "functions", "definition": "map(expression(a[j]+\"*\"+f[rand[j][0]][0]+b[j]+\"*\"+f[rand[j][1]][0]+var+f[rand[j][1]][1]+\"+\"+d[j]+f[rand[j][0]][1]),j,0..7)", "description": "", "templateType": "anything"}, "d1": {"name": "d1", "group": "coefficients etc", "definition": "map(0,j,0..7)", "description": "

a*f0(b0x + d0) * f1(b1x + d1)

", "templateType": "anything"}, "b1": {"name": "b1", "group": "coefficients etc", "definition": "map(1,j,0..7)", "description": "

a*f0(b0x + d0) * f1(b1x + d1)

", "templateType": "anything"}, "n2": {"name": "n2", "group": "coefficients etc", "definition": "random(4..6)", "description": "", "templateType": "anything"}, "q": {"name": "q", "group": "functions", "definition": "map(if(rand2[j]=0,comp[j],prod[j]),j,0..7)", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "coefficients etc", "definition": "map(random(6..9),j,0..7)", "description": "

a*f0(f1(x)+d)

", "templateType": "anything"}, "var": {"name": "var", "group": "coefficients etc", "definition": "random(['x','z','t','p','s','r','w'])", "description": "", "templateType": "anything"}, "n3": {"name": "n3", "group": "coefficients etc", "definition": "random(2..5)", "description": "", "templateType": "anything"}, "f'": {"name": "f'", "group": "functions", "definition": "[\n [\"(\"+b0[0]+\"*(\",\"^0))\"],\n [n1+\"*(\",\")^\"+(n1-1)],\n [n2+\"*(\",\")^\"+(n2-1)],\n [\"-1/((\",\")^2)\"],\n [\"-\"+n3+\"/((\",\")^\"+(n3+1)+\")\"],\n [\"0.5/(sqrt(\",\"))\"],\n [\"cos(\",\")\"],\n [\"-sin(\",\")\"],\n [\"e^(\",\")\"],\n [\"1/(\",\")\"]\n ]", "description": "", "templateType": "anything"}, "n1": {"name": "n1", "group": "coefficients etc", "definition": "random(2..3)", "description": "", "templateType": "anything"}, "q'": {"name": "q'", "group": "functions", "definition": "map(if(rand2[j]=0,comp'[j],prod'[j]),j,0..7)", "description": "", "templateType": "anything"}, "comp'": {"name": "comp'", "group": "functions", "definition": "map(expression(a[j]+\"*\"+b[j]+\"*\"+f'[rand[j][1]][0]+var+f'[rand[j][1]][1]+\"*\"+f'[rand[j][0]][0]+b[j]+\"*\"+f[rand[j][1]][0]+var+f[rand[j][1]][1]+\"+\"+d[j]+f'[rand[j][0]][1]),j,0..7)", "description": "", "templateType": "anything"}, "b0": {"name": "b0", "group": "coefficients etc", "definition": "map(1,j,0..7)", "description": "

a*f0(b0x + d0) * f1(b1x + d1)

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["rand", "rand2"], "variable_groups": [{"name": "coefficients etc", "variables": ["var", "n1", "n2", "n3", "a", "b", "b0", "b1", "d", "d0", "d1"]}, {"name": "functions", "variables": ["f", "f'", "comp", "comp'", "prod", "prod'", "q", "q'"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Differentiate the following. You will need the Chain Rule or the Product Rule.

\n

\n

$\\simplify{{q[0]}}$. 

\n

[[0]]

\n

\n

\n

\n

\n

$\\simplify{{q[1]}}$. 

\n

[[1]]

\n

\n

\n

\n

\n

$\\simplify{{q[2]}}$.

\n

[[2]]

\n

\n

\n

\n

\n

$\\simplify{{q[3]}}$. 

\n

[[3]]

\n

\n

\n

\n

\n

$\\simplify{{q[4]}}$. 

\n

[[4]]

\n

\n

\n

\n

\n

$\\simplify{{q[5]}}$.

\n

[[5]]

\n

\n

\n

\n

\n

$\\simplify{{q[6]}}$.

\n

[[6]]

\n

\n

\n

\n

\n

$\\simplify{{q[7]}}$. 

\n

[[7]]

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[0]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[1]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[2]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[3]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[4]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[5]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[6]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{q'[7]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "type": "question"}, {"name": "Algebra: functions, approximate area under graph", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}], "variable_groups": [], "ungrouped_variables": ["a", "b", "c", "x0", "x", "fx", "total"], "metadata": {"description": "

Graphs are given with areas underneath them shaded. The area of the shaded regions are given and from this the value of various integrals are to be deduced.

", "licence": "Creative Commons Attribution 4.0 International"}, "preamble": {"css": "", "js": ""}, "functions": {"plotgraph": {"definition": "// Shading under a graph! This functions plots a graph of y = a(x-r1)(x-r2)\n// It creates the board, sets it up, then returns an\n// HTML div tag containing the board.\n\n\n// Max and min x and y values for the axis.\nvar xmin = -2;\nvar xmax = 8;\nvar ymin = -60;\nvar ymax = 60;\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '500px',\n {\n boundingBox: [xmin,ymax,xmax,ymin],\n axis: false,\n showNavigation: false,\n grid: false\n }\n);\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,1],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 1\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,10],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\n\n// This function shades in the area below the graph of f\n// between the x values x1 and x2\n\nvar shade = function(f,x1,x2,colour,opacity) {\n var dataX1 = [x1,x1];\n var dataY1 = [0,f(x1)];\n\n var dataX2 = [];\n var dataY2 = [];\n for (var i = x1; i <= x2; i = i+0.1) {\n dataX2.push(i);\n dataY2.push(f(i));\n }\n\n var dataX3 = [x2,x2];\n var dataY3 = [f(x2),0];\n\n dataX = dataX1.concat(dataX2).concat(dataX3);\n dataY = dataY1.concat(dataY2).concat(dataY3);\n\nvar shading = board.create('curve', [dataX,dataY],{strokeWidth:0, fillColor:colour, fillOpacity:opacity});\n\nreturn shading;\n}\n\n\n//Define your functions\nvar f = function(x) {\n return a*(x-b)*(c-x);\n}\n\n\nvar f1 = function(x) {\n return a*(c-4-b)*(c-c+4);\n}\n\nvar f2 = function(x) {\n return a*(c-3-b)*(c-c+3);\n}\n\nvar f3 = function(x) {\n return a*(c-2-b)*(c-c+2);\n}\n\nvar f4 = function(x) {\n return a*(c-1-b)*(c-c+1);\n}\n\n\n\n//Plot the graph and do shading\nboard.create('functiongraph', [f]);\n\n\n\nswitch(num) {\n case 1:\n shade(f,c-2,c+2, 'red',0.2);\n break;\n case 2:\n for (i = 0; i < 8; i++) { \n var g = function(x) {\n return a*(c-(2-0.5*i)-b)*(c-(c-(2-0.5*i))); //defining horizontal function for ith column\n }\n if (i%2 == 0) { \n shade(g,c-(2-0.5*i),c-(2-0.5*(i+1)), 'blue',0.2); //shading ith column blue if i even\n } else {\n shade(g,c-(2-0.5*i),c-(2-0.5*(i+1)), 'green',0.6); // shading ith column green if i odd\n }\n } \n board.create('ellipse',[[c-2,f(c-2)+0.995],[c-2,f(c-2)-0.995],[c-2,f(c-2)+1]],{color:'black'});\n //brd.create('circle',[[c-4,f(c-4)],0.1],{color:'black'}); //adding a point\n board.create('text',[c-2,a*(c-2-b)*(c-c+2)+3,'A']);\n board.create('ellipse',[[c-1.5,f(c-1.5)+0.995],[c-1.5,f(c-1.5)-0.995],[c-1.5,f(c-1.5)+1]],{color:'black'});\n board.create('text',[c-1.5,a*(c-1.5-b)*(c-c+1.5)+3,'B']);\n break;\n}\n \n\n\nreturn div;", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["num", "number"]], "type": "html", "language": "javascript"}}, "variables": {"b": {"description": "", "name": "b", "templateType": "anything", "definition": "random(-5..-2)", "group": "Ungrouped variables"}, "c": {"description": "", "name": "c", "templateType": "anything", "definition": "x0+2", "group": "Ungrouped variables"}, "total": {"description": "", "name": "total", "templateType": "anything", "definition": "sum(fx)*0.5", "group": "Ungrouped variables"}, "x0": {"description": "", "name": "x0", "templateType": "anything", "definition": "random(1..2)", "group": "Ungrouped variables"}, "fx": {"description": "", "name": "fx", "templateType": "anything", "definition": "vector(map(abs(a*(x[j]-b)*(c-x[j])),j,0..7))\n\n ", "group": "Ungrouped variables"}, "a": {"description": "", "name": "a", "templateType": "anything", "definition": "random(3)", "group": "Ungrouped variables"}, "x": {"description": "", "name": "x", "templateType": "anything", "definition": "[x0,x0+0.5,x0+1,x0+1.5,x0+2,x0+2.5,x0+3,x0+3.5]", "group": "Ungrouped variables"}}, "parts": [{"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "gaps": [{"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "type": "matrix", "tolerance": 0, "markPerCell": false, "correctAnswer": "matrix([x[0],fx[0]])", "unitTests": [], "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "customName": "", "marks": 1, "correctAnswerFractions": false, "numRows": 1, "adaptiveMarkingPenalty": 0, "useCustomName": false, "allowResize": false, "allowFractions": true, "numColumns": "2", "customMarkingAlgorithm": ""}, {"variableReplacements": [], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "type": "matrix", "tolerance": 0, "markPerCell": false, "correctAnswer": "matrix([x[1],fx[1]])", "unitTests": [], "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "customName": "", "marks": 1, "correctAnswerFractions": false, "numRows": 1, "adaptiveMarkingPenalty": 0, "useCustomName": false, "allowResize": false, "allowFractions": true, "numColumns": "2", "customMarkingAlgorithm": ""}, {"customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "variableReplacements": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "adaptiveMarkingPenalty": 0, "useCustomName": false, "correctAnswerFraction": false, "allowFractions": true, "minValue": "{total}", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "unitTests": [], "mustBeReducedPC": 0, "customName": "", "correctAnswerStyle": "plain", "scripts": {}, "maxValue": "{total}", "marks": "5", "mustBeReduced": false}], "prompt": "

Below is the graph of the function $v(t) =\\simplify{{a}(t-{b})*({c}-t)}$.  We would like to calculate the area of the shaded region.

\n

{plotgraph(a,b,c,1)}

\n

\n

You will learn how to do this in Maths 2 (using so-called integration), but for now we will just estimate the area. We do this by calculating the area of the strips in the diagram below:

\n

{plotgraph(a,b,c,2)}

\n

\n

To save you scrolling, the function was $v(t) =\\simplify{{a}(t-{b})*({c}-t)}$.

\n

(i) What are the coordinates of the points A and B?

\n

A. [[0]]

\n

B. [[1]]

\n

\n

(ii) Determine the total area of the strips. Do this by determining the area of each strip and adding them together. Remember to do simple estimates to check for big errors.

\n

Total area of columns  = [[2]]

", "unitTests": [], "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "customName": "", "sortAnswers": false, "marks": 0, "adaptiveMarkingPenalty": 0, "useCustomName": false, "customMarkingAlgorithm": ""}], "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

See Lecture 6.3 and Workshop 6.5 for background. The workshop contains a question similar to this but the lectures do not.

\n

It is easy to make a little mistake, and a single mistake will result in an incorrect answer.  As much as possible, find ways to check for mistakes e.g. you can make rough estimates of the length of each strip from the graph.

\n

(If you have studied integration before and you want a challenge, calculate the exact area of the original shaded region and check it is similar with this estimated value.)

", "statement": "

This is a calculator question.

", "tags": [], "type": "question"}]}], "feedback": {"feedbackmessages": [], "allowrevealanswer": true, "showactualmark": false, "showtotalmark": true, "intro": "", "showanswerstate": false, "advicethreshold": 0, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "oncompletion", "showactualmarkwhen": "oncompletion", "showtotalmarkwhen": "always", "showanswerstatewhen": "oncompletion", "showadvicewhen": "never"}, "percentPass": 0, "duration": 0, "navigation": {"preventleave": true, "startpassword": "", "showfrontpage": false, "reverse": true, "onleave": {"action": "none", "message": ""}, "allowsteps": true, "showresultspage": "oncompletion", "browse": true, "allowregen": true}, "type": "exam", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": []}