## DESCRIPTION ## Series: limit comparison test ## ENDDESCRIPTION ## KEYWORDS('integral calculus', 'limit comparison test') ## DBsubject('WeBWorK') ## DBchapter('WeBWorK Tutorial') ## DBsection('Fort Lewis Tutorial 2011') ## Date('01/30/2011') ## Author('Paul Pearson') ## Institution('Fort Lewis College') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') ###################################### # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "unionTables.pl", "parserPopUp.pl", "PGgraders.pl", "parserMultiAnswer.pl", ); TEXT(beginproblem()); ################################## # Setup Context("Numeric")->variables->are(n=>"Real"); $a = random(2,9,1); $b = random(2,9,1); $c = random(5,20,1); $d = random(3,9,1); $e = random(2,9,1); $dm1 = $d - 1; $dm2 = $d - 2; # TeX $series = "\sum_{n=$c}^{\infty} \frac{$a n + $b}{$c n^{$d} + $e}"; $fraction = "\lim_{n\to\infty} \frac{a_n}{b_n} = \lim_{n\to\infty}"; $num1 = Formula("$a n^$d + $b n^$dm1"); $den1 = Formula("$c n^$d + $e"); $num2 = Formula("$a + $b/n"); $den2 = Formula("$c + $e/(n^$d)"); $multians = MultiAnswer($num1, $den1)->with( singleResult => 0, checker => sub { my ( $correct, $student, $ansHash ) = @_; my ( $stu1, $stu2 ) = @{$student}; if (($num1 == $stu1 && $den1 == $stu2) || ($num2 == $stu1 && $den2 == $stu2) ) { return [1,1]; } elsif (($num1 == $stu1 && $den2 == $stu2) || ($num2 == $stu1 && $den1 == $stu2)) { $ansHash->setMessage(1,"Check your algebra"); $ansHash->setMessage(2,"Check your algebra"); return [0,0]; } elsif ($num1 == $stu1 || $num2 == $stu1) { return [1,0]; } elsif ($den1 == $stu2 || $den2 == $stu2) { return [0,1]; } else { return [0,0]; } } ); $limit = Formula("$a/$c"); $popup = PopUp(["Choose","Converges","Diverges","Inconclusive"],"Converges"); # # Display the fraction and answer blanks nicely # Context()->texStrings; if ($displayMode eq 'TeX') { $showfraction = "\[ $fraction ".$multians->ans_rule(10).$multians->ans_rule(10)." \]"; } else { $showfraction = ColumnTable( "\( \displaystyle $fraction \)", $multians->ans_rule(20).$BR.$HR.$multians->ans_rule(20), indent => 0, separation => 10, valign => "MIDDLE" ); } Context()->normalStrings; ####################################### # Main text Context()->texStrings; BEGIN_TEXT Use the limit comparison test to determine whether \( \displaystyle \sum_{n=$c}^{\infty} a_n = $series \) converges or diverges. $BR $BR (a) Choose a series \( \displaystyle \sum_{n=$c}^\infty b_n \) with terms of the form \( \displaystyle b_n = \frac{1}{n^p} \) and apply the limit comparison test. Write your answer as a fully reduced fraction. For \( n \geq $c \), $showfraction $BR (b) Evaluate the limit in the previous part. Enter \( \infty \) as ${BITALIC}infinity${EITALIC} and \( -\infty \) as ${BITALIC}-infinity.${EITALIC} If the limit does not exist, enter ${BITALIC}DNE.${EITALIC} $BR$SPACE \( \displaystyle \lim_{n\to\infty} \frac{a_{n}}{b_{n}} \, \) = \{ ans_rule(20) \} $BR $BR (c) By the limit comparison test, does the series converge, diverge, or is the test inconclusive? \{ $popup->menu() \} END_TEXT Context()->normalStrings; ####################################### # Answer evaluation $showPartialCorrectAnswers=1; install_problem_grader(~~&custom_problem_grader_fluid); $ENV{'grader_numright'} = [2,4]; $ENV{'grader_scores'} = [0.4,1]; $ENV{'grader_message'} = "You can earn " . "40% partial credit for 2 - 3 correct answers."; ANS( $multians->cmp() ); ANS( $limit->cmp() ); ANS( $popup->cmp() ); ############################### # Solution Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();