DOCUMENT();

loadMacros(

"PGstandard.pl",

"PG.pl",

"PGbasicmacros.pl",

"PGchoicemacros.pl",

"PGanswermacros.pl",

"PGgraphmacros.pl",

"PGmatrixmacros.pl",

"PGmorematrixmacros.pl",

"PGnumericalmacros.pl",

"PGauxiliaryFunctions.pl",

"MathObjects.pl",

"PGcourse.pl",

"MatrixCheckers.pl"

);

TEXT(beginproblem());

Context("Complex");

$i = Complex(0,1);

$one = Complex(1,0);

# define A = 2x2 random integer anti-symmetric matrix given to students

$c1 = random(1,4,1);

$c2 = random(1,5,1);

$A = new Matrix(2,2);

$A->assign(1,1, $c1 );

$A->assign(1,2, -$c2 );

$A->assign(2,1, $c2 );

$A->assign(2,2, $c1 );

# convert to matrix for display

$AMatrix = Matrix($A);

Context()->texStrings;

BEGIN_TEXT

The matrix

$BR$BR

\( $AMatrix \)

$BR$BR

has complex eigenvalues

\{ans_rule(10)\}

\( \pm \) \{ans_rule(10)\} \(i\).

$BR$BR

The eigenvectors of the matrix are

$BR

\{ mbox( ans_array(2,1,5), ans_array_extension(2,1,5) ) \}

END_TEXT

Context()->normalStrings;

ANS(Compute("$c1")->cmp);

ANS(Compute("$c2")->cmp);

ANS(basis_cmp([[1,Compute("i")],[1,Compute("-i")]]));

ENDDOCUMENT();