// Numbas version: finer_feedback_settings {"name": "Equation of a straight line, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-1,1)", "description": "", "name": "s1"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(b1=d,b1+random(1..3),b1)", "description": "", "name": "b"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+Random(1..4)*s1", "description": "", "name": "c"}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b-d)/(a-c)", "description": "", "name": "f"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "b1"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "d"}, "g": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b*c-a*d)/(c-a)", "description": "", "name": "g"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)*random(1..4)", "description": "", "name": "a"}}, "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "s1", "b1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Equation of a straight line, ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"stepsPenalty": 1, "scripts": {}, "gaps": [{"answer": "({b-d}/{a-c})x+{b*c-a*d}/{c-a}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "
Input all numbers as fractions or integers as appropriate and not as decimals.
", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 2, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "$y=\\;\\phantom{{}}$[[0]]
", "steps": [{"type": "information", "prompt": "\nThe equation of the line is of the form $y=mx+c$.
\nCalculate the gradient $m$ between the given points and then calculate the constant term $c$ by noting that $y=\\var{b}$ when $x=\\var{a}$.
\n ", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}], "statement": "\nFind the equation of the straight line which passes through the points $(\\var{a},\\var{b})$ and $(\\var{c},\\var{d})$:
\n \n\n
Input your answer in the form $mx+c$ for suitable values of $m$ and $c$.
\nInput $m$ and $c$ as fractions or integers as appropriate and not as decimals.
\nIf you input $m$ as a fraction, put brackets ( ) around the fraction. For example, if your answer for $m$ is $\\dfrac{-2}{3}$ and your answer for $c$ is $\\dfrac{7}{5}$, you should write $(-2/3)x+7/5$.
\nClick on Show steps if you need help, you will lose 1 mark if you do so.
\n ", "tags": ["MAS1602", "SFY0001", "Steps", "checked2015", "equation of a straight line", "gradient of a line"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "Find the equation of the straight line which passes through the points $(a,b)$ and $(c,d)$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\nThe equation of the line is of the form $y=mx+c$.
\nCalculate the gradient $m=\\dfrac{\\var{d}-(\\var{b})}{\\var{c}-(\\var{a})}=\\dfrac{\\var{d-b}}{\\var{c-a}}$ between the given points and then calculate the constant term $c$ by noting that $y=\\var{b}$ when $x=\\var{a}$.
\nUsing 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}}\\]