## DESCRIPTION ## Answer is a matrix ## ENDDESCRIPTION ## DBsubject(WeBWorK) ## DBchapter(WeBWorK tutorial) ## DBsection(PGML tutorial 2015) ## Date(06/01/2015) ## Institution(Hope College) ## Author(Paul Pearson) ## MO(1) ## KEYWORDS('matrix') ################## # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "PGML.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "parserMultiAnswer.pl", "scaffold.pl", "PGcourse.pl", ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; ################## # 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)], ]); ########################################### # The scaffold Scaffold::Begin(can_open => "when_previous_correct", is_open => "correct_or_first_incorrect"); ########################################### Section::Begin("Part 1: Identify correct dimension");$nrows_ans = 2; $ncols_ans = 2; BEGIN_PGML Suppose >> [A = [$A] \ \ \mbox{and} \ \ B = [$B]. ] << Evaluate the following matrix product. Detemine [n] and [m] such that [ A B^T \in M_{n\times m}] [n= ][__]{$nrows_ans} [m= ][__]{$ncols_ans} [@ AnswerFormatHelp("numbers") @]* END_PGML BEGIN_PGML_SOLUTION Solution goes here. END_PGML_SOLUTION Section::End(); ########################################### Section::Begin("Part 2: Evaluate the product");$answer = $A * ($B->transpose); BEGIN_PGML [ A B^T = ][_____]*{\$answer} [@ AnswerFormatHelp("matrices") @]* END_PGML BEGIN_PGML_SOLUTION Solution goes here. END_PGML_SOLUTION Section::End(); ########################################### Scaffold::End(); ENDDOCUMENT();