[npl] / branches / UGA / 4.4.2.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /branches/UGA/4.4.2.pg

Sat Jul 24 17:09:50 2010 UTC (2 years, 9 months ago) by ted shifrin
File size: 4850 byte(s)
Log message

    1 ## DESCRIPTION
2 ##   Fundamental Subspaces of a Matrix
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('Nullspace', 'Column space', 'Row space', 'Left nullspace')
6 ##
7
8 ## DBsubject('Calculus')
9 ## DBchapter('')
10 ## DBsection('')
11 ## Date('10/04/2009')
12 ## Author('Ted Shifrin')
13 ## Institution('UGA')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19
20 DOCUMENT(); # This should be the first executable line in the problem.
21
23            "PGbasicmacros.pl",
24            "PGchoicemacros.pl",
26            "PGauxiliaryFunctions.pl",
27            "PGmatrixmacros.pl",
28            "PGmorematrixmacros.pl",
29            "compoundProblem.pl",
30            "PGnumericalmacros.pl",
31           );
32
33
34 TEXT(beginproblem());
35 $showPartialCorrectAnswers = 1; 36 37$a = non_zero_random(-3, 3, 1);
38 $b = non_zero_random(-3, 3, 1); 39$c = non_zero_random(-3, 3, 1);
40 $d = non_zero_random(-3, 3, 1); 41$d1 = non_zero_random(-3, 3, 1);
42 $e = non_zero_random(-3, 3, 1); 43$f = non_zero_random(-3, 3, 1);
44 $i = non_zero_random(-1, 1, 2); 45$g = $e*$f+$i; 46$k = non_zero_random(-3, 3, 1);
47 $l = non_zero_random(-3, 3, 1); 48$m = non_zero_random(-3, 3, 1);
49 $n = non_zero_random(-3, 3, 1); 50 51 52$m11=1; $m12=$a; $m13=$e;  $m14=$b+$e*$d; $m15=$c+$e*$d1;
53 $m21=$f; $m22=$f*$a;$m23=$g;$m24=$f*$b+$g*$d; $m25=$f*$c+$g*$d1; 54$m31=$k;$m32=$k*$a; $m33=$l; $m34=$k*$b+$l*$d;$m35=$k*$c+$l*$d1;
55 $m41=$m; $m42=$m*$a;$m43=$n;$m44=$m*$b+$n*$d; $m45=$m*$c+$n*$d1; 56 57$LN11=-$k+$i*$f*($l-$e*$k);
58 $LN12=-$i*($l-$e*$k); 59$LN13=1;
60 $LN14=0; 61 62$LN21=-$m+$i*$f*($n-$e*$m);
63 $LN22=-$i*($n-$e*$m); 64$LN23=0;
65 $LN24=1; 66 67$isProfessor = ($studentLogin eq 'shifrin' ||$studentLogin eq 'test');
68
69 $cp = new compoundProblem( 70 parts=>2, 71 weights=>[.4,.6], 72 parserValues=>1, 73 allowReset =>$isProfessor,
74   nextVisible => 'Always',
75   nextStyle => 'Button',
76 );
77
78 $part =$cp->part;
79
80 if($part==1){ 81 BEGIN_TEXT 82 83 Consider the matrix 84 85 $A = \left[\begin{array}{r r r r r} 86 m11 & m12 & m13 & m14 & m15\cr 87 m21 & m22 & m23 & m24 & m25 \cr 88 m31 & m32 & m33 & m34 & m35 \cr 89 m41 & m42 & m43 & m44 & m45 90 \end{array} \right]\quad . 91$ 92 93$PAR
95 associated to $$A$$:
96 $PAR 97 $$\mathbf R(A)$$ is a subspace of $$\mathbb R^k$$ with $$k =$$ \{ans_rule(3)\}. 98$BR
99 $$\mathbf C(A)$$ is a subspace of $$\mathbb R^k$$ with $$k =$$ \{ans_rule(3)\}.
100 $BR 101 $$\mathbf N(A)$$ is a subspace of $$\mathbb R^k$$ with $$k =$$ \{ans_rule(3)\}. 102$BR
103 $$\mathbf N(A^T)$$ is a subspace of $$\mathbb R^k$$ with $$k =$$ \{ans_rule(3)\}.
104
105 $PAR 106 Give the reduced echelon form of $$A$$. 107$BR
109
110
111 $PAR 112 Give the dimension of each of the fundamental subspaces: 113$BR
114 dim $$\mathbf R(A) =$$ \{ ans_rule(5) \}
115 $BR 116 dim $$\mathbf C(A) =$$ \{ ans_rule(5) \} 117$BR
118 dim $$\mathbf N(A) =$$ \{ ans_rule(5) \}
119 $BR 120 dim $$\mathbf N(A^T) =$$ \{ ans_rule(5) \} 121$PAR
122
123 When you have answered all these questions correctly, click on the "Go on to next part" button.
124
125 END_TEXT
126
127 ANS(num_cmp(5)); ANS(num_cmp(4)); ANS(num_cmp(5)); ANS(num_cmp(4));
128
129 ANS(num_cmp(1)); ANS(num_cmp($a)); ANS(num_cmp(0)); ANS(num_cmp($b)); ANS(num_cmp($c)); 130 ANS(num_cmp(0)); ANS(num_cmp(0)); ANS(num_cmp(1)); ANS(num_cmp($d));
131 ANS(num_cmp($d1)); 132 ANS(num_cmp(0)); ANS(num_cmp(0)); ANS(num_cmp(0)); ANS(num_cmp(0)); 133 ANS(num_cmp(0)); 134 ANS(num_cmp(0)); ANS(num_cmp(0)); ANS(num_cmp(0)); ANS(num_cmp(0)); 135 ANS(num_cmp(0)); 136 137 ANS(num_cmp(2)); ANS(num_cmp(2)); ANS(num_cmp(3)); ANS(num_cmp(2)); 138 139 #$cp->useGrader(~~std_problem_grader);
140 }
141
142 if($part==2){ 143 BEGIN_TEXT 144 145 Recall the original matrix and your reduced echelon form: 146 147 $\hbox{ \[ A = \left[\begin{array}{r r r r r} 148 m11 & m12 & m13 & m14 & m15\cr 149 m21 & m22 & m23 & m24 & m25 \cr 150 m31 & m32 & m33 & m34 & m35 \cr 151 m41 & m42 & m43 & m44 & m45 152 \end{array} \right]}\quad \text{and} \quad \hbox{\left[\begin{array}{r r r r r} 153 1 & a & 0 & b & c\cr 154 0 & 0 & 1 & d & d1\cr 155 0 & 0 & 0 & 0 & 0\cr 156 0 & 0 & 0 & 0 & 0 157 \end{array} \right]}\quad . 158$ 159 160$PAR
161 Give bases for each of the four fundamental subspaces.
162 $BR 163 \{mbox('$$\mathbf R(A)$$:', ans_array(5,1,8),',', ans_array_extension(5,1,8) ) \} 164$BR
165 \{mbox( '$$\mathbf C(A)$$:', ans_array(4,1,8),',', ans_array_extension(4,1,8) ) \}
166 $BR 167 \{mbox( '$$\mathbf N(A)$$:', ans_array(5,1,8),',', ans_array_extension(5,1,8), ',', ans_array_extension(5,1,8) ) \} 168$BR
169 \{mbox('$$\mathbf N(A^T)$$:', ans_array(4,1,8),',', ans_array_extension(4,1,8) )\}
170 $BR 171 172 END_TEXT 173 174 ANS(basis_cmp([[1,$a,0,$b,$c],[0,0,1,$d,$d1]]));
175 ANS(basis_cmp([[$m11,$m21,$m31,$m41],[$m13,$m23,$m33,$m43]]));
176 ANS(basis_cmp([[-$a,1,0,0,0],[-$b,0,-$d,1,0],[-$c,0,-$d1,0,1]])); 177 ANS(basis_cmp([[$LN11,$LN12,$LN13,$LN14],[$LN21,$LN22,$LN23,\$LN24]]));
178
179 }
180
181 ENDDOCUMENT();  # This should be the last executable line in the problem.