// Numbas version: finer_feedback_settings {"name": "Luis's copy of 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": [{"question_groups": [{"name": "", "pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0}], "statement": "

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

", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": ["checked2015", "complex numbers", "distance between complex numbers", "mas1602", "MAS1602", "modulus", "modulus of a complex number", "modulus of complex numbers"], "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.

", "description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"variableReplacements": [], "gaps": [{"variableReplacements": [], "minValue": "ans1-tol", "maxValue": "ans1+tol", "allowFractions": false, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false}], "marks": 0, "type": "gapfill", "showCorrectAnswer": true, "scripts": {}, "prompt": "\n \n \n

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

\n \n \n \n

Distance = [[0]]

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

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

\n \n \n \n

Distance = [[0]]

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

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

\n \n \n \n

Distance = [[0]]

\n \n \n ", "variableReplacementStrategy": "originalfirst"}], "variables": {"z2": {"name": "z2", "definition": "a2+b2*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s1": {"name": "s1", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t2": {"name": "t2", "definition": "s5*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "ans3": {"name": "ans3", "definition": "precround(abs(z5-z6),3)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s7": {"name": "s7", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "a1": {"name": "a1", "definition": "s1*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "a2": {"name": "a2", "definition": "s2*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "z5": {"name": "z5", "definition": "a4+b4*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t3": {"name": "t3", "definition": "s7*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "a3": {"name": "a3", "definition": "s1*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s5": {"name": "s5", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "c4": {"name": "c4", "definition": "s4*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "b3": {"name": "b3", "definition": "if(d2=t2,t2+random(1..4),t2)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "z4": {"name": "z4", "definition": "a3+b3*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "definition": "a1+b1*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "b1": {"name": "b1", "definition": "if(b2=t1,t1+random(1..4),t1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "a4": {"name": "a4", "definition": "s6*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "ans1": {"name": "ans1", "definition": "precround(abs(z1-z2),3)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s6": {"name": "s6", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "c2": {"name": "c2", "definition": "s6*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t1": {"name": "t1", "definition": "s4*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tol": {"name": "tol", "definition": "0.001", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "z6": {"name": "z6", "definition": "c4+d4*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "d4": {"name": "d4", "definition": "if(b4=t3,t3+random(1..4),t3)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s4": {"name": "s4", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "ans2": {"name": "ans2", "definition": "precround(abs(z3-z4),3)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "d2": {"name": "d2", "definition": "s7*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s3": {"name": "s3", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "b2": {"name": "b2", "definition": "s5*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s2": {"name": "s2", "definition": "random(1,-1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "definition": "c2+d2*i", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "b4": {"name": "b4", "definition": "s1*random(1..9)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "name": "Luis's copy of The distance between two complex numbers", "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 ", "preamble": {"js": "", "css": ""}, "showQuestionGroupNames": false, "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"], "type": "question", "functions": {}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "variable_groups": [], "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/"}]}