// Numbas version: exam_results_page_options {"name": "David's copy of Straight line equation application: measuring sunflower height", "extensions": ["jsxgraph", "random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"scripts": {}, "prompt": "

What is the gradient, $m$, of the straight line between the two points?

\n

$m =$ [[0]]

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

Use the gradient and the coordinates of the two points to find the height of the sunflower when {person['name']} received it.

\n

[[0]] cm.

", "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "c", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "c", "mustBeReduced": false, "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "allowFractions": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"scripts": {"mark": {"script": "console.log(this.question.lines.c)\nthis.question.lines.l.setAttribute({strokeColor: this.credit==1 ? 'green' : 'red'});\nthis.question.lines.c.setAttribute({visible: this.credit==1 ? false : true});\n", "order": "after"}}, "prompt": "

Let $y$ be the sunflower height and $x$ the time, in days, since {person['name']} received the sunflower. What is the equation of the straight line between the points?

\n

$y(x) =$ [[0]]

\n

", "showFeedbackIcon": true, "gaps": [{"checkingtype": "absdiff", "vsetrange": [0, 1], "answer": "{m}*x+{c}", "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 0.001, "scripts": {}, "expectedvariablenames": [], "checkvariablenames": false, "showpreview": true, "showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 1, "variableReplacements": [], "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"maxMarks": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "distractors": ["", "", "", ""], "displayColumns": "1", "scripts": {}, "prompt": "

", "displayType": "radiogroup", "shuffleChoices": false, "minMarks": 0, "choices": ["

The length of time taken in days for the sunflower to grow $1$ cm

", "

The change in height (in cm) of the sunflower over $1$ day

", "

The width of the ruler used to measure the sunflower

", "

All of the above

"], "showCorrectAnswer": true, "marks": 0, "variableReplacements": [], "matrix": [0, "1", 0, 0]}, {"scripts": {}, "prompt": "

{person['name']} uses the straight line equation to predict the future height of the sunflower. What will the height be on day $\\var{d}$?

\n

[[0]] cm

", "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "d*m+c", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "d*m+c", "mustBeReduced": false, "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "allowFractions": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"scripts": {}, "prompt": "

{person['name']} wonders if {person['pronouns']['they']} can guess what the height of the sunflower will be on {person['pronouns']['their']} 35th birthday. {capitalise(person['pronouns']['they'])} work{s} out that this is day 1826. Using the straight line equation, what would the height be on day 1826?

\n

[[0]] cm

", "showFeedbackIcon": true, "gaps": [{"mustBeReducedPC": 0, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "minValue": "1826*m+c", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "1826*m+c", "mustBeReduced": false, "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "allowFractions": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"showCorrectAnswer": true, "maxMarks": "1", "maxAnswers": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "m_n_2", "distractors": ["", "", "", ""], "scripts": {}, "marks": 0, "prompt": "

{person['name']} doubts {person['pronouns']['their']} result. Which of the following reason(s) may mean that the height on {person['pronouns']['their']} 35th birthday is not accurate?

", "minAnswers": 0, "shuffleChoices": false, "minMarks": 0, "choices": ["

Sunflower height as a function of time may not have a straight linear relationship.

", "

The observations only span a very limited time range.

", "

There are multiple straight linear relationships that could be obtained using the same $2$ data points.

", "

Sunflower height never actually increases over time.

"], "displayType": "checkbox", "warningType": "none", "displayColumns": "1", "variableReplacements": [], "matrix": ["0.5", "0.5", "-0.5", "-0.5"]}], "tags": ["assessing the accuracy of a graph", "estimations", "gradient", "interpreting graphs", "interpreting the gradient", "limitations of a line equation based on data used to create the equation", "line equation", "Straight Line", "straight line", "taxonomy", "using graphs to estimate a y value", "y-intercept"], "advice": "

#### a)

\n

The gradient is the ratio of vertical change ($y_2-y_1$) to horizontal change ($x_2-x_1$).

\n

\$m = \\frac{y_2-y_1}{x_2-x_1}=\\frac{\\simplify[!collectNumbers]{{yb}-{ya}}}{\\simplify[!collectNumbers]{{xb}-{xa}}}=\\frac{\\simplify{{yb}-{ya}}}{\\simplify{{xb}-{xa}}}=\\simplify[simplifyFractions,unitDenominator]{({yb-ya})/({xb-xa})}\\text{.}\$

