[npl] / trunk / NationalProblemLibrary / Rochester / setSeries1Definitions / ur_sr_1_6.pg Repository:
ViewVC logotype

Annotation of /trunk/NationalProblemLibrary/Rochester/setSeries1Definitions/ur_sr_1_6.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 141 - (view) (download)

1 : jj 141 ##DESCRIPTION
2 :     ##KEYWORDS('')
3 :     ##
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 :     "PGgraphmacros.pl"
14 :     );
15 :    
16 :     TEXT(beginproblem());
17 :     $showPartialCorrectAnswers = 1;
18 :    
19 :     $a = random(3,5,1);
20 :     $b = random(-5,10);
21 :     $c = random(1,3,1);
22 :    
23 :     if ($a == 3) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + 4*$b;}
24 :     if ($a == 4) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + ($c+4)**2 + 5*$b;}
25 :     if ($a == 5) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + ($c+4)**2 - ($c+5)**2 + 6*$b;}
26 :    
27 :     BEGIN_TEXT
28 :     Evaluate the sum:
29 :     \[ \sum_{k=0}^{$a}{((-1)^k (k+$c)^2+$b)} \]
30 :     \{ans_rule(20)\}
31 :    
32 :     END_TEXT
33 :     ANS(num_cmp($ans, mode=>"arith"));
34 :    
35 :     ENDDOCUMENT(); # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9