## DESCRIPTION ## Linear Algebra ## ENDDESCRIPTION ## KEYWORDS ('linear algebra','vector space','linear transformation') ## DBsubject('Multivariable Mathematics') ## DBchapter('Linear Transformations') ## DBsection('Change of Basis') ## Date('') ## Author('Shifrin') ## Institution('UGA') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGmatrixmacros.pl", "PGmorematrixmacros.pl", "weightedGrader.pl", "MathObjects.pl", "PGauxiliaryFunctions.pl", ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; install_weighted_grader(); Context("Numeric")->variables->are(x=>'Real', y=>'Real', z=>'Real'); @normal=("1","2","2"); @choice=NchooseK(3,3);$sgn[1] = 1; $sgn[2] = random(-1,1,2);$sgn[3] = random(-1,1,2); foreach $i(1..3) {$a[$i]=$sgn[$i]*@normal[@choice[$i-1]]}; $g=Formula("$a[1]x+$a[2]y+$a[3]z")->reduce; $M = new Matrix(3,3);$R = new Matrix(3,3); $M -> assign(1,1,1);$R -> assign(1,1,1); $M -> assign(2,2,1);$R -> assign(2,2,1); $M -> assign(3,3,0);$R -> assign(3,3,-1); foreach $i(1..3) {foreach$j(1..3) {if($i!=$j) {$M -> assign($i,$j,0);$R -> assign($i,$j,0);}}} # $M -> assign(1,2,0);$M -> assign(2,1,0); $M -> assign(1,3,0);$M -> # assign(3,1,0); $M -> assign(2,3,0);$M -> assign(3,2,0); $T = new Matrix(3,3);$S = new Matrix(3,3); $denom =$a[1]**2+$a[2]**2+$a[3]**2; # $T = Matrix("[[($a[2]**2+$a[3]**2)/$denom,-$a[1]*$a[2]/$denom,-$a[1]*$a[3] # /$denom],[-$a[1]*$a[2]/$denom,($a[1]**2+$a[3]**2)/$denom,-$a[2]*$a[3]/$denom], # [-$a[1]*$a[3]/$denom,-$a[2]*$a[3]/$denom,($a[1]**2+$a[2]**2)/$denom]]"); $T -> assign(1,1,($a[2]**2+$a[3]**2)/$denom); $T -> assign(1,2,-$a[1]*$a[2]/$denom); $T -> assign(2,1,$T->element(1,2)); $T -> assign(1,3,-$a[1]*$a[3]/$denom); $T -> assign(3,1,$T->element(1,3)); $T -> assign(2,2,($a[1]**2+$a[3]**2)/$denom); $T -> assign(2,3,-$a[2]*$a[3]/$denom); $T -> assign(3,2,$T->element(2,3)); $T -> assign(3,3,($a[1]**2+$a[2]**2)/$denom); $S -> assign(1,1,(-$a[1]**2+$a[2]**2+$a[3]**2)/$denom);$S -> assign(1,2,-2*$a[1]*$a[2]/$denom);$S -> assign(2,1,-2*$a[1]*$a[2]/$denom);$S -> assign(1,3,-2*$a[1]*$a[3]/$denom);$S -> assign(3,1,-2*$a[1]*$a[3]/$denom);$S -> assign(2,2,($a[1]**2-$a[2]**2+$a[3]**2)/$denom); $S -> assign(2,3,-2*$a[2]*$a[3]/$denom); $S -> assign(3,2,-2*$a[2]*$a[3]/$denom); $S -> assign(3,3,($a[1]**2+$a[2]**2-$a[3]**2)/$denom); Context()->texStrings; BEGIN_TEXT Consider the $$2$$-dimensional subspace $$\mathcal P\subset\mathbb R^3$$ defined by $g = 0 .$$PAR (a) Give a basis $$\mathcal B = \lbrace \mathbf v_1,\mathbf v_2,\mathbf v_3 \rbrace$$ so that $$\mathbf v_1,\mathbf v_2$$ span the plane $$\mathcal P$$ and $$\mathbf v_3$$ is orthogonal to it. $BR \{mbox('$$\mathbf v_1 =$$', ans_array(3,1,8), ', $$\quad \mathbf v_2 =$$', ans_array_extension(3,1,8), ', $$\quad \mathbf v_3 =$$', ans_array(3,1,8), '.') \}$PAR (b) Let $$T\colon \mathbb R^3\to\mathbb R^3$$ be the linear transformation defined by projecting onto the plane. Give the matrix representing $$T$$ with respect to the basis $$\mathcal B$$. $BR \{mbox('$$[T]_{\mathcal B} =$$', answer_matrix(3,3,3), '.')\}$PAR (c) Use the change-of-basis formula to calculate the standard matrix of $$T$$: $BR \{mbox ( '$$[T] =$$', answer_matrix(3,3,8), '.') \} (d) Now let $$S\colon \mathbb R^3\to\mathbb R^3$$ be the linear transformation defined by reflecting across the plane $$\mathcal P$$. Give the matrix representing $$S$$ with respect to the basis $$\mathcal B$$.$BR \{mbox('$$[S]_{\mathcal B} =$$', answer_matrix(3,3,3), '.')\} $PAR (e) Use the change-of-basis formula to calculate the standard matrix of $$S$$:$BR \{mbox ( '$$[S] =$$', answer_matrix(3,3,8), '.') \} END_TEXT Context("Vector"); WEIGHTED_ANS(basis_cmp([[$a[3],0,-$a[1]],[0,$a[3],-$a[2]]]),7); WEIGHTED_ANS(basis_cmp([[$a[1],$a[2],$a[3]]]),3); WEIGHTED_ANS(num_cmp($M->element(1,1)),1,num_cmp($M->element(1,2)),1,num_cmp($M->element(1,3)),1,num_cmp($M->element(2,1)),1,num_cmp($M->element(2,2)),1,num_cmp($M->element(2,3)),1,num_cmp($M->element(3,1)),1,num_cmp($M->element(3,2)),1,num_cmp($M->element(3,3)),1); WEIGHTED_ANS(num_cmp($T->element(1,1)),4,num_cmp($T->element(1,2)),4,num_cmp($T->element(1,3)),4,num_cmp($T->element(2,1)),4,num_cmp($T->element(2,2)),4,num_cmp($T->element(2,3)),4,num_cmp($T->element(3,1)),4,num_cmp($T->element(3,2)),4,num_cmp($T->element(3,3)),4); WEIGHTED_ANS(num_cmp($R->element(1,1)),1,num_cmp($R->element(1,2)),1,num_cmp($R->element(1,3)),1,num_cmp($R->element(2,1)),1,num_cmp($R->element(2,2)),1,num_cmp($R->element(2,3)),1,num_cmp($R->element(3,1)),1,num_cmp($R->element(3,2)),1,num_cmp($R->element(3,3)),1,); WEIGHTED_ANS(num_cmp($S->element(1,1)),4,num_cmp($S->element(1,2)),4,num_cmp($S->element(1,3)),4,num_cmp($S->element(2,1)),4,num_cmp($S->element(2,2)),4,num_cmp($S->element(2,3)),4,num_cmp($S->element(3,1)),4,num_cmp($S->element(3,2)),4,num_cmp(\$S->element(3,3)),4); ENDDOCUMENT(); # This should be the last executable line in the problem.