Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 41 additions & 72 deletions OpenProblemLibrary/AlfredUniv/anton8e/chapter10/review/prob2.pg
Original file line number Diff line number Diff line change
Expand Up @@ -32,83 +32,52 @@ DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGgraphmacros.pl",
"PGchoicemacros.pl",
"PGML.pl",
"parserCheckboxList.pl",
"parserPopUp.pl",
"PGcourse.pl"
);
TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$showPartialCorrectAnswers = 0;

my @all,@correct,%difference;

###############################################################################
##
## The list of series tests
##
Context()->strings->are("Converges"=>{},"Converges Absolutely"=>{},"Converges Conditionally"=>{},"Diverges"=>{},"Divergence Test"=>{},"Geometric Series"=>{},"Integral Test"=>{},"P-Series"=>{},"Comparison Test"=>{},"Limit Comparison Test"=>{},"Ratio Test"=>{},"Alternating Series Test"=>{});

$blank = String("");
$converges = String("Converges");
$convergesabs = String("Converges Absolutely");
$convergescond = String("Converges Conditionally");
$diverges = String("Diverges");

$divergence = String("Divergence Test");
$geometric = String("Geometric Series");
$integral = String("Integral Test");
$pseries = String("P-Series");
$comparison = String("Comparison Test");
$limitcomparison = String("Limit Comparison Test");
$ratio = String("Ratio Test");
$alternating = String("Alternating Series Test");


##############################################################################
##############################################################################
##
## Set up the infinite series
##
## To change the problem change $n the start value for the series, $an the
## terms of the series, $correct which is the list of test that can be used
## for the series, $ans which is whether the series converges or not.

Context()->variables->are(n=>"Real",k=>"Real");

$n = 1; # starting value for the series
$an = Formula("1/(n^2)")->TeX;
$ans = $converges;

my @all = ($divergence->string,$geometric->string,$integral->string,$pseries->string,$comparison->string,$limitcomparison->string,$ratio->string,$alternating->string);

my @correct = ($pseries->string,$integral->string);

my %all=map{$_ =>1} @all;
my %correct=map{$_=>1} @correct;
my @difference=grep(!defined $correct{$_}, @all);

## The multiple choice question.
$mc = new_checkbox_multiple_choice();
## the correct answers.
$mc->qa("", @correct);
## the list of other answers.
$mc->extra(@difference);

Context()->texStrings;
BEGIN_TEXT
Which of the following series convergence tests could be applied to the infinite series \(\sum\limits_{n=$n}^\infty $an\)? Check all that apply.
\{ $mc->print_q() \}
\{ $mc->print_a() \}
$BR
The series \{ pop_up_list([$blank->string,$converges->string,$convergesabs->string,$convergescond->string,$diverges->string]) \}
END_TEXT
Context()->normalStrings;

install_problem_grader(~~&std_problem_grader);
$test = CheckboxList(
[ "Divergence Test",
"Geometric Series Test",
"Integral Test",
"P-Series Test",
"Comparison Test",
"Limit Comparison Test",
"Ratio Test",
"Alternating Series Test"
],
[2,3]
);

$showPartialCorrectAnswers = 0;
ANS( checkbox_cmp( $mc->correct_ans() ) );
ANS($ans->cmp);
$convergeQ = PopUp(
["??", "Yes, it converges.","No, it diverges.", "The test(s) fail to decide this."],
"Yes, it converges."
);

BEGIN_PGML
Consider the infinite series
[`` \sum_{n=1}^{\infty} \frac{1}{n^2} ``]
Which of the following convergence tests is a good way to decide whether or not this series converges? Check all that apply.
[_]{$test}

Does the series converge?
[_]{$convergeQ}
END_PGML

BEGIN_PGML_SOLUTION
* [``0=\lim_{n\to\infty} 1/n^2 \ ``] so the "divergence test" does not apply.
* Our series is not a geometric series.
* Our series is a series of positive terms and [``\int_1^\infty 1/x^2\; dx < \infty ``] so the integral test says that the series converges.
* Our series is a "p-series" with [`p=2`] which is larger than 1, so the "P-series test" says that the series converges.
* To use the "comparison test" we'd need another series [``\ \sum_{n=1}^{\infty} b_n \ ``] that satisfies the criteria for the comparison test, and where it's easier to decide the convergence or divergence of this series than it is for
our series. I can't think of any good candidates for the series [``\ \sum_{n=1}^{\infty} b_n``], can you?
* The "limit comparison test" has the same issue as the "comparison test".
* [``\lim_{n\to\infty} \frac{1/(n+1)^2}{1/n^2} = 1 ``] so the "ratio test" does not yield any useful information.
* Our series is not an alternating series.
END_PGML_SOLUTION

ENDDOCUMENT();