[rochester] / tags / rel-1-9-02 / rochester_problib / setAlgebra23PolynomialZeros / describe_graph_b.pg Repository:
ViewVC logotype

View of /tags/rel-1-9-02/rochester_problib/setAlgebra23PolynomialZeros/describe_graph_b.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 669 - (download) (annotate)
Wed Jul 30 22:57:48 2003 UTC (9 years, 9 months ago)
File size: 2164 byte(s)
This commit was manufactured by cvs2svn to create tag 'rel-1-9-02'.

    1 ##DESCRIPTION
    2 ##KEYWORDS('logarithms,exponentials','exponential growth,decay')
    3 ##TYPE('word problem')
    4 ##ENDDESCRIPTION
    5 
    6 DOCUMENT();        # This should be the first executable line in the problem.
    7 
    8 loadMacros(
    9 "PG.pl",
   10 "PGbasicmacros.pl",
   11 "PGchoicemacros.pl",
   12 "PGanswermacros.pl",
   13 "PGauxiliaryFunctions.pl"
   14 );
   15 
   16 TEXT(&beginproblem);
   17 $showPartialCorrectAnswers = 0;
   18 
   19 $A = non_zero_random(-9,9,1);
   20 $B = non_zero_random(-9,9,1);
   21 while ($A == $B) { $B = non_zero_random(-9,9,1);}
   22 $C = non_zero_random(-9,9,1);
   23 while ($A == $C || $B == $C) {$C = non_zero_random(-9,9,1);}
   24 
   25 $K = non_zero_random(-9,9,1);
   26 
   27 $E1 = random(2,9,1);
   28 $E2 = random(2,9,1);
   29 $E3 = random(2,9,1);
   30 
   31 @root = num_sort(($A,$B,$C));
   32 
   33 $funct = "$K(x-$root[0])^$E1 (x-$root[1])^$E2 (x-$root[2])^$E3 ";
   34 
   35 if ($K*(-1)**$E1 * ($root[0]-1-$root[2])**$E2 * ($root[0]-1-$root[2])**$E3 < 0){
   36         $region[0] = -1;}
   37 else {$region[0] = 1;}
   38 
   39 if (int $E1/2 == $E1/2) {$region[1] = $region[0];}
   40 else {$region[1] = -$region[0];}
   41 
   42 if (int $E2/2 == $E2/2) {$region[2] = $region[1];}
   43 else {$region[2] = -$region[1];}
   44 
   45 if (int $E3/2 == $E3/2) {$region[3] = $region[2];}
   46 else {$region[3] = -$region[2];}
   47 
   48 foreach $i (0..3) {
   49         if ($region[$i] > 0) {$ans[$i] = "above";}
   50         else {$ans[$i] = "below";}
   51 }
   52 
   53 BEGIN_TEXT;
   54 Given \(f(x) = $funct\), find the roots in increasing order.
   55 $BR
   56 The roots are \{ans_rule(5)\}, \{ans_rule(5)\}, and \{ans_rule(5)\}.
   57 $BR
   58 To the left of the first root, is the graph of \(f(x)\) above or below the
   59 x-axis?  Answer above or below: \{ans_rule(5)\}.
   60 $BR
   61 Between the first two roots, is the graph of \(f(x)\) above or below the
   62 x-axis?  Answer above or below: \{ans_rule(5)\}.
   63 $BR
   64 Between the last two roots, is the graph of \(f(x)\) above or below the
   65 x-axis?  Answer above or below: \{ans_rule(5)\}.
   66 $BR
   67 After the last root, is the graph of \(f(x)\) above or below the x-axis?
   68 Answer above or below: \{ans_rule(5)\}
   69 END_TEXT
   70 
   71 &ANS(num_cmp($root[0]));
   72 &ANS(num_cmp($root[1]));
   73 &ANS(num_cmp($root[2]));
   74 &ANS(str_cmp($ans[0]));
   75 &ANS(str_cmp($ans[1]));
   76 &ANS(str_cmp($ans[2]));
   77 &ANS(str_cmp($ans[3]));
   78 
   79 ENDDOCUMENT();        # This should be the last executable line in the problem.
   80 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9