\n

#### b)

\n

Rearranging the equation $y=mx+c$ for $c$ and using point A:

\n

\$c = y_1-mx_1 = \\var{ya}-\\var{m}\\times\\var{xa}=\\simplify{{ya-m*xa}}\\text{.}\$

\n

We then check this against point $B$:

\n

\$y_2 = mx_2 + c = \\simplify[fractionNumbers]{{m}{xb}+{c}}=\\simplify{{m}*{xb}+{c}}\\text{.}\$

\n

#### b)

\n

We now substitute the values for $m$ and $c$ into the equation of a straight line, $y=mx+c$,

\n

\$y=\\simplify[!noLeadingMinus,unitFactor]{{m} x+ {c}}\\text{.}\$

\n

\n

#### c)

\n

The gradient represents the vertical change (height in cm) per unit of the horizontal axis (days): the change in height of the sunflower per day.

\n

#### d)

\n

Substituting $x=\\var{d}$ into the straight line equation, the height $y$ after $\\var{d}$ days is

\n

\\begin{align}
y&=\\simplify{{m}}x+\\var{c}\\\\
&=\\simplify[]{{m}{d}}+\\var{c}\\\\
&=\\var{m*d+c}\\text{cm.}
\\end{align}

\n

#### e)

\n

Substituting $x=\\var{1826}$ into the straight line equation, the height $y$ after $1826$ days is

\n

\\begin{align}
y&=\\simplify{{m}}x+\\var{c}\\\\
&=\\simplify[]{{m}1826} + \\var{c}\\\\
&=\\var{m*1826+c}\\text{cm.}
\\end{align}

\n

Note that this is $\\var{(m*1826+c)/100}$ metres. In 2014, a sunflower of $9.17$ metres was entered into the Guinness World Records as tallest sunflower.

\n

#### f)

\n

Possible reasons that the prediction will not be accurate are:

\n
\n
• from everyday observations and basic biology that a sunflower cannot keep growing forever, but our straight line equation would predict otherwise.
• \n
• the set of observations are limited in their time frame. In particular another relationship could easily fit the 2 data points.
• \n
\n

Invalid reasons that the prediction will not be accurate are:

\n
\n
• There can only be one straight line between two points; only one equation describes this.
• \n
• Based on common sense, we know that sunflowers do grow over time.
• \n
", "statement": "

{person['name']} is given a sunflower seedling for {person['pronouns']['their']} 30th birthday (day $0$) and observes its height. {capitalise(person['pronouns']['they'])} make{s} the following observations later that week:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 Observation A B Day $\\var{xa}$ $\\var{xb}$ height (cm) $\\var{ya}$ $\\var{yb}$
\n

{person['name']} plots the 2 points:

\n

{plotPoints()}

