I have written several problems that require the students to multiply two partitioned matrices, and then solve a matrix equation for the matrix components. The material is in Lay/Lay/McDonald in section 2.4.
I am struggling to make the problem "natural". That is to make the way the problem is coded, the problem is presented, the solutions are entered by students, and the answers are checked in ways that are not contrived. Maybe it is too much for me to want all of that.
The key issue for me is that the answer checker allows answers that are commutations of the correct answer.
At the bottom is my current code, which has the students enter their solutions in a contrived way. That is, they enter something like AinvB for A^(-1)B, where AinvB is a variable name.
Here are the various problems I have run into and the solutions I have tried.
1) Following the problem Library/WHFreeman/Holt_linear_algebra/Chaps_1-4/3.3.51.pg and webpage http://webwork.maa.org/wiki/Matrix_(MathObject_Class)#.WdUXFVtSzIU
I tried making the matrices A, B, C, X, Y, Z and I matrix constants instead of real variables. But then I cannot create the matrices $M, $N and $Q because WeBWorK expects real numbers for matrices.
2) There is no variable type Matrix in the contexts, and so I can't make A, B, C, ... Matrix variables (such as Context()->variables->add(A => "Matrix",...).
3) Some of the issue could be resolved if I didn't use variables for displaying the matrix multiplication. And so I tried the code here for displaying the matrices, but that makes changing the problem with different $M, $N, $Q cumbersome and doesn't resolve the problem of asking for the answer of the multiplication as a matrix. I want that intermediate step of students entering the product so that they have a halfway point to know if they are right or not and to help them learn how to do the problem.
A & B\\
C & 0
I & 0\\
X & Y
0 & I\\
Z & 0
4) The other thing I could do, but haven't tried, its to use TeX code to display all matrices and to ask for the product matrix components one-by-one instead of giving the student a matrix to fill in. I will do that if I have to, but I am hoping for a different solution.
DOCUMENT(); # This should be the first executable line in the problem.
Context()->variables->add(A => "Real",
B => "Real",
C => "Real",
X => "Real",
Y => "Real",
Z => "Real",
I => "Real",
BX => "Real",
BY => "Real",
$M = Matrix( [[A,B],[C,0]]);
$N = Matrix( [[I,0],[X,Y]]);
$Q = Matrix( [[0,I],[Z,0]]);
$LHS = Matrix( [["A + BX","BY"],[C,0]]);
$Xans = Compute("-BinvA");
$Yans = Compute("Binv");
$Zans = Compute("C");
$showPartialCorrectAnswers = 1;
Perform the following matrix operation:
1) Assume the matricesand are sized in such a way as to make the block matrix product below make sense.$BR
Consider the equation.
$BBOLD Note: $EBOLD Enter matrix multiplication without parentheses, without *, and without spaces. For example, to enter the multiplication ofand , write "MN" instead of "M*N" or "M N" or "(M)(N)", without the quote marks, of course.
$BBOLD Note: $EBOLD Enter matrix inverses by putting "inv" after the name. For example, to enterwrite "Minv", and to enter write "MinvN", without the quote marks.$BR$HR
Compute the product on the left-hand side to get this equation.
Now, solve for each matrix below in terms ofand , making the necessary assumptions about invertibility.