// Numbas version: finer_feedback_settings {"name": "Trace of a matrix (WBQ 1.21 randomized)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Trace of a matrix (WBQ 1.21 randomized)", "tags": [], "metadata": {"description": "

Calculate trace of a matrix.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Calculate the trace of the following matrix.

", "advice": "

The trace of a square matrix is the sum of the diagonal elements.

\n

\\(\\mathrm{tr}\\var{A}=\\var{A[0][0]}+\\var{A[1][1]}=\\var{trA}\\). \\(\\mathrm{tr}\\var{A}=\\var{A[0][0]}+\\var{A[1][1]}+\\var{A[2][2]}=\\var{trA}\\). \\(\\mathrm{tr}\\var{A}=\\var{A[0][0]}+\\var{A[1][1]}+\\var{A[2][2]}+\\var{A[3][3]}=\\var{trA}\\). \\(\\mathrm{tr}\\var{A}=\\var{A[0][0]}+\\var{A[1][1]}+\\var{A[2][2]}+\\var{A[3][3]}+\\var{A[4][4]}=\\var{trA}\\).

", "rulesets": {}, "extensions": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-20..20),n),n))", "description": "", "templateType": "anything"}, "trA": {"name": "trA", "group": "Ungrouped variables", "definition": "sum(diagonals)", "description": "", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything"}, "diagonals": {"name": "diagonals", "group": "Ungrouped variables", "definition": "map(A[k][k],k,0..n-1)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["A", "trA", "n", "diagonals"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

\\(\\mathrm{tr}\\var{A}=\\) [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "trA", "maxValue": "trA", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}]}], "contributors": [{"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}