WeBWorK Problems

product of elementary matrices

product of elementary matrices

by Nandor Sieben -
Number of replies: 3
Is there a pg file out there that asks for writing an invertible matrix as a product of elementary matrices? I can't find any in the OPL.
In reply to Nandor Sieben

Re: product of elementary matrices

by Nandor Sieben -
I assume this can be done with MultiAnswer in parserMultiAnswer.pl and Matrix math objects. I tried to find some similar examples in the OPL. I loooked at the diagonalization problems because that problem is somewhat similar but unfortunately I couldn't find one that uses Matrix math objects. 

Are matrix math objects used at all in the OPL? Could someone recommend me a good example.

An ideal simple example would be a math object version of a problem that generates a random matrix A and asks for (using MultiAnswer) two non-identity matrices B and C satisfying A=BC.
In reply to Nandor Sieben

Re: product of elementary matrices

by Paul Pearson -
Hi Nandor,

I do not have time right now to modify the example below to suit your needs, but you should be able to make the modifications yourself without too much effort. I have been working on updating the OPL linear algebra questions to use MathObjects, but things are still in development and beta testing.

(Nota: it may be possible to replace $multians->ans_array(2,2,5) with $multians->ans_array(5).)

Best regards,

Paul Pearson

## Linear Algebra

## KEYWORDS('linear algebra','matrix','multiplication')
## Tagged by cmd6a 5/3/06

## DBsubject(Linear algebra)
## DBchapter('Matrices')
## DBsection(Matrix algebra)
## Date('July 2013')
## Author('Paul Pearson')
## Institution('Hope College')
## TitleText1('Linear Algebra with Applications')
## AuthorText1('Jeffrey Holt')
## EditionText1('1')
## Section1('3.2')
## Problem1('')

$showPartialCorrectAnswers = 0;


$A = Matrix([[0,1],[0,0]]);
$B = Matrix([[0,1],[0,0]]);
$Z = Matrix([[0,0],[0,0]]);

$multians = MultiAnswer($A, $B)->with(
singleResult => 1,
checker => sub {
my ( $correct, $student, $self ) = @_;
my @s = @{$student};
my @c = @{$correct};
$s0 = Matrix($s[0]); $s1 = Matrix($s[1]);
return 0 if $s0 == $Z or $s1 == $Z;
return $s0 * $s1 == $Z;

Give an example of two \( 2 \times 2 \) matrices \( A \) and \( B \),
neither of which is the zero matrix \( \mathbf{0} \),
such that \( AB = \mathbf{0} \).
\( A = \)
\{ $multians->ans_array(2,2,5) \}
\( B = \)
\{ $multians->ans_array(2,2,5) \}


ANS( $multians->cmp() );

COMMENT('MathObject version.');