// Numbas version: finer_feedback_settings {"name": "Matrices: Scalar Multiple (Instructional)", "metadata": {"description": "Scalar Multiplication of matrices, plus used in combination with addition & subtraction", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", ""], "variable_overrides": [[], [], []], "questions": [{"name": "Matrices: Scalar Multiple 01", "extensions": [], "custom_part_types": [], "resources": [["question-resources/matrix_add.gif", "/srv/numbas/media/question-resources/matrix_add.gif"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}], "tags": [], "metadata": {"description": "Scalar Multiplication (pre-defined sizes in answers)", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "
If $ A= \\left( \\begin{array}{ccc} a_{11} & a_{12} \\\\ a_{21} & a_{22} \\\\ a_{31} & a_{32} \\end{array} \\right) $ then $ kA= \\left( \\begin{array}{ccc} k \\times a_{11} & k \\times a_{12} \\\\ k\\times a_{21} &k\\times a_{22} \\\\ k\\times a_{31} &k\\times a_{32} \\end{array} \\right) $
\n\n
This operation is called scalar multiplication, but its result is not named \"scalar product\" to avoid confusion, since \"scalar product\" is often used as a synonym for the \"dot product\" or \"inner product\".
", "advice": "This is simply achieved by multiplying each element by the constant:
\nUsing this technique results in:
\nIf $A=\\var{A}$ then: $\\var{k1} A=\\left( \\begin{array}{ccc} \\var{k1} \\times \\var{A[0][0]} & \\var{k1} \\times \\var{A[0][1]}& \\var{k1} \\times \\var{A[0][2]}\\\\ \\var{k1} \\times \\var{A[1][0]} & \\var{k1} \\times \\var{A[1][1]}& \\var{k1} \\times \\var{A[1][2]}\\\\ \\var{k1} \\times \\var{A[2][0]} & \\var{k1} \\times \\var{A[2][1]} & \\var{k1} \\times \\var{A[2][2]} \\end{array} \\right) = \\var{ad1}$
\n\nFollowing the same process gives:
\n\n
If $B=\\var{B}$ then:
\n\n
$\\var{k2}B=\\var{ad2}$
\n\n
\n
If $C=\\var{C}$ then:
\n\n
$\\var{k3}C=\\var{ad3}$
\n\n
\n
If $D=\\var{D}$ then:
\n\n
$\\var{k4}D=\\var{ad4}$
\n\n
\n
If $E=\\var{EE}$ then:
\n\n
$\\var{k5}E=\\var{ad5}$
\n\n\n\n", "rulesets": {}, "variables": {"m1": {"name": "m1", "group": "A", "definition": "n1", "description": "", "templateType": "anything"}, "A": {"name": "A", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "n2": {"name": "n2", "group": "B", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "m2": {"name": "m2", "group": "B", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "B": {"name": "B", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "n3": {"name": "n3", "group": "C", "definition": "random(1 .. 4#1)", "description": "", "templateType": "randrange"}, "m3": {"name": "m3", "group": "C", "definition": "random(2 .. 5#1)", "description": "", "templateType": "randrange"}, "C": {"name": "C", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n3),m3)))", "description": "", "templateType": "anything"}, "n4": {"name": "n4", "group": "D", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m4": {"name": "m4", "group": "D", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "n1": {"name": "n1", "group": "A", "definition": "3", "description": "", "templateType": "number"}, "D": {"name": "D", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "n5": {"name": "n5", "group": "E", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m5": {"name": "m5", "group": "E", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "EE": {"name": "EE", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "e1": {"name": "e1", "group": "A", "definition": "A[n1-1][m1-1]", "description": "", "templateType": "anything"}, "E2": {"name": "E2", "group": "B", "definition": "b[n2-1][m2-1]", "description": "", "templateType": "anything"}, "trC": {"name": "trC", "group": "C", "definition": "(C[0][0])+(C[1][1])+(C[2][2])+(C[3][3])+(C[4][4])", "description": "", "templateType": "anything"}, "A2": {"name": "A2", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "B2": {"name": "B2", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "C2": {"name": "C2", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n3),m3)))", "description": "", "templateType": "anything"}, "D2": {"name": "D2", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "EE2": {"name": "EE2", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "ad1": {"name": "ad1", "group": "Ungrouped variables", "definition": "{k1}{A}", "description": "", "templateType": "anything"}, "ad2": {"name": "ad2", "group": "Ungrouped variables", "definition": "{k2}{B}", "description": "", "templateType": "anything"}, "ad3": {"name": "ad3", "group": "Ungrouped variables", "definition": "{k3}{C}", "description": "", "templateType": "anything"}, "ad4": {"name": "ad4", "group": "Ungrouped variables", "definition": "{k4}{D}", "description": "", "templateType": "anything"}, "ad5": {"name": "ad5", "group": "Ungrouped variables", "definition": "{k5}{EE}", "description": "", "templateType": "anything"}, "k1": {"name": "k1", "group": "scalar constants", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "k2": {"name": "k2", "group": "scalar constants", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "k3": {"name": "k3", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}, "k4": {"name": "k4", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}, "k5": {"name": "k5", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["ad1", "ad2", "ad3", "ad4", "ad5"], "variable_groups": [{"name": "A", "variables": ["n1", "m1", "A", "e1", "A2"]}, {"name": "B", "variables": ["n2", "m2", "B", "E2", "B2"]}, {"name": "C", "variables": ["n3", "m3", "C", "trC", "C2"]}, {"name": "D", "variables": ["n4", "m4", "D", "D2"]}, {"name": "E", "variables": ["n5", "m5", "EE", "EE2"]}, {"name": "scalar constants", "variables": ["k1", "k2", "k3", "k4", "k5"]}], "functions": {"calculateTrace": {"parameters": [], "type": "number", "language": "javascript", "definition": ""}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "
You will need to define the size of the matrix before entering your answer.
\n\n\nIf $A=\\var{A}$ then:
\n\n
$\\var{k1} A=$ [[0]]
\n\n\nIf $B=\\var{B}$ then:
\n\n
$\\var{k2}B=$ [[1]]
\n\n
\n
If $C=\\var{C}$ then:
\n\n
$\\var{k3}C=$ [[2]]
\n\n
\n
If $D=\\var{D}$ then:
\n\n
$\\var{k4}D=$ [[3]]
\n\n
\n
If $E=\\var{EE}$ then:
\n\n
$\\var{k5}E=$ [[4]]
\n\n
\n\n
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k1}{A}", "correctAnswerFractions": false, "numRows": "{n1}", "numColumns": "{m1}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k2}{B}", "correctAnswerFractions": false, "numRows": "{n2}", "numColumns": "{m2}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k3}{C}", "correctAnswerFractions": false, "numRows": "{n3}", "numColumns": "{m3}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k4}{D}", "correctAnswerFractions": false, "numRows": "{n4}", "numColumns": "{m4}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k5}{EE}", "correctAnswerFractions": false, "numRows": "{n5}", "numColumns": "{m5}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Matrices: Scalar Multiple 02", "extensions": [], "custom_part_types": [], "resources": [["question-resources/matrix_add.gif", "/srv/numbas/media/question-resources/matrix_add.gif"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}], "tags": [], "metadata": {"description": "Scalar Multiplication (student-defines sizes in answers)", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "
If $ A= \\left( \\begin{array}{ccc} a_{11} & a_{12} \\\\ a_{21} & a_{22} \\\\ a_{31} & a_{32} \\end{array} \\right) $ then $ kA= \\left( \\begin{array}{ccc} k \\times a_{11} & k \\times a_{12} \\\\ k\\times a_{21} &k\\times a_{22} \\\\ k\\times a_{31} &k\\times a_{32} \\end{array} \\right) $
\n\n
This operation is called scalar multiplication, but its result is not named \"scalar product\" to avoid confusion, since \"scalar product\" is often used as a synonym for the \"dot product\" or \"inner product\".
", "advice": "This is simply achieved by multiplying each element by the constant:
\nUsing this technique results in:
\nIf $A=\\var{A}$ then: $\\var{k1} A=\\left( \\begin{array}{ccc} \\var{k1} \\times \\var{A[0][0]} & \\var{k1} \\times \\var{A[0][1]}& \\var{k1} \\times \\var{A[0][2]}\\\\ \\var{k1} \\times \\var{A[1][0]} & \\var{k1} \\times \\var{A[1][1]}& \\var{k1} \\times \\var{A[1][2]}\\\\ \\var{k1} \\times \\var{A[2][0]} & \\var{k1} \\times \\var{A[2][1]} & \\var{k1} \\times \\var{A[2][2]} \\end{array} \\right) = \\var{ad1}$
\n\nFollowing the same process gives:
\n\n
If $B=\\var{B}$ then:
\n\n
$\\var{k2}B=\\var{ad2}$
\n\n
\n
If $C=\\var{C}$ then:
\n\n
$\\var{k3}C=\\var{ad3}$
\n\n
\n
If $D=\\var{D}$ then:
\n\n
$\\var{k4}D=\\var{ad4}$
\n\n
\n
If $E=\\var{EE}$ then:
\n\n
$\\var{k5}E=\\var{ad5}$
\n\n\n\n", "rulesets": {}, "variables": {"m1": {"name": "m1", "group": "A", "definition": "n1", "description": "", "templateType": "anything"}, "A": {"name": "A", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "n2": {"name": "n2", "group": "B", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "m2": {"name": "m2", "group": "B", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "B": {"name": "B", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "n3": {"name": "n3", "group": "C", "definition": "random(1 .. 4#1)", "description": "", "templateType": "randrange"}, "m3": {"name": "m3", "group": "C", "definition": "random(2 .. 5#1)", "description": "", "templateType": "randrange"}, "C": {"name": "C", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n3),m3)))", "description": "", "templateType": "anything"}, "n4": {"name": "n4", "group": "D", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m4": {"name": "m4", "group": "D", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "n1": {"name": "n1", "group": "A", "definition": "3", "description": "", "templateType": "number"}, "D": {"name": "D", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "n5": {"name": "n5", "group": "E", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m5": {"name": "m5", "group": "E", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "EE": {"name": "EE", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "e1": {"name": "e1", "group": "A", "definition": "A[n1-1][m1-1]", "description": "", "templateType": "anything"}, "E2": {"name": "E2", "group": "B", "definition": "b[n2-1][m2-1]", "description": "", "templateType": "anything"}, "trC": {"name": "trC", "group": "C", "definition": "(C[0][0])+(C[1][1])+(C[2][2])+(C[3][3])+(C[4][4])", "description": "", "templateType": "anything"}, "A2": {"name": "A2", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "B2": {"name": "B2", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "C2": {"name": "C2", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n3),m3)))", "description": "", "templateType": "anything"}, "D2": {"name": "D2", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "EE2": {"name": "EE2", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "ad1": {"name": "ad1", "group": "Ungrouped variables", "definition": "{k1}{A}", "description": "", "templateType": "anything"}, "ad2": {"name": "ad2", "group": "Ungrouped variables", "definition": "{k2}{B}", "description": "", "templateType": "anything"}, "ad3": {"name": "ad3", "group": "Ungrouped variables", "definition": "{k3}{C}", "description": "", "templateType": "anything"}, "ad4": {"name": "ad4", "group": "Ungrouped variables", "definition": "{k4}{D}", "description": "", "templateType": "anything"}, "ad5": {"name": "ad5", "group": "Ungrouped variables", "definition": "{k5}{EE}", "description": "", "templateType": "anything"}, "k1": {"name": "k1", "group": "scalar constants", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "k2": {"name": "k2", "group": "scalar constants", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "k3": {"name": "k3", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}, "k4": {"name": "k4", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}, "k5": {"name": "k5", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["ad1", "ad2", "ad3", "ad4", "ad5"], "variable_groups": [{"name": "A", "variables": ["n1", "m1", "A", "e1", "A2"]}, {"name": "B", "variables": ["n2", "m2", "B", "E2", "B2"]}, {"name": "C", "variables": ["n3", "m3", "C", "trC", "C2"]}, {"name": "D", "variables": ["n4", "m4", "D", "D2"]}, {"name": "E", "variables": ["n5", "m5", "EE", "EE2"]}, {"name": "scalar constants", "variables": ["k1", "k2", "k3", "k4", "k5"]}], "functions": {"calculateTrace": {"parameters": [], "type": "number", "language": "javascript", "definition": ""}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "
You will need to define the size of the matrix before entering your answer.
\n\n\nIf $A=\\var{A}$ then:
\n\n
$\\var{k1} A=$ [[0]]
\n\n\nIf $B=\\var{B}$ then:
\n\n
$\\var{k2}B=$ [[1]]
\n\n
\n
If $C=\\var{C}$ then:
\n\n
$\\var{k3}C=$ [[2]]
\n\n
\n
If $D=\\var{D}$ then:
\n\n
$\\var{k4}D=$ [[3]]
\n\n
\n
If $E=\\var{EE}$ then:
\n\n
$\\var{k5}E=$ [[4]]
\n\n
\n\n
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k1}{A}", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k2}{B}", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k3}{C}", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k4}{D}", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k5}{EE}", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Matrices: Scalar Multiple 03", "extensions": [], "custom_part_types": [], "resources": [["question-resources/matrix_add.gif", "/srv/numbas/media/question-resources/matrix_add.gif"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}], "tags": [], "metadata": {"description": "Scalar Multiplication, addition and subtraction in combination (pre-defined sizes in answers)", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "
If $A=\\var{A}$ and $B=\\var{A2}$ then:
\n\n
$\\var{k1} A+B=\\var{k1} \\var{A}+\\var{A2}$
\n\n
$\\var{k1} A+B=\\var{ad1}+\\var{A2}$
\n\n
$\\var{k1} A+B=\\var{ad1a}$
\n\n
\n
If $C=\\var{B}$ and $D=\\var{B2}$ then:
\n\n
$C-\\var{k2}D=\\var{B}-\\var{k2}\\var{B2}$
\n\n
$C-\\var{k2}D=\\var{B}-\\var{ad2}$
\n\n
$C-\\var{k2}D=\\var{ad2a}$
\n\n
\n
If $E=\\var{C}$ and $F=\\var{C2}$ then:
\n\n
$\\var{k3}E-\\var{k1}F=\\var{k3}\\var{C}-\\var{k1}\\var{C2}$
\n\n
$\\var{k3}E-\\var{k1}F=\\var{ad3}-\\var{ad3a}$
\n\n
$\\var{k3}E-\\var{k1}F=\\var{ad3b}$
\n\n
\n
If $G=\\var{D}$ and $H=\\var{D2}$ then:
\n\n
$\\var{k4}G+H=\\var{k4}\\var{D}+\\var{D2}$
\n\n
$\\var{k4}G+H=\\var{ad4}+\\var{D2}$
\n\n
$\\var{k4}G+H=\\var{ad4a}$
\n\n
\n
If $I=\\var{EE}$ and $J=\\var{EE2}$ then:
\n\n
$\\var{k5}I-J=\\var{k5}\\var{EE}-\\var{EE2}$
\n\n
$\\var{k5}I-J=\\var{ad5}-\\var{EE2}$
\n\n
$\\var{k5}I-J=\\var{ad5a}$
\n\n
\n\n
\n", "rulesets": {}, "variables": {"m1": {"name": "m1", "group": "A", "definition": "n1", "description": "", "templateType": "anything"}, "A": {"name": "A", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..6),n1),m1)))", "description": "", "templateType": "anything"}, "n2": {"name": "n2", "group": "B", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "m2": {"name": "m2", "group": "B", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "B": {"name": "B", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "n3": {"name": "n3", "group": "C", "definition": "random(2 .. 3#1)", "description": "", "templateType": "randrange"}, "m3": {"name": "m3", "group": "C", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "C": {"name": "C", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n3),m3)))", "description": "", "templateType": "anything"}, "n4": {"name": "n4", "group": "D", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m4": {"name": "m4", "group": "D", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "n1": {"name": "n1", "group": "A", "definition": "3", "description": "", "templateType": "number"}, "D": {"name": "D", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "n5": {"name": "n5", "group": "E", "definition": "random(1 .. 3#1)", "description": "", "templateType": "randrange"}, "m5": {"name": "m5", "group": "E", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}, "EE": {"name": "EE", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "A2": {"name": "A2", "group": "A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "B2": {"name": "B2", "group": "B", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n2),m2)))", "description": "", "templateType": "anything"}, "C2": {"name": "C2", "group": "C", "definition": "transpose(matrix(repeat(repeat(random(-5..5),n3),m3)))", "description": "", "templateType": "anything"}, "D2": {"name": "D2", "group": "D", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n4),m4)))", "description": "", "templateType": "anything"}, "EE2": {"name": "EE2", "group": "E", "definition": "transpose(matrix(repeat(repeat(random(-9..9),n5),m5)))", "description": "", "templateType": "anything"}, "ad1": {"name": "ad1", "group": "Ungrouped variables", "definition": "{k1}{A}", "description": "", "templateType": "anything"}, "ad2": {"name": "ad2", "group": "Ungrouped variables", "definition": "{k2}{B2}", "description": "", "templateType": "anything"}, "ad3": {"name": "ad3", "group": "Ungrouped variables", "definition": "{k3}{C}", "description": "", "templateType": "anything"}, "ad4": {"name": "ad4", "group": "Ungrouped variables", "definition": "{k4}{D}", "description": "", "templateType": "anything"}, "ad5": {"name": "ad5", "group": "Ungrouped variables", "definition": "{k5}{EE}", "description": "", "templateType": "anything"}, "k1": {"name": "k1", "group": "scalar constants", "definition": "random(2..5 except 0)", "description": "", "templateType": "anything"}, "k2": {"name": "k2", "group": "scalar constants", "definition": "random(2..4 except 0)", "description": "", "templateType": "anything"}, "k3": {"name": "k3", "group": "scalar constants", "definition": "random(2..5)", "description": "", "templateType": "anything"}, "k4": {"name": "k4", "group": "scalar constants", "definition": "random(-9..9 except 0 except 1)", "description": "", "templateType": "anything"}, "k5": {"name": "k5", "group": "scalar constants", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "ad1a": {"name": "ad1a", "group": "Ungrouped variables", "definition": "ad1+A2", "description": "", "templateType": "anything"}, "ad2a": {"name": "ad2a", "group": "Ungrouped variables", "definition": "B-ad2", "description": "", "templateType": "anything"}, "ad3a": {"name": "ad3a", "group": "Ungrouped variables", "definition": "{k1}*{C2}", "description": "", "templateType": "anything"}, "ad3b": {"name": "ad3b", "group": "Ungrouped variables", "definition": "{ad3}-{ad3a}", "description": "", "templateType": "anything"}, "ad4a": {"name": "ad4a", "group": "Ungrouped variables", "definition": "{ad4}+{D2}", "description": "", "templateType": "anything"}, "ad5a": {"name": "ad5a", "group": "Ungrouped variables", "definition": "{ad5}-{EE2}", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["ad1", "ad1a", "ad2", "ad2a", "ad3", "ad3a", "ad3b", "ad4", "ad4a", "ad5", "ad5a"], "variable_groups": [{"name": "A", "variables": ["n1", "m1", "A", "A2"]}, {"name": "B", "variables": ["n2", "m2", "B", "B2"]}, {"name": "C", "variables": ["n3", "m3", "C", "C2"]}, {"name": "D", "variables": ["n4", "m4", "D", "D2"]}, {"name": "E", "variables": ["n5", "m5", "EE", "EE2"]}, {"name": "scalar constants", "variables": ["k1", "k2", "k3", "k4", "k5"]}], "functions": {"calculateTrace": {"parameters": [], "type": "number", "language": "javascript", "definition": ""}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "
If $A=\\var{A}$ and $B=\\var{A2}$ then:
\n\n
$\\var{k1} A+B=$ [[0]]
\n\n
\n
If $C=\\var{B}$ and $D=\\var{B2}$ then:
\n\n
$C-\\var{k2}D=$ [[1]]
\n\n
\n
If $E=\\var{C}$ and $F=\\var{C2}$ then:
\n\n
$\\var{k3}E-\\var{k1}F=$ [[2]]
\n\n
\n
If $G=\\var{D}$ and $H=\\var{D2}$ then:
\n\n
$\\var{k4}G+H=$ [[3]]
\n\n
\n
If $I=\\var{EE}$ and $J=\\var{EE2}$ then:
\n\n
$\\var{k5}I-J=$ [[4]]
\n\n
\n\n
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k1}*{A}+{A2}", "correctAnswerFractions": false, "numRows": "{n1}", "numColumns": "{m1}", "allowResize": false, "tolerance": "0", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{B}-{k2}*{B2}", "correctAnswerFractions": false, "numRows": "{n2}", "numColumns": "{m2}", "allowResize": false, "tolerance": "0", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k3}*{C}-{k1}*{C2}", "correctAnswerFractions": false, "numRows": "{n3}", "numColumns": "{m3}", "allowResize": false, "tolerance": "0", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k4}*{D}+{D2}", "correctAnswerFractions": false, "numRows": "{n4}", "numColumns": "{m4}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{k5}*{EE}-{EE2}", "correctAnswerFractions": false, "numRows": "{n5}", "numColumns": "{m5}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}], "extensions": [], "custom_part_types": [], "resources": [["question-resources/matrix_add.gif", "/srv/numbas/media/question-resources/matrix_add.gif"]]}