[npl] / trunk / NationalProblemLibrary / Union / setLimitInfinity / ur_lr_3_5.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/Union/setLimitInfinity/ur_lr_3_5.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1328 - (download) (annotate)
Fri Jun 18 12:54:22 2010 UTC (2 years, 11 months ago) by gage
File size: 1986 byte(s)
Adding COMMENT('MathObject version') to files loading MathObjects.pl

    1 ## DESCRIPTION
    2 ##   Evaluate Limits at a Vertical Asymptote
    3 ## ENDDESCRIPTION
    4 
    5 ## KEYWORDS('Limit', 'Infinity', 'Vertical Asymptote', 'One-Sided')
    6 ## Tagged by nhamblet
    7 
    8 ## DBsubject('Calculus')
    9 ## DBchapter('Limits and Derivatives')
   10 ## DBsection('The Limit of a Function')
   11 ## Date('12/29/08')
   12 ## Author('N. Srivastava')
   13 ## Institution('Union College')
   14 ## TitleText1('')
   15 ## EditionText1('')
   16 ## AuthorText1('')
   17 ## Section1('')
   18 ## Problem1('')
   19 
   20 DOCUMENT();        # This should be the first executable line in the problem.
   21 
   22 loadMacros(
   23   "PGstandard.pl",
   24   "PGunion.pl",            # Union College utilities
   25   "MathObjects.pl",
   26   "alignedChoice.pl",      # for aligned answer blanks
   27   "PGcourse.pl",           # Customization file for the course
   28 );
   29 
   30 TEXT(beginproblem());
   31 
   32 ###################################
   33 # Setup
   34 
   35 Context("Numeric")->flags->set(reduceConstants => 0);
   36 
   37 $a1 = random(1,5,1);
   38 $a  = 2 * $a1;
   39 $s  = random(-1,1,2);
   40 $b1 = random(10,40,1);
   41 $b  = $s * $b1;
   42 $c1 = random(1,5,1);
   43 $c  = 1+2*$c1;
   44 
   45 if ($s == 1) {
   46   $ans1 = -(Infinity);
   47   $ans2 = Infinity;
   48 } else {
   49   $ans1 = Infinity;
   50   $ans2 = -(Infinity);
   51 }
   52 
   53 $f = Formula("$b x");
   54 $g = Formula("$c - $a x");
   55 $f_over_g = ($f/$g)->reduce;
   56 
   57 $C = Formula("$c/$a");
   58 
   59 ###################################
   60 #  Use an alignment to present the questions and answer rules
   61 ###################################
   62 
   63 Context()->texStrings;
   64 $alignment = new_aligned_list(
   65    equals => 1, ans_rule_len => 20, numbered => 1,
   66    row_spacing => 5, tex_spacing => "5pt"
   67 );
   68 $alignment->qa(
   69  "\(\displaystyle\lim_{x\to{($C)}^+} $f_over_g\)", $ans1->cmp,
   70  "\(\displaystyle\lim_{x\to{($C)}^-} $f_over_g\)", $ans2->cmp,
   71 );
   72 Context()->normalStrings;
   73 
   74 ###################################
   75 # Main text
   76 
   77 BEGIN_TEXT
   78 Evaluate the following limits:
   79 \{$alignment->print_q\}
   80 $INFINITY_MESSAGE
   81 END_TEXT
   82 
   83 ###################################
   84 # Answer checking
   85 
   86 $showPartialCorrectAnswers = 0;
   87 ANS($alignment->correct_ans);
   88 
   89 
   90 COMMENT('MathObject version');
   91 ENDDOCUMENT();

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9