Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
92 lines (65 sloc) 1.28 KB
## DESCRIPTION
## Answer is a matrix
## ENDDESCRIPTION
## DBsubject(WeBWorK)
## DBchapter(WeBWorK tutorial)
## DBsection(Fort Lewis tutorial 2011)
## Date(06/30/2014)
## Institution(Hope College)
## Author(Paul Pearson)
## MO(1)
## KEYWORDS('matrix')
##################
# Initialization
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"PGcourse.pl"
);
TEXT(beginproblem());
##################
# Setup
Context("Matrix");
$A = Matrix([
[random(-5,5,1),random(-5,5,1),random(-5,5,1)],
[random(-5,5,1),random(-5,5,1),random(-5,5,1)],
]);
$B = Matrix([
[random(-5,5,1),random(-5,5,1),random(-5,5,1)],
[random(-5,5,1),random(-5,5,1),random(-5,5,1)],
]);
$answer = $A * ($B->transpose);
##################
# Main text
Context()->texStrings;
BEGIN_TEXT
Suppose
\[
A = $A
\ \ \mbox{and} \ \
B = $B.
\]
Evaluate the following matrix product.
$BR
$BR
\( A B^T = \)
\{ $answer->ans_array(5) \}
\{ AnswerFormatHelp("matrices") \}
END_TEXT
Context()->normalStrings;
########################
# Answer evaluation
$showPartialCorrectAnswers = 1;
ANS( $answer->cmp() );
########################
# Solution
Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;
;
ENDDOCUMENT();
You can’t perform that action at this time.