// Numbas version: finer_feedback_settings {"name": "Find matrix from entry formula (same as WBQ 1.23)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Find matrix from entry formula (same as WBQ 1.23)", "tags": ["entry", "matrix"], "metadata": {"description": "
Finding a matrix from a formula for each entry, which involves the row and column numbers of that entry. Not randomized because it's the same as in our workbook. But the variables are made in a way that it should be easy to randomise the size of the matrix, and the to change the formula for the input in not too many places.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "(This question is not randomised. You can find a version with randomised matrix size, see link in Workbook.)
\nFind the \\(\\var{m}\\times \\var{n}\\) matrix \\(A=(a_{ij})_{\\var{m}\\times \\var{n}}\\) whose entries satisfy the stated condition:
", "advice": "The entry \\(a_{ij}\\) is the entry in row \\(i\\) and column \\(j\\). So when we know the row and column, we can work out the entry from the formula.
\na) \\(a_{ij}=i+j\\), so \\(a_{11}=1+1=2\\) and \\(a_{12}=1+2=3\\) and so on.
\n\\[ A = \\var{generalA} =\\var{unresolvedA1}= \\var{A1}\\]
\nb) \\(a_{ij}=i^{j-1}\\), so \\(a_{11}=1^{0}=1\\) and \\(a_{22}=2^{1}=2\\) and so on.
\n\\[ A = \\var{generalA} =\\var{unresolvedA2}= \\var{A2}\\]
", "rulesets": {}, "extensions": [], "variables": {"A1": {"name": "A1", "group": "Ungrouped variables", "definition": "matrix(map(rawA1[k..k+n],k,list(vector(0..m-1)*n)))", "description": "matrix([2,3,4,5],[3,4,5,6],[4,5,6,7],[5,6,7,8])
", "templateType": "anything"}, "A2": {"name": "A2", "group": "Ungrouped variables", "definition": "matrix(map(rawA2[k..k+n],k,list(vector(0..m-1)*n)))", "description": "matrix([1,1,1,1],[1,2,4,8],[1,3,9,27],[1,4,16,64])
", "templateType": "anything"}, "generalA": {"name": "generalA", "group": "Ungrouped variables", "definition": "latex('\\\\begin{pmatrix}'+ concatstrings(rawgeneralA) +'\\\\end{'+'pmatrix}')\n", "description": "latex('\\\\begin{pmatrix} a_{11}&a_{12} & a_{13} & a_{14}\\\\\\\\ a_{21} & a_{22} & a_{23} & a_{24} \\\\\\\\ a_{31} & a_{32} & a_{33} & a_{34} \\\\\\\\ a_{41} & a_{42} & a_{43} & a_{44}\\\\end{pmatrix}')
", "templateType": "anything"}, "unresolvedA1": {"name": "unresolvedA1", "group": "Ungrouped variables", "definition": "latex('\\\\begin{pmatrix}'+ concatstrings(rawunresolvedA1) +'\\\\end{'+'pmatrix}')\n", "description": "latex('\\\\begin{pmatrix} 1+1&1+2 &1+3 & 1+4\\\\\\\\ 2+1 & 2+2 & 2+3 & 2+4 \\\\\\\\ 3+1 & 3+2 & 3+3 & 3+4 \\\\\\\\ 4+1 & 4+2 & 4+3 & 4+4\\\\end{pmatrix}')
", "templateType": "anything"}, "rawA1": {"name": "rawA1", "group": "Ungrouped variables", "definition": "map(k+l,[k,l],product(1..m,1..n))", "description": "", "templateType": "anything"}, "rawA2": {"name": "rawA2", "group": "Ungrouped variables", "definition": "map(k^(l-1),[k,l],product(1..m,1..n))", "description": "", "templateType": "anything"}, "rawunresolvedA1": {"name": "rawunresolvedA1", "group": "Ungrouped variables", "definition": "map('{k}+{l}'+symbols[k-1][l-1],[k,l],product(1..m,1..n))", "description": "", "templateType": "anything"}, "symbols": {"name": "symbols", "group": "Ungrouped variables", "definition": "repeat(repeat('&',n-1)+['\\\\\\\\'],m-1)+[repeat('&',n-1)+['']]", "description": "['&','&','&','\\\\\\\\']
", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "4", "description": "number of columns
", "templateType": "anything"}, "rawunresolvedA2": {"name": "rawunresolvedA2", "group": "Ungrouped variables", "definition": "map('{k}^{{l}-1}'+symbols[k-1][l-1],[k,l],product(1..m,1..n))", "description": "", "templateType": "anything"}, "unresolvedA2": {"name": "unresolvedA2", "group": "Ungrouped variables", "definition": "latex('\\\\begin{pmatrix}'+ concatstrings(rawunresolvedA2) +'\\\\end{'+'pmatrix}')", "description": "", "templateType": "anything"}, "rawgeneralA": {"name": "rawgeneralA", "group": "Ungrouped variables", "definition": "map('a_{'+'{k}'+'{l}}'+symbols[k-1][l-1],[k,l],product(1..m,1..n))", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "4", "description": "number of rows
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["m", "n", "rawA1", "A1", "rawA2", "A2", "rawgeneralA", "generalA", "symbols", "rawunresolvedA1", "unresolvedA1", "rawunresolvedA2", "unresolvedA2"], "variable_groups": [], "functions": {"concatstrings": {"parameters": [["input", "list"]], "type": "string", "language": "javascript", "definition": "var output = '';\nvar i;\nfor (i = 0; i < input.length; i++) {\n output += input[i];\n} \nreturn output;"}}, "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": "\\(a_{ij}=i+j\\). Then \\(A= \\) [[0]]
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "A1", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}, {"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": "\\(a_{ij}=i^{j-1}\\). Then \\(A= \\) [[0]]
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "{A2}", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "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/"}]}