// Numbas version: exam_results_page_options {"name": "Calculate Riemann sums of a quadratic", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans2,3)", "description": "", "name": "ans2"}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans3,3)", "description": "", "name": "ans3"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "-a+random(4..8#2 except a)", "description": "", "name": "b"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+b", "description": "", "name": "c"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..100#2)", "description": "", "name": "n"}, "tans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a+b)^3*(n+1)(4n-1)/(48*n^2)", "description": "", "name": "tans2"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "name": "a"}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans1,3)", "description": "", "name": "ans1"}, "tans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a+b)^3/6", "description": "", "name": "tans1"}, "tans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a+b)^3*(4*n+1)(n-1)/(48*n^2)", "description": "", "name": "tans3"}}, "ungrouped_variables": ["a", "c", "b", "ans1", "ans2", "ans3", "n", "tol", "tans1", "tans3", "tans2"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Calculate Riemann sums of a quadratic", "functions": {"riemann": {"type": "html", "language": "javascript", "definition": "\n\t\t\tvar f = function(x){ return a*b+(b-a)*x-x*x; };\n\t\t\tvar m = (a+b)*(a+b)/4\n\t\t\tvar div = Numbas.extensions.jsxgraph.makeBoard('200px','200px', {axis:false,ticks:false,showNavigation:false, boundingbox:[Math.min(-a-2,-2),m+2,Math.max(b+2,2),-2]});\n\t\t\t\n\t\t\tvar brd=div.board;\n\t\t\tvar xaxis=brd.create('line',[[0,0],[1,0]],{fixed:true,strokeColor:'black'});\n\t\t\tvar yaxis=brd.create('line',[[0,0],[0,1]],{fixed:true,strokeColor:'black'});\n\t\t\tvar plot=brd.create('functiongraph',[f,-a-2,b+2]);\n\t\t\tvar txt1=brd.create('text',[-a-0.5,-0.5,'p']);\n\t\t\tvar txt2=brd.create('text',[b+0.5,-0.5,'q']);\n\t\t\tvar txt3=brd.create('text',[(b-a)/2,-0.5,'c']);\n\t\t\treturn div;\n\t\t\t", "parameters": [["a", "number"], ["b", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "-a", "minValue": "-a", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "b", "minValue": "b", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n\t\t\t

Find the points $x=p,\\;x=q,\\;p \\leq q$ where the graph of $f$ cuts the $x$-axis.

\n\t\t\t

$p=\\;$[[0]]      $q=\\;$[[1]]

\n\t\t\t", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ans1+tol", "minValue": "ans1-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "(b-a)/2", "minValue": "(b-a)/2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "(a+b)^2/4", "minValue": "(a+b)^2/4", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n\t\t\t

Using elementary calculus find the area below the curve and above the interval $[p,q]$.

\n\t\t\t

Area= [[0]]  (enter to 3 decimal places).

\n\t\t\t

Also find the point $x=c$ at which the function attains its maximum value over the interval $[p,q]$.

\n\t\t\t

$c=\\;$[[1]]

\n\t\t\t

Maximum value $f(c)=\\;$[[2]]

\n\t\t\t", "showCorrectAnswer": true, "marks": 0}, {"stepsPenalty": 0, "scripts": {}, "gaps": [{"answer": "({(c * (c + 2) * (2 * c - 1))} / 12)", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 2, "vsetrangepoints": 5}, {"answer": "({(c * (c - 2) * (2 * c + 1))} / 12)", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 2, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "\n\t\t\t

Let $p$ and $q$ be as above.

\n\t\t\t

Compute the upper and lower sums for the function $f$ over the interval $[p,q]$  using the partition:

\n\t\t\t

\\[\\{p,\\;p+1,\\;\\ldots,\\;q\\}\\] with subintervals of length 1.

\n\t\t\t

Upper sum = [[0]]

\n\t\t\t

Lower sum = [[1]]

\n\t\t\t

\n\t\t\t

You will find useful formulae on clicking Show steps.

\n\t\t\t

\n\t\t\t", "steps": [{"type": "information", "prompt": "

\\[\\begin{eqnarray}
\\sum_{r=1}^n r&=&\\frac{n(n+1)}{2}\\\\
\\sum_{r=1}^n r^2&=&\\frac{n(n+1)(2n+1)}{6}
\\end{eqnarray}\\]

", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ans2+tol", "minValue": "ans2-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "ans3+tol", "minValue": "ans3-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n\t\t\t

Let $p$ and $c$ be as above.

\n\t\t\t

Consider the partition of the interval $[p,c]$ into $\\var{n}$ subintervals each of length  $\\displaystyle \\frac{c-p}{\\var{n}}$:

\n\t\t\t

\\[\\Delta=\\left\\{p,\\;p+\\frac{c-p}{\\var{n}},\\;p+\\frac{2(c-p)}{\\var{n}},\\;\\ldots,c\\right\\}\\]

\n\t\t\t

Find the upper sum and lower sums for $f$  corresponding to this partition.

\n\t\t\t

Upper sum = [[0]] (enter to 3 decimal places)

\n\t\t\t

Lower sum = [[1]] (enter to 3 decimal places)

\n\t\t\t", "showCorrectAnswer": true, "marks": 0}], "statement": "\n\t

Let $f:\\mathbb{R}\\rightarrow \\mathbb{R}$ be defined by $f(x)=\\simplify{{a*b}+{b-a}*x-x^2}$.

\n\t

{Riemann(a,b)}

\n\t", "tags": ["checked2015", "MAS2224"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}