// Numbas version: finer_feedback_settings {"name": "Inverse algorithm calculator", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Inverse algorithm calculator", "tags": ["algorithm", "explore mode", "inverse matrix", "Linear algebra", "Linear Algebra", "linear algebra", "tool"], "metadata": {"description": "

Educational calculation tool rather than \"question\".

\n

This allows the student to input a square matrix (max rows 5). Then the student can decide to swap some rows, or multiply some rows, or add multiples of one row to other rows. The student only has to input what operation should be performed, and this is automatically applied to the matrix and the identity matrix (or what it has got to). This question has no marks and no feedback as it's just meant as a \"calculator\". It has some checks in so students know when they are not entering a square matrix or a valid row number etc.

\n

It has some rounding to 13 decimal places, as otherwise some fraction calculations become incorrectly displayed as a very small number instead of 0.

\n

It would be possible to extend to more than 5 rows, one just has to put in a lot more variables and so on. I just had to choose some place to stop.

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

Type in a matrix you would like to use the inverse algorithm on, and then say which row operations you would like to do. These will then be calculated for you, on the matrix and on the identity matrix next to it. You can choose the size of your matrix: in this implementation only up to 5 rows/columns.

\n

As there are no \"correct answers\", nothing will be marked, but you will have to submit each part in order to continue. If you click on \"reveal answers\", you will see all steps you have gone through listed (you may have to click back in the menu). You can use the navigation at the top to go back to previous parts if you want to take a different route.

", "advice": "

You can see all your steps above. You may have to click back through the parts in the menu.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"matrix_A": {"name": "matrix_A", "group": "the system", "definition": "matrix([0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0])", "description": "

Matrix that will take the values of what the students enter for their linear system. This is just the side on the left: augmentation vector is separate.

", "templateType": "anything", "can_override": false}, "augmentation_b": {"name": "augmentation_b", "group": "the system", "definition": "id(5)", "description": "

This will be the right hand side of the algorithm, starting off with the identity matrix. It will update from the student's calculation steps.

", "templateType": "anything", "can_override": false}, "row1multiplier": {"name": "row1multiplier", "group": "Calculating mutiples of rows", "definition": "1", "description": "

number to multiply row 1 by.

", "templateType": "anything", "can_override": false}, "row2multiplier": {"name": "row2multiplier", "group": "Calculating mutiples of rows", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "row3multiplier": {"name": "row3multiplier", "group": "Calculating mutiples of rows", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "row4multiplier": {"name": "row4multiplier", "group": "Calculating mutiples of rows", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "row5multiplier": {"name": "row5multiplier", "group": "Calculating mutiples of rows", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "first_row_being_changed": {"name": "first_row_being_changed", "group": "Calculating row additions", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "second_row_being_changed": {"name": "second_row_being_changed", "group": "Calculating row additions", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "third_row_being_changed": {"name": "third_row_being_changed", "group": "Calculating row additions", "definition": "4", "description": "", "templateType": "anything", "can_override": false}, "fourth_row_being_changed": {"name": "fourth_row_being_changed", "group": "Calculating row additions", "definition": "5", "description": "", "templateType": "anything", "can_override": false}, "lambda1": {"name": "lambda1", "group": "Calculating row additions", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "lambda2": {"name": "lambda2", "group": "Calculating row additions", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "lambda3": {"name": "lambda3", "group": "Calculating row additions", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "lambda4": {"name": "lambda4", "group": "Calculating row additions", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "remultiplied_A": {"name": "remultiplied_A", "group": "Calculating mutiples of rows", "definition": "precround(switch(numrows(matrix_A)=1,matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0]),\n numrows(matrix_A)=2,matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0],if(isnan(row2multiplier),1,row2multiplier)*matrix_A[1]),\n numrows(matrix_A)=3,matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0],if(isnan(row2multiplier),1,row2multiplier)*matrix_A[1],if(isnan(row3multiplier),1,row3multiplier)*matrix_A[2]),\n numrows(matrix_A)=4,matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0],if(isnan(row2multiplier),1,row2multiplier)*matrix_A[1],if(isnan(row3multiplier),1,row3multiplier)*matrix_A[2],if(isnan(row4multiplier),1,row4multiplier)*matrix_A[3]),\n numrows(matrix_A)=5,matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0],if(isnan(row2multiplier),1,row2multiplier)*matrix_A[1],if(isnan(row3multiplier),1,row3multiplier)*matrix_A[2],if(isnan(row4multiplier),1,row4multiplier)*matrix_A[3],if(isnan(row5multiplier),1,row5multiplier)*matrix_A[4]),\n matrix(if(isnan(row1multiplier),1,row1multiplier)*matrix_A[0],if(isnan(row2multiplier),1,row2multiplier)*matrix_A[1],if(isnan(row3multiplier),1,row3multiplier)*matrix_A[2],if(isnan(row4multiplier),1,row4multiplier)*matrix_A[3],if(isnan(row5multiplier),1,row5multiplier)*matrix_A[4])),13)", "description": "

