[npl] / trunk / NationalProblemLibrary / Rochester / setProbability2BinomialTh / ur_pb_2_1.pg Repository:
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 200 - (download) (annotate)
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 
   22 loadMacros(
   23 "PG.pl",
   24 "PGbasicmacros.pl",
   25 "PGchoicemacros.pl",
   26 "PGanswermacros.pl",
   27 "PGgraphmacros.pl",
   28 "PGauxiliaryFunctions.pl"
   29 );
   30 
   31 TEXT(beginproblem());
   32 $showPartialCorrectAnswers = 1;
   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.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9