[npl] / trunk / NationalProblemLibrary / ASU-topics / setSequenceandSeries / factorial2.pg Repository:
ViewVC logotype

Annotation of /trunk/NationalProblemLibrary/ASU-topics/setSequenceandSeries/factorial2.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3141 - (view) (download)

1 : jj 3131 ##DESCRIPTION
2 :     ## Simplify factorials
3 :     ##ENDDESCRIPTION
4 :    
5 :     ## Tagged by ynw2d
6 :    
7 : jj 3141
8 : jj 3131 ## DBsubject('Algebra')
9 :     ## DBchapter('Sequences and Series')
10 : jj 3141 ## DBsection('The Binomial Theorem')
11 :     ## Date('6/3/2002')
12 : jj 3131 ## Institution('ASU')
13 : jj 3141 ## TitleText1('College Algebra')
14 :     ## AuthorText1('Stewart, Redlin, Watson')
15 :     ## EditionText1('3')
16 :     ## Section1('9.6')
17 :     ## Problem1('13')
18 :     ## KEYWORDS('factorials')
19 : jj 3131
20 : jj 61 #
21 : jj 3131 # First comes some stuff that appears at the beginning of every problem
22 : jj 61 #
23 :    
24 : jj 3131 DOCUMENT(); # This should be the first executable line in the problem.
25 : jj 61
26 : jj 3131 loadMacros(
27 :     "PG.pl",
28 :     "PGbasicmacros.pl",
29 :     "PGchoicemacros.pl",
30 :     "PGanswermacros.pl",
31 :     "PGauxiliaryFunctions.pl",
32 :     "PGasu.pl"
33 :     );
34 : jj 61
35 : jj 3131 TEXT(beginproblem());
36 :    
37 :     #
38 :     # Choose the denominator
39 :     #
40 :    
41 :     $b = random(1,30);
42 :    
43 :     #Pick how many more the numerator will be
44 :     $c = random(1,5);
45 :    
46 :     #Calculate the numerator
47 :     $a = $b + $c;
48 :    
49 :     #calculate the answer
50 :     $ans = $a;
51 :     for($j=$b+1; $j<$a; $j++) {
52 :     $ans *= $j;
53 :     }
54 :    
55 :     #Now the problem
56 :    
57 :    
58 :     BEGIN_TEXT
59 :     Evaluate \[\frac{$a !}{$b !}\]
60 :     $PAR
61 :     \(\frac{$a !}{$b !}\) =\{ans_rule(40)\}
62 :     END_TEXT
63 :    
64 :     #
65 :     # Tell WeBWork how to test if answers are right. These should come in the
66 :     # same order as the answer blanks above. You tell WeBWork both the type of
67 :     # "answer evaluator" to use, and the correct answer.
68 :     #
69 :    
70 :     ANS(num_cmp($ans));
71 :    
72 :     ENDDOCUMENT(); # This should be the last executable line in the problem.
73 :    

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9