changed matrix A after multiplying rows. It takes into account possible different sizes of the matrix. Up to 5 rows.

", "templateType": "anything", "can_override": false}, "remultiplied_b": {"name": "remultiplied_b", "group": "Calculating mutiples of rows", "definition": "precround(switch(numrows(augmentation_b)=1,matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0]),\n numrows(augmentation_b)=2,matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0],if(isnan(row2multiplier),1,row2multiplier)*augmentation_b[1]),\n numrows(augmentation_b)=3,matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0],if(isnan(row2multiplier),1,row2multiplier)*augmentation_b[1],if(isnan(row3multiplier),1,row3multiplier)*augmentation_b[2]),\n numrows(augmentation_b)=4,matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0],if(isnan(row2multiplier),1,row2multiplier)*augmentation_b[1],if(isnan(row3multiplier),1,row3multiplier)*augmentation_b[2],if(isnan(row4multiplier),1,row4multiplier)*augmentation_b[3]),\n numrows(augmentation_b)=5,matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0],if(isnan(row2multiplier),1,row2multiplier)*augmentation_b[1],if(isnan(row3multiplier),1,row3multiplier)*augmentation_b[2],if(isnan(row4multiplier),1,row4multiplier)*augmentation_b[3],if(isnan(row5multiplier),1,row5multiplier)*augmentation_b[4]),\n matrix(if(isnan(row1multiplier),1,row1multiplier)*augmentation_b[0],if(isnan(row2multiplier),1,row2multiplier)*augmentation_b[1],if(isnan(row3multiplier),1,row3multiplier)*augmentation_b[2],if(isnan(row4multiplier),1,row4multiplier)*augmentation_b[3],if(isnan(row5multiplier),1,row5multiplier)*augmentation_b[4])),13)", "description": "

changed augmentation b after multiplying rows. It takes into account possible different sizes of the matrix. Up to 5 rows.

", "templateType": "anything", "can_override": true}, "readded_A_row1": {"name": "readded_A_row1", "group": "Calculating row additions", "definition": "switch(row_being_added=1,adding_step[0],first_row_being_changed=1,adding_step[1],second_row_being_changed=1,adding_step[2],third_row_being_changed=1,adding_step[3],fourth_row_being_changed=1,adding_step[4],matrix_A[0])", "description": "", "templateType": "anything", "can_override": false}, "adding_step": {"name": "adding_step", "group": "Calculating row additions", "definition": "matrix(matrix_A[row_being_added-1],matrix_A[first_row_being_changed-1]+lambda1*matrix_A[row_being_added-1],matrix_A[second_row_being_changed-1]+lambda2*matrix_A[row_being_added-1],matrix_A[third_row_being_changed-1]+lambda3*matrix_A[row_being_added-1],matrix_A[fourth_row_being_changed-1]+lambda4*matrix_A[row_being_added-1])", "description": "

