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

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

Wed Feb 22 20:38:15 2006 UTC (7 years, 2 months ago) by jjholt
File size: 1404 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 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "PGauxiliaryFunctions.pl",
28 "PGdiffeqmacros.pl",
29
30 ) ;
31 ############
32
33 TEXT(&beginproblem);
34
35
36 foreach $i (0..1) { 37 38 foreach$j (0..2) {
39       $a[$i][$j] = random(-4,4,1); 40$b[$i][$j] = random(-4,4,1);
41     }
42 }
43
44 foreach $i (0..1) { 45 46 foreach$j (0..2) {
47       $c[$i][$j] =$a[$i][$j]+$b[$i][$j]; 48 49 } 50 } 51 52$showPartialCorrectAnswers = 1 ;
53
54 BEGIN_TEXT
55 Determine $$x$$ and $$y$$ such that
56
57 $58 \left[\begin{array}{ccc} 59 \{join("& ",@{a[0]}[0..#{a[0]}])\} \cr 60 \{join("& ",@{a[1]}[0..#{a[1]}])\} 61 \end{array}\right] 62 + \left[\begin{array}{ccc} 63 x-y & b[0][1] & b[0][2] \\ 64 b[1][0] & x & b[1][2] 65 \end{array} \right] 66 = \left[\begin{array}{ccc} 67 c[0][0] & c[0][1] & c[0][2] \\ 68 c[1][0] & 2 x +y & c[1][2] 69 \end{array}\right] 70$
71
72 $BR 73 $$x =$$$SPACE  \{ ans_rule(10) \}
74 $BR 75 $$y =$$$SPACE \{ans_rule(10) \}
76
77
78 END_TEXT
79
80
81 $x=($b[0][0]+$a[1][1])/2; 82$y=($a[1][1]-$b[0][0])/2;
83 ANS(num_cmp($x)); 84 ANS(num_cmp($y));
85
86 ENDDOCUMENT() ;