## DESCRIPTION ## Sequences: answer is an ordered list ## ENDDESCRIPTION ## KEYWORDS('integral calculus', 'answer is an ordered list') ## 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", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); ########################### # Setup Context("Numeric"); @seq = (); $seq[0] = 1; $seq[1] = 1; foreach my $i (2..6) { $seq[$i] = $seq[$i-1] + $seq[$i-2]; } $answer = join(", ",@seq); $answer = Compute("$answer"); ########################### # Main text Context()->texStrings; BEGIN_TEXT If \( s_1 = $seq[0] \), \( s_2 = $seq[1] \), and \( s_n = s_{n-1} + s_{n-2} \), find the first seven terms of this sequence, including \( s_1 \) and \( s_2 \). Enter your answer as a comma separated list of numbers. $BR $BR Sequence = \{ ans_rule(40) \} \{ AnswerFormatHelp("numbers") \} END_TEXT Context()->normalStrings; ############################ # Answer evaluation $showPartialCorrectAnswers=1; ANS( $answer->cmp(ordered=>1) ); ############################ # Solution Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();