recalculating the rows of the matrix, but they are now potentially in the wrong order.

", "templateType": "anything", "can_override": false}, "row_being_added": {"name": "row_being_added", "group": "Calculating row additions", "definition": "1", "description": "", "templateType": "anything", "can_override": false}, "readded_A_row2": {"name": "readded_A_row2", "group": "Calculating row additions", "definition": "switch(row_being_added=2,adding_step[0],first_row_being_changed=2,adding_step[1],second_row_being_changed=2,adding_step[2],third_row_being_changed=2,adding_step[3],fourth_row_being_changed=2,adding_step[4],matrix_A[1])", "description": "", "templateType": "anything", "can_override": false}, "readded_A_row3": {"name": "readded_A_row3", "group": "Calculating row additions", "definition": "switch(row_being_added=3,adding_step[0],first_row_being_changed=3,adding_step[1],second_row_being_changed=3,adding_step[2],third_row_being_changed=3,adding_step[3],fourth_row_being_changed=3,adding_step[4],matrix_A[2])", "description": "", "templateType": "anything", "can_override": false}, "readded_A_row4": {"name": "readded_A_row4", "group": "Calculating row additions", "definition": "switch(row_being_added=4,adding_step[0],first_row_being_changed=4,adding_step[1],second_row_being_changed=4,adding_step[2],third_row_being_changed=4,adding_step[3],fourth_row_being_changed=4,adding_step[4],matrix_A[3])", "description": "", "templateType": "anything", "can_override": false}, "readded_A_row5": {"name": "readded_A_row5", "group": "Calculating row additions", "definition": "switch(row_being_added=5,adding_step[0],first_row_being_changed=5,adding_step[1],second_row_being_changed=5,adding_step[2],third_row_being_changed=5,adding_step[3],fourth_row_being_changed=5,adding_step[4],matrix_A[4])", "description": "", "templateType": "anything", "can_override": false}, "readded_A": {"name": "readded_A", "group": "Calculating row additions", "definition": "precround(switch(numrows(matrix_A)=1,matrix(readded_A_row1),\n numrows(matrix_A)=2,matrix(readded_A_row1,readded_A_row2),\n numrows(matrix_A)=3,matrix(readded_A_row1,readded_A_row2,readded_A_row3),\n numrows(matrix_A)=4, matrix(readded_A_row1,readded_A_row2,readded_A_row3,readded_A_row4),\n numrows(matrix_A)=5, matrix(readded_A_row1,readded_A_row2,readded_A_row3,readded_A_row4,readded_A_row5),\n matrix(readded_A_row1,readded_A_row2,readded_A_row3,readded_A_row4,readded_A_row5)),13)", "description": "

Putting together the new rows of matrix A in the right order after some row additions. Takes into account different sizes.

", "templateType": "anything", "can_override": false}, "readded_b": {"name": "readded_b", "group": "Calculating row additions", "definition": "precround(switch(numrows(augmentation_b)=1, matrix(readded_b_row1),\n numrows(augmentation_b)=2,matrix(readded_b_row1,readded_b_row2),\n numrows(augmentation_b)=3, matrix(readded_b_row1,readded_b_row2,readded_b_row3),\n numrows(augmentation_b)=4, matrix(readded_b_row1,readded_b_row2,readded_b_row3,readded_b_row4),\n numrows(augmentation_b)=5,matrix(readded_b_row1,readded_b_row2,readded_b_row3,readded_b_row4,readded_b_row5),\n matrix(readded_b_row1,readded_b_row2,readded_b_row3,readded_b_row4,readded_b_row5)),13)", "description": "

Putting together the new rows of augmentation b in the right order after some row additions. Takes into account different sizes.

