// Numbas version: finer_feedback_settings {"name": "The distance between two complex numbers", "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"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "b3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(d2=t2,t2+random(1..4),t2)", "description": "", "name": "b3"}, "s5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s5"}, "t2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s5*random(1..9)", "description": "", "name": "t2"}, "c4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s4*random(1..9)", "description": "", "name": "c4"}, "b4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*random(1..9)", "description": "", "name": "b4"}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s2"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*random(1..9)", "description": "", "name": "a1"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z3-z4),3)", "description": "", "name": "ans2"}, "c2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s6*random(1..9)", "description": "", "name": "c2"}, "d2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s7*random(1..9)", "description": "", "name": "d2"}, "t3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s7*random(1..9)", "description": "", "name": "t3"}, "z3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c2+d2*i", "description": "", "name": "z3"}, "z1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a1+b1*i", "description": "", "name": "z1"}, "z4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a3+b3*i", "description": "", "name": "z4"}, "z6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c4+d4*i", "description": "", "name": "z6"}, "z5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a4+b4*i", "description": "", "name": "z5"}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z5-z6),3)", "description": "", "name": "ans3"}, "d4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(b4=t3,t3+random(1..4),t3)", "description": "", "name": "d4"}, "z2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a2+b2*i", "description": "", "name": "z2"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(b2=t1,t1+random(1..4),t1)", "description": "", "name": "b1"}, "a2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s2*random(1..9)", "description": "", "name": "a2"}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z1-z2),3)", "description": "", "name": "ans1"}, "b2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s5*random(1..9)", "description": "", "name": "b2"}, "s4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s4"}, "t1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s4*random(1..9)", "description": "", "name": "t1"}, "a3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*random(1..9)", "description": "", "name": "a3"}, "a4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s6*random(1..9)", "description": "", "name": "a4"}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s3"}, "s6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s6"}, "s7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s7"}}, "ungrouped_variables": ["ans1", "ans2", "ans3", "b4", "b1", "b2", "b3", "d4", "d2", "s3", "s2", "s1", "s7", "s6", "s5", "s4", "z2", "tol", "z3", "a1", "a3", "a2", "a4", "z4", "z5", "z6", "z1", "c2", "c4", "t2", "t3", "t1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "The distance between two complex numbers", "showQuestionGroupNames": false, "functions": {}, "parts": [{"showCorrectAnswer": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans1+tol", "minValue": "ans1-tol", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "prompt": "\n \n \n

Find the distance between $\\var{z1}$ and $\\var{z2}$.

\n \n \n \n

Distance = [[0]]

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

Find the distance between $\\var{z3}$ and $\\var{z4}$.

\n \n \n \n

Distance = [[0]]

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

Find the distance between $\\var{z5}$ and $\\var{z6}$.

\n \n \n \n

Distance = [[0]]

\n \n \n ", "variableReplacements": [], "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Find the distance between the following complex numbers, leaving your answer in decimal form to 3 decimal places:

", "tags": ["checked2015", "complex numbers", "distance between complex numbers", "mas1602", "MAS1602", "modulus", "modulus of a complex number", "modulus of complex numbers"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/07/2015:

\n

Added tags.

\n

5/07/2012:

\n

Added tags.

\n

Perhaps more steps are needed in the solutions? It isn't explained how to find the modulus of the complex number. Explanation included in Advice.

\n

Question appears to be working correctly.

\n

13/07/2012:

\n

Set new variable tol=0 for all numeric input.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Finding the distance between two complex numbers using the modulus of their difference. Three parts.

"}, "advice": "\n \n \n

The distance D between two complex numbers $z_1=a+bi$ and $z_2=c+di$ is given by the modulus of the difference i.e.
\\[D=|z_1-z_2| = |(a-c)+(b-d)i|=\\sqrt{(a-c)^2+(b-d)^2}\\]
Applying to the questions we have:\t\t\t\t\t
a) \\[ \\begin{eqnarray*} D&=&|(\\var{z1})-(\\var{z2})|\\\\\n \n &=&|\\var{z1-z2}|\\\\\n \n &=& \\var{abs(z1-z2)}\\\\\n \n &=&\\var{ans1}\n \n \\end{eqnarray*} \\] to 3 decimal places.

\n \n \n \n

b) \\[ \\begin{eqnarray*} D&=&|(\\var{z3})-(\\var{z4})|\\\\\n \n &=&|\\var{z3-z4}|\\\\\n \n &=& \\var{abs(z3-z4)}\\\\\n \n &=&\\var{ans2}\n \n \\end{eqnarray*} \\] to 3 decimal places.

\n \n \n \n

c) \\[ \\begin{eqnarray*} D&=&|(\\var{z5})-(\\var{z6})|\\\\\n \n &=&|\\var{z5-z6}|\\\\\n \n &=& \\var{abs(z5-z6)}\\\\\n \n &=&\\var{ans3}\n \n \\end{eqnarray*} \\] to 3 decimal places.

\n \n \n ", "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/"}]}