Parent Directory
|
Revision Log
New files.
1 DOCUMENT(); # This should be the first executable line in the problem. 2 3 loadMacros( 4 "PGstandard.pl", 5 "PGunion.pl", 6 "alignedChoice.pl", 7 "Parser.pl", 8 "PGcourse.pl" 9 ); 10 11 12 TEXT(beginproblem()); 13 BEGIN_PROBLEM(); 14 15 ############################################## 16 # Setup 17 18 Context("Vector")->variables->are( 19 x=>'Real', y=>'Real', s=>'Real', t=>'Real', 20 ); 21 22 # 23 # The function to use 24 # 25 $f = Formula("(x^2-y^2,2xy,x^3)"); 26 $f->perlFunction('f'); 27 28 # 29 # some points to evaluate it at 30 # 31 $a = non_zero_random(-6,6,1); 32 $b = non_zero_random(-6,6,1); $b++ if ($b == $a); 33 $c = non_zero_random(-6,6,1); 34 35 $at = Formula("$a t")->reduce; 36 37 # 38 # The questions and answers 39 # 40 Context()->texStrings; 41 $al = new_aligned_list(ans_rule_len=>35); 42 $al->qa( 43 "\(f($a,$b)\)", f($a,$b)->cmp, 44 "\(f($b,$a)\)", f($b,$a)->cmp, 45 "\(f(0,$c)\)", f(0,$c)->cmp, 46 "\(f(t^2,$at)\)", Formula("(t^4-($a t)^2,2*$a*t^3,t^6)")->reduce->cmp, 47 "\(f(s+t,s-t)\)", Formula("(4st,2(s^2-t^2),(s-t)^3)")->cmp, 48 ); 49 Context()->normalStrings; 50 51 ############################################## 52 # Main text 53 54 Context()->texStrings; 55 BEGIN_TEXT 56 57 Suppose \(f(x,y)=$f\). Compute the following values: 58 $PAR 59 60 $BBLOCKQUOTE 61 \{$al->print_q\} 62 $EBLOCKQUOTE 63 64 END_TEXT 65 Context()->normalStrings; 66 67 ############################################## 68 # Answers 69 70 ANS($al->correct_ans); 71 $showPartialCorrectAnswers = 1; 72 73 ############################################## 74 75 END_PROBLEM(); 76 ENDDOCUMENT(); # This should be the last executable line in the problem.
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |