// Numbas version: exam_results_page_options {"name": "Grainne's copy of Find the equation of a line with given gradient through a given point", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "s1", "b1"], "tags": [], "variable_groups": [], "metadata": {"description": "\n\t\t \t\t \t\t \t\t \t\t
Find the equation of a straight line which has a given slope or gradient $m$ and passes through the given point $(a,b)$.
\n\t\t \t\t \t\t \t\t \t\tThere is a video in Show steps which goes through a similar example.
\n\t\t \t\t \t\t \t\t \n\t\t \t\t \t\t \n\t\t \t\t \n\t\t \n\t\t", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "parts": [{"type": "gapfill", "customName": "", "useCustomName": false, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "stepsPenalty": 1, "sortAnswers": false, "prompt": "$y=\\;\\phantom{{}}$[[0]]
", "steps": [{"type": "information", "customName": "", "useCustomName": false, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "prompt": "\n\t\t\t\t\tThe equation of the line is of the form $y=mx+c$.
\n\t\t\t\t\tYou are given the slope or gradient $m$ and you can calculate the constant term $c$ by noting that $y=\\var{b}$ when $x=\\var{a}$.
\n\t\t\t\t\tThe following video goes through a similar example.
\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t", "variableReplacements": [], "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}}], "variableReplacements": [], "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "gaps": [{"customName": "", "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5, "checkVariableNames": false, "answer": "({b-d}/{a-c})x+{b*c-a*d}/{c-a}", "vsetRange": [0, 1], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "type": "jme", "useCustomName": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "notallowed": {"partialCredit": 0, "message": "Input all numbers as fractions or integers as appropriate and not as decimals.
", "strings": ["."], "showStrings": false}, "valuegenerators": [{"value": "", "name": "x"}], "failureRate": 1, "checkingType": "absdiff", "variableReplacements": [], "showPreview": true, "checkingAccuracy": 0.001, "marks": 4, "answerSimplification": "std"}]}], "name": "Grainne's copy of Find the equation of a line with given gradient through a given point", "statement": "\n\tFind the equation of the straight line which:
\n\t\n\t
\n\t
Input your answer in the form $mx+c$ for suitable values of $m$ and $c$.
\n\tInput $m$ and $c$ as fractions or integers as appropriate and not as decimals.
\n\tClick on \"Show steps\" if you need help, you will lose 1 mark if you do so.
\n\tNote that there is also a video in Show steps which goes through a similar example.
\n\t \n\t", "functions": {}, "variables": {"c": {"name": "c", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "a+Random(1..4)*s1"}, "d": {"name": "d", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-9..9)"}, "b1": {"name": "b1", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-9..9)"}, "f": {"name": "f", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "(b-d)/(a-c)"}, "b": {"name": "b", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "if(b1=d,b1+random(1..3),b1)"}, "s1": {"name": "s1", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-1,1)"}, "a": {"name": "a", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(1,-1)*random(1..4)"}, "g": {"name": "g", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "(b*c-a*d)/(c-a)"}}, "advice": "\n\tThe equation of the line is of the form $y=mx+c$.
\n\tYou are given the slope or gradient $\\displaystyle m= \\simplify{{b-d}/{a-c}}$ and we can calculate the constant term $c$ by noting that $y=\\var{b}$ when $x=\\var{a}$.
\n\tUsing this we get:
\\[ \\begin{eqnarray} \\var{b}&=&\\simplify[std]{({b-d}/{a-c}){a}+c} \\Rightarrow\\\\ c&=&\\simplify[std]{{b}-({b-d}/{a-c}){a}={(b*c-a*d)}/{(c-a)}} \\end{eqnarray} \\]
Hence the equation of the line is
\\[y = \\simplify[std]{({b-d}/{a-c})x+{b*c-a*d}/{c-a}}\\]