[npl] / trunk / NationalProblemLibrary / Rochester / setComplexNumbers / ur_cn_1_20.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setComplexNumbers/ur_cn_1_20.pg

Sun Mar 26 15:09:45 2006 UTC (7 years, 2 months ago) by jj
File size: 2130 byte(s)
Initial import


    1 ##DESCRIPTION
2 ## Some simple complex number algebra
3 ##ENDDESCRIPTION
4
5
6 DOCUMENT();        # This should be the first executable line in the problem.
7
9 "PG.pl",
10 "PGbasicmacros.pl",
11 "PGchoicemacros.pl",
13 "PGauxiliaryFunctions.pl",
14 "PGcomplexmacros.pl"
15 );
16
17 TEXT(beginproblem());
18 $showPartialCorrectAnswers = 1; 19 20$a = new Complex( 0, $PI ); 21$b = new Complex( -2*sqrt($one = random(2, 3, 1 )), -($two = non_zero_random( 1, 5, 1 )) );
22 $c = (new Complex( 1, -1 ) ) * ( new Complex( -sqrt($three=random(2,3,1)), 1 ) );
23 $d = (new Complex( sqrt($four=random(2,3,1)), ($five = random (-5, -1, 1 )) ) )**2; 24$e = ( new Complex( ($six = random(-5, -1, 1 )), sqrt($seven = random(2,3, 1))))/( new Complex(
25 ($eight = random(1, 5, 1)), ($nine = random( 1, 5, 1 ) )));
26 $f = -sqrt(7) * ( new Complex( 1, 1 ))/( new Complex( sqrt($ten = random( 2, 3, 1)), 1 ) );
27
28
29 BEGIN_TEXT
30
31 Write the following numbers in the polar form $$re^{i \theta}$$, $$-\pi < \theta \le \pi$$: $PAR 32 (a) $$\pi i$$$PAR
33 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 34 (b) $$-2\sqrt{one}\ -\ two i$$$PAR
35 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 36 (c) $$( 1\ -\ i)( - \sqrt{three}\ +\ i)$$$PAR
37 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 38 (d) $$(\sqrt{four}\ five i)^2$$$PAR
39 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 40 (e) $$\displaystyle \frac{six\ +\ \sqrt{seven}i}{eight\ +\ nine i}$$$PAR
41 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 42 (f) $$\displaystyle \frac{-\sqrt{7}(1\ +\ i)}{\sqrt{ten}\ +\ i}$$$PAR
43 $$r =$$ \{ans_rule(15)\}, $$\theta =$$ \{ans_rule(15)\}, $PAR 44 45$PAR $BR 46 END_TEXT 47 48 49 ANS(num_cmp($a -> rho ));
50 ANS(num_cmp( $a -> theta)); 51 ANS(num_cmp($b -> rho ));
52 ANS(num_cmp( $b -> theta)); 53 ANS(num_cmp($c -> rho ));
54 ANS(num_cmp( $c -> theta)); 55 ANS(num_cmp($d -> rho ));
56 ANS(num_cmp( $d -> theta)); 57 ANS(num_cmp($e -> rho ));
58 ANS(num_cmp( $e -> theta)); 59 ANS(num_cmp($f -> rho ));
60 ANS(num_cmp( \$f -> theta));
61
62
63
64 ENDDOCUMENT();        # This should be the last executable line in the problem.
65