", "templateType": "anything", "can_override": false}, "adding_step_b": {"name": "adding_step_b", "group": "Calculating row additions", "definition": "matrix(augmentation_b[row_being_added-1],augmentation_b[first_row_being_changed-1]+lambda1*augmentation_b[row_being_added-1],augmentation_b[second_row_being_changed-1]+lambda2*augmentation_b[row_being_added-1],augmentation_b[third_row_being_changed-1]+lambda3*augmentation_b[row_being_added-1],augmentation_b[fourth_row_being_changed-1]+lambda4*augmentation_b[row_being_added-1])", "description": "", "templateType": "anything", "can_override": false}, "readded_b_row1": {"name": "readded_b_row1", "group": "Calculating row additions", "definition": "switch(row_being_added=1,adding_step_b[0],first_row_being_changed=1,adding_step_b[1],second_row_being_changed=1,adding_step_b[2],third_row_being_changed=1,adding_step_b[3],fourth_row_being_changed=1,adding_step_b[4],augmentation_b[0])", "description": "", "templateType": "anything", "can_override": false}, "readded_b_row2": {"name": "readded_b_row2", "group": "Calculating row additions", "definition": "switch(row_being_added=2,adding_step_b[0],first_row_being_changed=2,adding_step_b[1],second_row_being_changed=2,adding_step_b[2],third_row_being_changed=2,adding_step_b[3],fourth_row_being_changed=2,adding_step_b[4],augmentation_b[1])", "description": "", "templateType": "anything", "can_override": false}, "readded_b_row3": {"name": "readded_b_row3", "group": "Calculating row additions", "definition": "switch(row_being_added=3,adding_step_b[0],first_row_being_changed=3,adding_step_b[1],second_row_being_changed=3,adding_step_b[2],third_row_being_changed=3,adding_step_b[3],fourth_row_being_changed=3,adding_step_b[4],augmentation_b[2])", "description": "", "templateType": "anything", "can_override": false}, "readded_b_row4": {"name": "readded_b_row4", "group": "Calculating row additions", "definition": "switch(row_being_added=4,adding_step_b[0],first_row_being_changed=4,adding_step_b[1],second_row_being_changed=4,adding_step_b[2],third_row_being_changed=4,adding_step_b[3],fourth_row_being_changed=4,adding_step_b[4],augmentation_b[3])", "description": "", "templateType": "anything", "can_override": false}, "readded_b_row5": {"name": "readded_b_row5", "group": "Calculating row additions", "definition": "switch(row_being_added=5,adding_step_b[0],first_row_being_changed=5,adding_step_b[1],second_row_being_changed=5,adding_step_b[2],third_row_being_changed=5,adding_step_b[3],fourth_row_being_changed=5,adding_step_b[4],augmentation_b[4])", "description": "", "templateType": "anything", "can_override": false}, "new1strow": {"name": "new1strow", "group": "Switching rows", "definition": "1", "description": "

For switching rows.

", "templateType": "anything", "can_override": false}, "new2ndrow": {"name": "new2ndrow", "group": "Switching rows", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "new3rdrow": {"name": "new3rdrow", "group": "Switching rows", "definition": "3", "description": "", "templateType": "anything", "can_override": false}, "new5throw": {"name": "new5throw", "group": "Switching rows", "definition": "5", "description": "", "templateType": "anything", "can_override": false}, "new4throw": {"name": "new4throw", "group": "Switching rows", "definition": "4", "description": "", "templateType": "anything", "can_override": false}, "swapped_rows_A": {"name": "swapped_rows_A", "group": "Switching rows", "definition": "switch(numrows(matrix_A)=1, matrix(matrix_A[0]),\n numrows(matrix_A)=2,matrix(matrix_A[if(isnan(new1strow),1,new1strow)-1],matrix_A[if(isnan(new2ndrow),2,new2ndrow)-1]),\n numrows(matrix_A)=3,matrix(matrix_A[if(isnan(new1strow),1,new1strow)-1],matrix_A[if(isnan(new2ndrow),2,new2ndrow)-1],matrix_A[if(isnan(new3rdrow),3,new3rdrow)-1]),\n numrows(matrix_A)=4, matrix(matrix_A[if(isnan(new1strow),1,new1strow)-1],matrix_A[if(isnan(new2ndrow),2,new2ndrow)-1],matrix_A[if(isnan(new3rdrow),3,new3rdrow)-1],matrix_A[if(isnan(new4throw),4,new4throw)-1]),\n numrows(matrix_A)=5,matrix(matrix_A[if(isnan(new1strow),1,new1strow)-1],matrix_A[if(isnan(new2ndrow),2,new2ndrow)-1],matrix_A[if(isnan(new3rdrow),3,new3rdrow)-1],matrix_A[if(isnan(new4throw),4,new4throw)-1],matrix_A[if(isnan(new5throw),5,new5throw)-1]),\n matrix(matrix_A[if(isnan(new1strow),1,new1strow)-1],matrix_A[if(isnan(new2ndrow),2,new2ndrow)-1],matrix_A[if(isnan(new3rdrow),3,new3rdrow)-1],matrix_A[if(isnan(new4throw),4,new4throw)-1],matrix_A[if(isnan(new5throw),5,new5throw)-1]))", "description": "