", "variablesTest": {"condition": "\n", "maxRuns": 100}, "functions": {"advicePoints": {"type": "html", "parameters": [], "definition": "//point coordinate variables\nvar xa = Numbas.jme.unwrapValue(scope.variables.xa);\nvar xb = Numbas.jme.unwrapValue(scope.variables.xb);\nvar ya = Numbas.jme.unwrapValue(scope.variables.ya);\nvar yb = Numbas.jme.unwrapValue(scope.variables.yb);\nvar m = Numbas.jme.unwrapValue(scope.variables.m);\nvar c = Numbas.jme.unwrapValue(scope.variables.c);\n\n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-1,yb+5,xb+3,-2],grid: true});\nvar board = div.board;\nquestion.board = board;\n\n\n//points (with nice colors)\nvar a = board.create('point',[xa,ya],{name: 'A', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow', fixed: true, showInfobox: true});\nvar b = board.create('point',[xb,yb],{name: 'B', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',fixed: true, showInfobox: true});\n\n\n//ans(was tree) is defined at the end and nscope looks important\n//but they're both variables\n\nvar correct_line = board.create('functiongraph',[function(x){ return m*x+c},-2,22], {strokeColor:\"green\",setLabelText:'mx+c',visible: true, strokeWidth: 4, highlightStrokeColor: 'green'} )\n\n\n\nquestion.signals.on('HTMLAttached',function(e) {\nko.computed(function(){\nvar expr = question.parts[2].gaps[0].display.studentAnswer();\n//define ans as this \ncorrect_line.updateCurve();\nboard.update();\n});\n });\n\n\nreturn div;", "language": "javascript"}, "plotPoints": {"type": "html", "parameters": [], "definition": "//point coordinate variables\nvar xa = Numbas.jme.unwrapValue(scope.variables.xa);\nvar xb = Numbas.jme.unwrapValue(scope.variables.xb);\nvar ya = Numbas.jme.unwrapValue(scope.variables.ya);\nvar yb = Numbas.jme.unwrapValue(scope.variables.yb);\nvar m = Numbas.jme.unwrapValue(scope.variables.m);\nvar c = Numbas.jme.unwrapValue(scope.variables.c);\n\n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-1,yb+5,xb+3,-2],grid: true});\nvar board = div.board;\nquestion.board = board;\n\n\n//points (with nice colors)\nvar a = board.create('point',[xa,ya],{name: 'A', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow', fixed: true, showInfobox: true});\nvar b = board.create('point',[xb,yb],{name: 'B', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',fixed: true, showInfobox: true});\n\n\n//ans(was tree) is defined at the end and nscope looks important\n//but they're both variables\n var ans;\n var nscope = new Numbas.jme.Scope([scope,{variables:{x:new Numbas.jme.types.TNum(0)}}]);\n//this is the beating heart of whatever plots the function,\n//I've changed this from being curve to functiongraph\n var line = board.create('functiongraph',[function(x){\nif(ans) {\n try {\nnscope.variables.x.value = x;\n var val = Numbas.jme.evaluate(ans,nscope).value;\n return val;\n }\n catch(e) {\nreturn 163;\n }\n}\nelse\n return 163;\n },-2,22]\n , {strokeColor:\"blue\",strokeWidth: 4} );\n \nvar correct_line = board.create('functiongraph',[function(x){ return m*x+c},-2,22], {strokeColor:\"green\",setLabelText:'mx+c',visible: false, strokeWidth: 4, highlightStrokeColor: 'green'} )\n\nquestion.lines = {\n l:line, c:correct_line\n}\n\n question.signals.on('HTMLAttached',function(e) {\nko.computed(function(){\nvar expr = question.parts[2].gaps[0].display.studentAnswer();\n\n//define ans as this \ntry {\n ans = Numbas.jme.compile(expr,scope);\n}\ncatch(e) {\n ans = null;\n}\nline.updateCurve();\ncorrect_line.updateCurve();\nboard.update();\n});\n });\n\n\nreturn div;", "language": "javascript"}}, "variables": {"m": {"templateType": "anything", "name": "m", "definition": "random(2..3)", "description": "

", "group": "Ungrouped variables"}, "xb": {"templateType": "anything", "name": "xb", "definition": "xa+1", "description": "

x coordinate of point B

", "group": "point coordinates"}, "yb": {"templateType": "anything", "name": "yb", "definition": "m*xb+c", "description": "

y coordinate of point B

", "group": "point coordinates"}, "person": {"templateType": "anything", "name": "person", "definition": "random_person()", "description": "

A random person

", "group": "Random person"}, "s": {"templateType": "anything", "name": "s", "definition": "if(person['gender']='neutral','','s')", "description": "

He makes, they make.

", "group": "Random person"}, "c": {"templateType": "anything", "name": "c", "definition": "random(2..4)", "description": "

The intercept

", "group": "Ungrouped variables"}, "d": {"templateType": "anything", "name": "d", "definition": "random([10,14,20])", "description": "

A number of days after receiving the seedling, on which the height is estimated

", "group": "Ungrouped variables"}, "xa": {"templateType": "anything", "name": "xa", "definition": "random(3..5)", "description": "

x coordinate of point a

", "group": "point coordinates"}, "ya": {"templateType": "anything", "name": "ya", "definition": "m*xa+c", "description": "

y coordinate of point A

", "group": "point coordinates"}}, "ungrouped_variables": ["m", "c", "d"], "extensions": ["jsxgraph", "random_person"], "variable_groups": [{"name": "point coordinates", "variables": ["xa", "xb", "ya", "yb"]}, {"name": "Random person", "variables": ["person", "s"]}], "rulesets": {}, "name": "David's copy of Straight line equation application: measuring sunflower height", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

An applied example of the use of two points on a graph to develop a straight line function, then use the t estimate and predict. MCQ's are also used to develop student understanding of the uses of gradient and intercepts as well as the limitations of prediction.

"}, "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}]}