// Numbas version: exam_results_page_options {"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}, "question_groups": [{"questions": [{"tags": [], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/", "name": "Newcastle University Mathematics and Statistics"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/", "name": "Simon Thomas"}], "statement": "

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

\n

\$A=\\var{testmatrix}\$

\n

\n

", "type": "question", "functions": {"rref": {"parameters": [["a", "list"], ["p", "number"]], "language": "javascript", "type": "list", "definition": "\nfunction findinv(a,q){\n var s=0;\n for(var j=1;j=ind?temp.push(getRandomInt(1,max)):temp.push(0);\n }\n for(var k=0;k');\nvar n=matrix_list.length;\nvar m='';\nvar mess='';\nfor(var i=0;i'+mess+'');\ntable.append('');\ntable.append(''+m+''); \n}\nreturn table;\n"}, "rref1": {"parameters": [["m", "list"]], "language": "javascript", "type": "list", "definition": "function finish() {\n for(var i=0;iReduce a 5x6 matrix to row reduced form and using this find rank and nullity.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"prompt": "

\n

\$R= \$[[0]]

\n

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

\n

\n

", "customMarkingAlgorithm": "", "sortAnswers": false, "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "useCustomName": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "gaps": [{"numRows": "6", "customMarkingAlgorithm": "", "showFeedbackIcon": true, "numColumns": "5", "correctAnswer": "{echmatrix}", "marks": "4", "markPerCell": false, "variableReplacements": [], "showCorrectAnswer": true, "unitTests": [], "useCustomName": false, "correctAnswerFractions": true, "type": "matrix", "variableReplacementStrategy": "originalfirst", "customName": "", "scripts": {}, "allowResize": false, "extendBaseMarkingAlgorithm": true, "allowFractions": true, "tolerance": 0}], "type": "gapfill", "showCorrectAnswer": true, "customName": "", "scripts": {}, "extendBaseMarkingAlgorithm": true}, {"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

(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

", "preamble": {"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