Testing commutativity of matrix multiplication
July 17, 1987
Let's show by example that matrix multiplication is not commutative. and let's keep a log of our work as we go along, having in mind that we want to print the finished document, and also mail it to someone. Using CaminoReal's mathematical expression editor, let's enter the product of two general 2 x 2 matrices.
When the editor first comes up, I see a placeholder, which is to be replaced by some expression. I select the placeholder, and using pop up menus, specify that I want to replace it by a 2 x 2 matrix.
The matrix elements are initialized to zero. I now select each element of the matrix and replace it by the indeterminate I want. To get a product, I select the matrix and wrap it with a multipliicatiion template by typing an asterisk. I then replace the new placeholder by copying in the existing matrix, and modifying its elements appropriately
X
Now I've got something I want to put into the document. Let me get an internal memo document template:
Using the next key, I fill in the standard fields, and begin my text. Now let's place the expression in the document:
Now let's get its value and put that in the document. I make it the current selection, and hit a button that says evaluate in place:
X
and put in the document.
Now I put in some more text "Now consider the product in the opposite order". Using CR's Undo button, I back up to the unevaluated expression, and then using CR's swap command, I exchange them.
Put this in the doc.
X
I'll do this evaluation in a different way; Tioga, i.e. textually, copy the expression, and hit a CR button which says eval selection in place.
X
Now let's check equality of the matrices. I select the second product in my CR tool, hit the = key to wrap an equality template qround it, and replace the new placeholder by bringing in the first product. I do the equality check by selecting the entire expression and htting EvalInPlace.
Let's note in our document that direct check yields false.
Now let's determine the conditions under which equality does hold, i.e. the conditions such that multiplication IS commutative. Let me subtract the first product from the second and set equal to zero (select left, wrap -, set new placeholder to 0, swap with right). I now evaluate the new left hand side.
X
Let's put this result into our document. I have an idea, which I'll type directly into the document: """Let's try solving the two equations in the first row for a and b in terms of the other indeterminates""" I plan to use the SMP computer algebra system to do the solving; first I need to push the =0 into the matrix, i.e. get a matrix of equations. I have SMP set up to push equality over lists, so by just having SMP evaluate the expression, I'll get the equations. To do this, I sect the expression and left click the "Algebra" button to pass it to SMP (middle clicking the Algebra button would pass it to Reduce). SMP is running on a Sun workstation on our local network, I exchange data with it by file transfers; the TerminalIO window at the lower right of my screen keeps me informed about the progress of the transfers.
X
Let me get a new CR viewer to build the SMP command I want:
X
I extract the solution expressions I want, place them in the document, and put in my final text. The document is now finished, and I can print it.
Let's suppose that I want to pass the document to the recipient by mailing it to him. The Cedar computer mail system is called Walnut; it maintains a database of message sets. To do the send, I get a message template, fill in the standard fields, copy in the document, and send. Within a few minutes, it will appear in my Active messageset. I open is as I would any message, and provided that CaminoReal is loaded, I see the math.