[npl] / trunk / NationalProblemLibrary / maCalcDB / setAlgebra38Counting / wonka.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/maCalcDB/setAlgebra38Counting/wonka.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (download) (annotate)
Sat Jun 3 14:24:38 2006 UTC (6 years, 11 months ago) by gage
File size: 1700 byte(s)
Cleaned up code using convert-functions.pl

    1 ##DESCRIPTION
    2 ##KEYWORDS('logarithms', 'exponentials')
    3 ## pphi tagged and PAID on 2-20-2004
    4 
    5 ## DBsubject('Algebra')
    6 ## DBchapter('Counting and Probability')
    7 ## DBsection('Permutations and Combinations')
    8 ## Date('6/3/2002')
    9 ## Author('')
   10 ## Institution('')
   11 ## TitleText1('College Algebra')
   12 ## EditionText1('3')
   13 ## AuthorText1('Stewart, Redlin, Watson')
   14 ## Section1('10.2')
   15 ## Problem1('57')
   16 ##DIFFICULTY('easy')
   17 ##  Evaluate simple expressions involving logs and exponentials
   18 ##ENDDESCRIPTION
   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 "PGauxiliaryFunctions.pl",
   28 );
   29 
   30 TEXT(beginproblem());
   31 
   32 ## Define random numbers here
   33 $A = random(5,18,1);
   34 $B = random(19,28,1);
   35 $C = random(150,200,5);
   36 
   37 ## Put text of question here
   38 TEXT(EV2(<<EOT));
   39 Willie Wonka gives everyone who visits his factory $A pieces of candy to take
   40 home.  He never gives a person 2 or more pieces of the same type of candy.
   41 If Mr. Wonka has $B different types of candy, in how many different ways could
   42 Mr. Wonka give a visitor his candy?
   43 $PAR
   44 Mr. Wonka can distribute candy in \{ans_rule(20) \} different ways.
   45 EOT
   46 
   47 $ans1 = fact($B)/(fact($A)*fact($B-$A));
   48 ##choose function?
   49 ANS(num_cmp($ans1, mode=>"strict"));
   50 
   51 TEXT(EV2(<<EOT));
   52 $PAR
   53 If $C people visit Mr. Wonka's factory each day, how many days could Mr. Wonka go without giving two visitors the same selection of candy
   54 $PAR
   55 Mr. Wonka can go for \{ans_rule(20) \} days without repeating candy selections.
   56 EOT
   57 
   58 $ans2 = floor($ans1/$C);
   59 
   60 ANS(num_cmp($ans2, mode=>"strict"));
   61 
   62 ENDDOCUMENT();        # This should be the last executable line in the problem.;
   63 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9