New matrix after swapping rows around.

", "templateType": "anything", "can_override": false}, "swapped_rows_b": {"name": "swapped_rows_b", "group": "Switching rows", "definition": "switch(numrows(augmentation_b)=1, matrix(augmentation_b[0]),\n numrows(augmentation_b)=2,matrix(augmentation_b[if(isnan(new1strow),1,new1strow)-1],augmentation_b[if(isnan(new2ndrow),2,new2ndrow)-1]),\n numrows(augmentation_b)=3,matrix(augmentation_b[if(isnan(new1strow),1,new1strow)-1],augmentation_b[if(isnan(new2ndrow),2,new2ndrow)-1],augmentation_b[if(isnan(new3rdrow),3,new3rdrow)-1]),\n numrows(augmentation_b)=4, matrix(augmentation_b[if(isnan(new1strow),1,new1strow)-1],augmentation_b[if(isnan(new2ndrow),2,new2ndrow)-1],augmentation_b[if(isnan(new3rdrow),3,new3rdrow)-1],augmentation_b[if(isnan(new4throw),4,new4throw)-1]),\n numrows(augmentation_b)=5,matrix(augmentation_b[if(isnan(new1strow),1,new1strow)-1],augmentation_b[if(isnan(new2ndrow),2,new2ndrow)-1],augmentation_b[if(isnan(new3rdrow),3,new3rdrow)-1],augmentation_b[if(isnan(new4throw),4,new4throw)-1],augmentation_b[if(isnan(new5throw),5,new5throw)-1]),\n matrix(augmentation_b[if(isnan(new1strow),1,new1strow)-1],augmentation_b[if(isnan(new2ndrow),2,new2ndrow)-1],augmentation_b[if(isnan(new3rdrow),3,new3rdrow)-1],augmentation_b[if(isnan(new4throw),4,new4throw)-1],augmentation_b[if(isnan(new5throw),5,new5throw)-1]))", "description": "", "templateType": "anything", "can_override": false}, "original_A": {"name": "original_A", "group": "Ungrouped variables", "definition": "matrix([0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": "100"}, "ungrouped_variables": ["original_A"], "variable_groups": [{"name": "the system", "variables": ["matrix_A", "augmentation_b"]}, {"name": "Calculating mutiples of rows", "variables": ["row1multiplier", "row2multiplier", "row3multiplier", "row4multiplier", "row5multiplier", "remultiplied_A", "remultiplied_b"]}, {"name": "Calculating row additions", "variables": ["row_being_added", "first_row_being_changed", "second_row_being_changed", "third_row_being_changed", "fourth_row_being_changed", "lambda1", "lambda2", "lambda3", "lambda4", "adding_step", "readded_A_row1", "readded_A_row2", "readded_A_row3", "readded_A_row4", "readded_A_row5", "readded_A", "adding_step_b", "readded_b_row1", "readded_b_row2", "readded_b_row3", "readded_b_row4", "readded_b_row5", "readded_b"]}, {"name": "Switching rows", "variables": ["new1strow", "new2ndrow", "new3rdrow", "new4throw", "new5throw", "swapped_rows_A", "swapped_rows_b"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Enter matrix", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "\nmark:\n apply(gap_feedback);\n assert(all_valid , fail(translate(\"question.can not submit\")));\n apply(answers)\n \n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Multiply some rows", "rawLabel": "", "otherPart": 3, "variableReplacements": [{"variable": "augmentation_b", "definition": "id(numrows(interpreted_answer[0]))"}, {"variable": "matrix_A", "definition": "interpreted_answer[0]"}, {"variable": "original_A", "definition": "interpreted_answer[0]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Add multiples of some row to other rows", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "augmentation_b", "definition": "id(numrows(interpreted_answer[0]))"}, {"variable": "matrix_A", "definition": "interpreted_answer[0]"}, {"variable": "original_A", "definition": "interpreted_answer[0]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Swap some rows", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "augmentation_b", "definition": "id(numrows(interpreted_answer[0]))"}, {"variable": "matrix_A", "definition": "interpreted_answer[0]"}, {"variable": "original_A", "definition": "interpreted_answer[0]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Finish", "rawLabel": "", "otherPart": 7, "variableReplacements": [{"variable": "augmentation_b", "definition": "id(numrows(interpreted_answer[0]))"}, {"variable": "matrix_A", "definition": "interpreted_answer[0]"}, {"variable": "original_A", "definition": "interpreted_answer[0]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Enter your matrix which you want to apply the inverse algorithm to. It needs to be a square matrix. The identity matrix of the same size will be added automatically in the next step for your calculations.

\n

[[0]]

", "gaps": [{"type": "matrix", "useCustomName": true, "customName": "Matrix A", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "nonsquare (Check if square matrix):\n assert(rows=cols,\n warn(\"You did not enter a square matrix.\");\n fail(\"You did not enter a square matrix.\");\n true\n )\n\nmark:\n apply(any_empty);\n apply(any_invalid);\n apply(nonsquare);\n assert(settings[\"precisionType\"]=\"none\" and not settings[\"allowFractions\"], apply(all_same_precision));\n correct(\"Your matrix input is valid.\")\n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix_A", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": "100", "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": "5", "minRows": 1, "maxRows": "5"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "Add multiples of some row to other rows", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "rownumber_valid:\n map(marked_original_order[k][\"values\"][\"invalid_rownumber\"]=false,k,[1]+list(2..len(gaps)-1#2))\n\nall_rownumbers:\n if(all(rownumber_valid)=true,\n correct(\"Your input is valid.\"),\n warn(\"You gave some invalid row numbers.\");\n fail(\"You gave some invalid row numbers.\")\n )\n\nmark:\n apply(all_rownumbers);\n apply(answers)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Calculate the additions", "rawLabel": "", "otherPart": 2, "variableReplacements": [{"variable": "lambda1", "definition": "interpreted_answer[0]"}, {"variable": "lambda2", "definition": "interpreted_answer[3]"}, {"variable": "lambda3", "definition": "interpreted_answer[5]"}, {"variable": "lambda4", "definition": "interpreted_answer[7]"}, {"variable": "row_being_added", "definition": "interpreted_answer[1]"}, {"variable": "first_row_being_changed", "definition": "interpreted_answer[2]"}, {"variable": "second_row_being_changed", "definition": "interpreted_answer[4]"}, {"variable": "third_row_being_changed", "definition": "interpreted_answer[6]"}, {"variable": "fourth_row_being_changed", "definition": "interpreted_answer[8]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Current status of your algorithm:

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b} \\right.\\]

\n

Enter what you would like to calculate. You can choose one row to add to one or more of the other rows. The entries in front of \"times\" can be fractions. You can leave blank any entries you don't need.

\n

You matrix only has one row, so there is no valid \"add a multiple of one row to another row\" operation.

\n

Add [[0]] times row [[1]] to row [[2]].
Add [[3]] times row [[1]] to row [[4]].
Add [[5]] times row [[1]] to row [[6]].
Add [[7]] times row [[1]] to row [[8]].

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "lambda1", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "-infinity", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "row being added", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "numrows(matrix_A)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "first row being changed", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "numrows(matrix_A)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "lambda2", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "-infinity", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "second row being changed", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "numrows(matrix_A)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "lambda3", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "-infinity", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "third row being changed", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "numrows(matrix_A)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "lambda4", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "-infinity", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "fourth row being changed", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1", "maxValue": "numrows(matrix_A)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "information", "useCustomName": true, "customName": "Calculate the additions", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Multiply some rows", "rawLabel": "", "otherPart": 3, "variableReplacements": [{"variable": "augmentation_b", "definition": "readded_b"}, {"variable": "matrix_A", "definition": "readded_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Add multiples of some row to other rows", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "augmentation_b", "definition": "readded_b"}, {"variable": "matrix_A", "definition": "readded_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Swap some rows", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "augmentation_b", "definition": "readded_b"}, {"variable": "matrix_A", "definition": "readded_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Finish", "rawLabel": "", "otherPart": 7, "variableReplacements": [{"variable": "augmentation_b", "definition": "readded_b"}, {"variable": "matrix_A", "definition": "readded_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You have gone from

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b}\\right.\\qquad \\text{to} \\qquad \\left.\\var[fractionNumbers]{readded_A} \\middle| \\var[fractionNumbers]{readded_b}\\right.\\]

"}, {"type": "gapfill", "useCustomName": true, "customName": "Multiply some rows", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Calculate the multiplications", "rawLabel": "", "otherPart": 4, "variableReplacements": [{"variable": "row1multiplier", "definition": "interpreted_answer[0]"}, {"variable": "row2multiplier", "definition": "interpreted_answer[1]"}, {"variable": "row3multiplier", "definition": "interpreted_answer[2]"}, {"variable": "row4multiplier", "definition": "interpreted_answer[3]"}, {"variable": "row5multiplier", "definition": "interpreted_answer[4]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Current status of your algorithm:

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b} \\right.\\]

\n

Enter what you would like to calculate.  You can enter fractions if you want. You can leave blank any entries you don't need (if you want that row to stay as it is).

\n

[[0]] times row 1.
[[1]] times row 2.
[[2]] times row 3.
[[3]] times row 4.
[[4]] times row 5.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "row1multiplier", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "row1multiplier", "maxValue": "row1multiplier", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "row2multiplier", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "row2multiplier", "maxValue": "row2multiplier", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "row3multiplier", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "row3multiplier", "maxValue": "row3multiplier", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "row4multiplier", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "row4multiplier", "maxValue": "row4multiplier", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "row5multiplier", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "row5multiplier", "maxValue": "row5multiplier", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "information", "useCustomName": true, "customName": "Calculate the multiplications", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Multiply some rows", "rawLabel": "", "otherPart": 3, "variableReplacements": [{"variable": "augmentation_b", "definition": "remultiplied_b"}, {"variable": "matrix_A", "definition": "remultiplied_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Add multiples of some row to other rows", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "augmentation_b", "definition": "remultiplied_b"}, {"variable": "matrix_A", "definition": "remultiplied_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Swap some rows", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "augmentation_b", "definition": "remultiplied_b"}, {"variable": "matrix_A", "definition": "remultiplied_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Finish", "rawLabel": "", "otherPart": 7, "variableReplacements": [{"variable": "augmentation_b", "definition": "remultiplied_b"}, {"variable": "matrix_A", "definition": "remultiplied_A"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You have gone from

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b}\\right.\\qquad \\text{to}  \\qquad\\left. \\var[fractionNumbers]{remultiplied_A} \\middle| \\var[fractionNumbers]{remultiplied_b}\\right.\\]

"}, {"type": "gapfill", "useCustomName": true, "customName": "Swap some rows", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "rownumber_valid:\n map(marked_original_order[k][\"values\"][\"invalid_rownumber\"]=false,k,list(0..len(gaps)-1))\n\nall_rownumbers:\n if(all(rownumber_valid) and len(interpreted_answers)=len(distinct(interpreted_answers)),\n correct(\"Your input is valid.\"),\n if(not(all(rownumber_valid)),\n warn(\"You gave some invalid row numbers.\");\n fail(\"You gave some invalid row numbers.\"),\n warn(\"You have repeated some row numbers: you will lose info.\");\n fail(\"You have repeated some row numbers: you will lose info.\")\n )\n )\n\nmark:\n apply(all_rownumbers);\n apply(answers)\n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Implement the swaps", "rawLabel": "", "otherPart": 6, "variableReplacements": [{"variable": "new1strow", "definition": "interpreted_answer[0]"}, {"variable": "new2ndrow", "definition": "interpreted_answer[1]"}, {"variable": "new3rdrow", "definition": "interpreted_answer[2]"}, {"variable": "new4throw", "definition": "interpreted_answer[3]"}, {"variable": "new5throw", "definition": "interpreted_answer[4]"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Current status of your algorithm:

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b} \\right.\\]

\n

Enter which rows you want to swap. So as not to lose information, make sure you don't enter any row number twice!

\n

You only have one row, so you can't swap any rows.

\n

Old row [[0]] becomes new row 1.
Old row [[1]] becomes new row 2.
Old row [[2]] becomes new row 3.
Old row [[3]] becomes new row 4.
Old row [[4]] becomes new row 5.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "new1strow", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "new1strow", "maxValue": "new1strow", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "new2ndrow", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "new2ndrow", "maxValue": "new2ndrow", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "new3rdrow", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "new3rdrow", "maxValue": "new3rdrow", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "new4throw", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "new4throw", "maxValue": "new4throw", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "new5throw", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "invalid_rownumber (Is this an invalid row number?):\n if(isNaN(studentNumber) or studentNumber in 1..numrows(matrix_A),false, true)\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(invalid_rownumber)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "new4throw", "maxValue": "new4throw", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "information", "useCustomName": true, "customName": "Implement the swaps", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Add multiples of some row to other rows", "rawLabel": "", "otherPart": 1, "variableReplacements": [{"variable": "matrix_A", "definition": "swapped_rows_A"}, {"variable": "augmentation_b", "definition": "swapped_rows_b"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Multiply some rows", "rawLabel": "", "otherPart": 3, "variableReplacements": [{"variable": "matrix_A", "definition": "swapped_rows_A"}, {"variable": "augmentation_b", "definition": "swapped_rows_b"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Swap some rows", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "matrix_A", "definition": "swapped_rows_A"}, {"variable": "augmentation_b", "definition": "swapped_rows_b"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Finish", "rawLabel": "", "otherPart": 7, "variableReplacements": [{"variable": "matrix_A", "definition": "swapped_rows_A"}, {"variable": "augmentation_b", "definition": "swapped_rows_b"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You have gone from

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b}\\right.\\qquad \\text{to}  \\qquad\\left. \\var[fractionNumbers]{swapped_rows_A} \\middle| \\var[fractionNumbers]{swapped_rows_b}\\right.\\]

"}, {"type": "information", "useCustomName": true, "customName": "Finish", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You are stopping at:

\n

\\[ \\left. \\var[fractionNumbers]{matrix_A} \\middle| \\var[fractionNumbers]{augmentation_b}\\right.\\]

\n

Your original matrix times the right-hand side is:

\n

\\[\\var[fractionNumbers]{original_A}\\var[fractionNumbers]{augmentation_b}=\\var[fractionNumbers]{original_A*augmentation_b}\\]

"}], "partsMode": "explore", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "andrew tonks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/522/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}]}], "contributors": [{"name": "andrew tonks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/522/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}