// Numbas version: exam_results_page_options {"name": "Luis's copy of 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": [{"advice": "", "preamble": {"css": "", "js": ""}, "question_groups": [{"questions": [], "pickingStrategy": "all-ordered", "pickQuestions": 0, "name": ""}], "name": "Luis's copy of Calculate Riemann sums of a quadratic", "variable_groups": [], "type": "question", "functions": {"riemann": {"language": "javascript", "type": "html", "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"]]}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "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", "parts": [{"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", "scripts": {}, "type": "gapfill", "gaps": [{"allowFractions": false, "correctAnswerFraction": false, "minValue": "-a", "maxValue": "-a", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showPrecisionHint": false}, {"allowFractions": false, "correctAnswerFraction": false, "minValue": "b", "maxValue": "b", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showPrecisionHint": false}], "showCorrectAnswer": true, "marks": 0}, {"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", "scripts": {}, "type": "gapfill", "gaps": [{"allowFractions": false, "correctAnswerFraction": false, "minValue": "ans1-tol", "maxValue": "ans1+tol", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showPrecisionHint": false}, {"allowFractions": false, "correctAnswerFraction": false, "minValue": "(b-a)/2", "maxValue": "(b-a)/2", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showPrecisionHint": false}, {"allowFractions": false, "correctAnswerFraction": false, "minValue": "(a+b)^2/4", "maxValue": "(a+b)^2/4", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 1, "showPrecisionHint": false}], "showCorrectAnswer": true, "marks": 0}, {"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": [{"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}\\]

", "type": "information", "showCorrectAnswer": true, "marks": 0, "scripts": {}}], "scripts": {}, "gaps": [{"checkvariablenames": false, "answersimplification": "all", "scripts": {}, "checkingtype": "absdiff", "type": "jme", "expectedvariablenames": [], "marks": 2, "showCorrectAnswer": true, "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "answer": "({(c * (c + 2) * (2 * c - 1))} / 12)", "vsetrangepoints": 5}, {"checkvariablenames": false, "answersimplification": "all", "scripts": {}, "checkingtype": "absdiff", "type": "jme", "expectedvariablenames": [], "marks": 2, "showCorrectAnswer": true, "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "answer": "({(c * (c - 2) * (2 * c + 1))} / 12)", "vsetrangepoints": 5}], "stepsPenalty": 0, "type": "gapfill", "showCorrectAnswer": true, "marks": 0}, {"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", "scripts": {}, "type": "gapfill", "gaps": [{"allowFractions": false, "correctAnswerFraction": false, "minValue": "ans2-tol", "maxValue": "ans2+tol", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 2, "showPrecisionHint": false}, {"allowFractions": false, "correctAnswerFraction": false, "minValue": "ans3-tol", "maxValue": "ans3+tol", "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "marks": 2, "showPrecisionHint": false}], "showCorrectAnswer": true, "marks": 0}], "ungrouped_variables": ["a", "c", "b", "ans1", "ans2", "ans3", "n", "tol", "tans1", "tans3", "tans2"], "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "tags": ["checked2015", "MAS2224"], "showQuestionGroupNames": false, "rulesets": {}, "variables": {"c": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "c", "definition": "a+b"}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "ans1", "definition": "precround(tans1,3)"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "b", "definition": "-a+random(4..8#2 except a)"}, "tans2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "tans2", "definition": "(a+b)^3*(n+1)(4n-1)/(48*n^2)"}, "tans1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "tans1", "definition": "(a+b)^3/6"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "ans2", "definition": "precround(tans2,3)"}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "ans3", "definition": "precround(tans3,3)"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "n", "definition": "random(10..100#2)"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "a", "definition": "random(-10..10 except 0)"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "tol", "definition": "0.001"}, "tans3": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "tans3", "definition": "(a+b)^3*(4*n+1)(n-1)/(48*n^2)"}}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}