[npl] / trunk / NationalProblemLibrary / Rochester / setProbability2BinomialTh / ur_pb_2_1.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setProbability2BinomialTh/ur_pb_2_1.pg

Thu May 4 16:40:05 2006 UTC (7 years ago) by jjholt
File size: 1110 byte(s)
```Added tags.  --JH
```

```    1 ## DESCRIPTION
2 ##   The Binomial Theorem and Binomial Expansions
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('Binomial Theorem', 'Binomial Expansion', 'Coefficient')
6 ## Tagged by nhamblet
7
8 ## DBsubject('Algebra')
9 ## DBchapter('Sequences and Series')
10 ## DBsection('The Binomial Theorem')
11 ## Date('')
12 ## Author('')
13 ## Institution('Rochester')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19
20 DOCUMENT();        # This should be the first executable line in the problem.
21
23 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "PGgraphmacros.pl",
28 "PGauxiliaryFunctions.pl"
29 );
30
31 TEXT(beginproblem());
33
34 \$a = random(20,11,1);
35 \$b = random(2,11,1);
36
37 \$k = 1;
38 \$l = 1;
39 \$m = 1;
40
41 for (\$i=2; \$i<\$a+1; \$i+=1){
42   \$k = \$k*\$i;
43 }
44
45 for (\$i=2; \$i<\$b+1; \$i+=1){
46   \$l = \$l*\$i;
47 }
48
49 for (\$i=2; \$i<\$a-\$b+1; \$i+=1){
50   \$m = \$m*\$i;
51 }
52
53 \$ans = \$k/\$l/\$m;
54
55 BEGIN_TEXT
56
57 Evaluate the binomial coefficient: \( {\$a}\choose{\$b} \) \$BR
58 \{ans_rule(20)\}
59
60 END_TEXT
61 ANS(num_cmp(\$ans));
62
63 ENDDOCUMENT();       # This should be the last executable line in the problem.
```