################################################################################ # Initialization ################################################################################ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", ); TEXT(beginproblem()); ################################################################################ # Problem Setup ################################################################################ Context("Matrix"); Context()->noreduce('(-x)-y'); Context()->noreduce('(-x)-y','(-x)+y'); $A = Matrix([[random(-4,-2),random(5,8)],[random(-9,-2),random(1,3)]]); $d = random(2,3); $At = $A->transpose; Context("LimitedFraction"); Context()->flags->set(showMixedNumbers=>0); Context()->parens->set("[" => {formMatrix => 1}); @badops = ('+','-','*',' *','* ','^','**'); foreach $bad (@badops) { Context()->operators->undefine($bad); Context()->{error}{msg}{"Can't use '$bad' in this context"} = "Each entry must be a fully computed and reduced number"; } $At = Matrix([[Fraction($At->element(1,1),$d),Fraction($At->element(1,2),$d)],[Fraction($At->element(2,1),$d),Fraction($At->element(2,2),$d)]]); ################################################################################ # Text ################################################################################ BEGIN_PGML Use the matrix [`\quad A = [$A] \quad`] to compute the indicated operation. a. [`\dfrac{1}{[$d]} A^T = `] [@ $At->ans_array @]*** b. Coming soon END_PGML ################################################################################ # Answers and Solutions ################################################################################ ANS($At->cmp()); ENDDOCUMENT();