[npl] / trunk / NationalProblemLibrary / ASU-topics / set119MatrixAlgebra / p10.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/ASU-topics/set119MatrixAlgebra/p10.pg

Wed Feb 22 20:38:15 2006 UTC (7 years, 3 months ago) by jjholt
File size: 1455 byte(s)
Tags as of Feb 22, 2006.
--JH


    1 ## DESCRIPTION
2 ## Matrix Algebra
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('Algebra' 'Matrix' 'Matrices')
6 ## Tagged by tda2d
7
8 ## DBsubject('Algebra')
9 ## DBchapter('Linear Algebra')
10 ## DBsection('Matrix Algebra')
11 ## Date('')
12 ## Author('')
13 ## Institution('ASU')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19
20 DOCUMENT() ;
21
23 "PGasu.pl",
24 "PG.pl",
25 "PGbasicmacros.pl",
26 "PGchoicemacros.pl",
28 "PGauxiliaryFunctions.pl",
29 "PGdiffeqmacros.pl",
30 "PGmatrixmacros.pl"
31 ) ;
32 ############
33
34 TEXT(&beginproblem);
35
36
37 foreach $i (0..2) { 38 39 foreach$j (0..2) {
40       $a[$i][$j] = random(-4,4,1); 41$b[$i][$j] = random(-4,4,1);
42     }
43 }
44
45
46 $showPartialCorrectAnswers = 1 ; 47 48 BEGIN_TEXT 49 50 If 51 $A = \left[\begin{array}{ccc} 52 \{join("& ",@{a[0]}[0..#{a[0]}])\} \cr 53 \{join("& ",@{a[1]}[0..#{a[1]}])\} \cr 54 \{join("& ",@{a[2]}[0..#{a[2]}])\} \cr 55 \end{array}\right] 56 \mbox{ \ \ and \ \ \ } 57 B = \left[\begin{array}{ccc} 58 \{join("& ",@{b[0]}[0..#{b[0]}])\} \cr 59 \{join("& ",@{b[1]}[0..#{b[1]}])\} \cr 60 \{join("& ",@{b[2]}[0..#{b[2]}])\} \cr 61 \end{array}\right], 62$ 63 64 then 65 66$BCENTER
67 \{ mbox(
68 '$$3A-B =$$',
69 display_matrix([[ans_rule(5),ans_rule(5),ans_rule(5)],
70 [ans_rule(5),ans_rule(5),ans_rule(5)],
71 [ans_rule(5),ans_rule(5),ans_rule(5)]],
72 'align'=>"ccc"))
73 \}
74 $ECENTER 75 END_TEXT 76 foreach$i (0..2) {
77
78    foreach $j (0..2) { 79 ANS(num_cmp(3*$a[$i][$j] -$b[$i][\$j])  );
80     }
81 }
82
83
84
85 ENDDOCUMENT() ;
86