// Numbas version: finer_feedback_settings {"name": "Simon's copy of Row reducing a matrix and finding its rank and nullity-MA2223", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "

Reduce a 5x6 matrix to row reduced form and using this find rank and nullity.

", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"condition": "deter<>0\nand\nmax(map(testing(record[0][x]),x,0..length(record[0])-1))=0", "maxRuns": "200"}, "preamble": {"css": "", "js": "question.functions={};\nquestion.functions.ref=function(m){\n \n m = util.copyarray(m,true);\n \n function finish() {\n\n return rank;\n }\n\n\n\n var lead = 0;\n var rank = 0;\n var echelon=[];\n var rows = m.length;\n for(var i=0;i');\nvar n=matrix_list.length;\nvar m='';\nvar mess='';\nfor(var i=0;i'+mess+'');\ntable.append('');\ntable.append(''+m+''); \n}\nreturn table;\n", "type": "html", "language": "javascript"}, "echelon_form_matrix": {"parameters": [["n", "number"], ["r", "number"], ["m", "number"], ["max", "number"]], "definition": "\nfunction getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\n//generate a random echelon form\nfunction random_echelon_form(columns,rank){\nvar l=[];\nvar ech_form=[], ech_form1=[],b=[];\nfor(var i=1;i=ind?temp.push(getRandomInt(1,max)):temp.push(0);\n }\n for(var k=0;k(a)

\n

The following shows how $A$ is reduced to row-echelon form.

\n

\n

{solution(record_ops_matrix,record_ops_message)}

\n

\n

(b) 

\n

Once a matrix is in reduced row echelon form, we can find the rank simply by counting the number of nonzero rows. This is also the same as the number of leading 1s.

\n

Thus in our example $Rank(A)=\\var{rank}$.

\n

Remember that the Rank-Nullity Theorem says that:

\n

Number of Columns of $A = Rank(A) + Nullity(A)$

\n

\n

Hence $Nullity(A) = $ number of columns $-Rank(A)=5-\\var{rank}=\\var{nullity}$.

\n

\n

Also the dimensions of the row space and the column space are both equal to the rank.

\n

Finally, the dimension of the null space is the nullity.

\n

", "parts": [{"variableReplacements": [], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "gaps": [{"variableReplacements": [], "allowFractions": true, "type": "matrix", "extendBaseMarkingAlgorithm": true, "allowResize": false, "scripts": {}, "correctAnswer": "{echmatrix}", "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "tolerance": 0, "variableReplacementStrategy": "originalfirst", "markPerCell": false, "useCustomName": false, "customName": "", "numColumns": "5", "correctAnswerFractions": true, "numRows": "6", "marks": "4", "unitTests": []}], "prompt": "

\n

$R= $[[0]]

\n

All entries in the matrix must be input as fractions or integers and not as decimals.

\n

\n

", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "useCustomName": false, "customName": "", "marks": 0, "unitTests": []}, {"variableReplacements": [], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "gaps": [{"variableReplacements": [], "maxValue": "rank", "type": "numberentry", "extendBaseMarkingAlgorithm": true, "scripts": {}, "allowFractions": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "correctAnswerFraction": false, "useCustomName": false, "customName": "", "mustBeReduced": false, "minValue": "rank", "mustBeReducedPC": 0, "marks": "0.2", "unitTests": []}, {"variableReplacements": [], "maxValue": "nullity", "type": "numberentry", "extendBaseMarkingAlgorithm": true, "scripts": {}, "allowFractions": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "correctAnswerFraction": false, "useCustomName": false, "customName": "", "mustBeReduced": false, "minValue": "nullity", "mustBeReducedPC": 0, "marks": "0.2", "unitTests": []}, {"variableReplacements": [], "maxValue": "rank", "type": "numberentry", "extendBaseMarkingAlgorithm": true, "scripts": {}, "allowFractions": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "correctAnswerFraction": false, "useCustomName": false, "customName": "", "mustBeReduced": false, "minValue": "rank", "mustBeReducedPC": 0, "marks": "0.2", "unitTests": []}, {"variableReplacements": [], "maxValue": "rank", "type": "numberentry", "extendBaseMarkingAlgorithm": true, "scripts": {}, "allowFractions": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "correctAnswerFraction": false, "useCustomName": false, "customName": "", "mustBeReduced": false, "minValue": "rank", "mustBeReducedPC": 0, "marks": "0.2", "unitTests": []}, {"variableReplacements": [], "maxValue": "nullity", "type": "numberentry", "extendBaseMarkingAlgorithm": true, "scripts": {}, "allowFractions": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFractionHint": true, "correctAnswerFraction": false, "useCustomName": false, "customName": "", "mustBeReduced": false, "minValue": "nullity", "mustBeReducedPC": 0, "marks": "0.2", "unitTests": []}], "prompt": "

\n

$\\operatorname{Rank}(A)=$[[0]]

\n

$\\operatorname{Nullity}(A)=$[[1]]

\n

$\\operatorname{dim}(\\operatorname{col}(A))=$[[2]]

\n

$\\operatorname{dim}(\\operatorname{row}(A))=$[[3]]

\n

$\\operatorname{dim}(\\operatorname{null}(A))=$[[4]]

\n

", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "useCustomName": false, "customName": "", "marks": 0, "unitTests": []}], "name": "Simon's copy of Row reducing a matrix and finding its rank and nullity-MA2223", "statement": "

Find the row-reduced echelon form $R$ of the following matrix $A$.

\n

$A=\\var{testmatrix}$

\n

\n

", "variable_groups": [], "ungrouped_variables": ["echelonform", "ech", "echform", "testmatrix", "record", "rref1", "record_ops_matrix", "record_ops_message", "rank", "maxint", "steps", "rdmat", "deter", "nullity", "echmatrix", "trtestmatrix", "rows", "columns", "column_basis", "sum", "null_basis", "ec", "chosen", "student_cols_matrix", "not_chosen_col"], "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}