[npl] / trunk / NationalProblemLibrary / UVA-Stat / setStat212-Homework03 / stat212-HW03-08.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/UVA-Stat/setStat212-Homework03/stat212-HW03-08.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 459 - (download) (annotate)
Tue Jul 10 12:42:27 2007 UTC (5 years, 10 months ago) by jjholt
File size: 2776 byte(s)
Fixed Tags. --JJH

    1 ## DESCRIPTION
    2 ##  Statistics: Descriptive statistics
    3 ## ENDDESCRIPTION
    4 
    5 ## KEYWORDS('probability')
    6 ## NAW tagged this problem.
    7 
    8 ## DBsubject('Probability')
    9 ## DBchapter('Theory')
   10 ## DBsection('Random Variables')
   11 ## Date('6/8/2005')
   12 ## Author('Nolan A. Wages')
   13 ## Institution('UVA')
   14 ## TitleText1('Statistics for Management and Economics')
   15 ## EditionText1('6')
   16 ## AuthorText1('Keller, Warrack')
   17 ## Section1()
   18 ## Problem1()
   19 
   20 
   21 DOCUMENT();        # This should be the first executable line in the problem.
   22 
   23 loadMacros(
   24 "PG.pl",
   25 "PGbasicmacros.pl",
   26 "PGchoicemacros.pl",
   27 "PGanswermacros.pl",
   28 "PGnumericalmacros.pl",
   29 "PGstatisticsmacros.pl",
   30 "PGauxiliaryFunctions.pl"
   31 );
   32 
   33 TEXT(beginproblem());
   34 $showPartialCorrectAnswers = 0;
   35 install_problem_grader(~~&std_problem_grader);
   36 
   37 $mc[1] = new_multiple_choice();
   38 $mc[1]->qa('If you roll an unbiased die 50 times, you should expect an even number to appear: ',
   39     'on the average, 25 out of the 50 rolls'
   40 );
   41 $mc[1]->extra(
   42     'at least twice in the 50 rolls',
   43     'on every other roll',
   44     '25 out of the 50 rolls'
   45 );
   46 
   47 
   48 $mc[2] = new_multiple_choice();
   49 $mc[2]->qa('Which of the following is a requirement of the probabilities assigned to the
   50 outcomes \(O_i\):',
   51     '\(0 \leq P(O_i)\leq 1\) for each i '
   52 );
   53 $mc[2]->extra(
   54     '\(P(O_i) \leq 0\)',
   55     '\(P(O_i) \geq 1\)',
   56     '\(P(O_i) = 1 + P(O_i^C)\)'
   57 );
   58 
   59 
   60 $mc[3] = new_multiple_choice();
   61 $mc[3]->qa('Which of the following statements is correct given that the events
   62 A and B  have nonzero probabilities?',
   63     'A and B cannot be both independent and mutually exclusive'
   64 );
   65 $mc[3]->extra(
   66     'A and B can be both independent and mutually exclusive',
   67     'A and B are always independent',
   68     'A and B are always mutually exclusive'
   69 );
   70 
   71 
   72 
   73 $mc[4] = new_multiple_choice();
   74 $mc[4]->qa('If an experiment consists of five outcomes with \(P(O_1) = 0.10\),
   75 \(P(O_2) = 0.20\), \(P(O_3) = 0.30\), \(P(O_4) = 0.40\), then \(P(O_5)\) is:',
   76     '0'
   77 );
   78 
   79 $mc[4]->extra(
   80     '0.50',
   81     '0.25',
   82     '1'
   83 );
   84 
   85 
   86 $mc[5] = new_multiple_choice();
   87 $mc[5]->qa('Of the last 500 customers entering a supermarket,
   88 50 have purchased a loaf of bread.  If the relative frequency approach for assigning probabilities
   89 is used, the probability that the next customer will purchase a loaf of bread is:',
   90     '0.10'
   91 );
   92 $mc[5]->extra(
   93     '0.50',
   94     '0.90',
   95 );
   96 
   97 $mc[5]->makeLast(
   98     'None of the above answers is correct'
   99 );
  100 
  101 
  102 $a = random(1,5,1);
  103 $b = random(1,5,1);
  104 while ($a == $b) {
  105     $b = random(1,5,1);
  106 }
  107 
  108 
  109 BEGIN_TEXT
  110 $PAR
  111 \{ $mc[$a]->print_q() \}
  112 
  113 \{ $mc[$a]->print_a() \}
  114 $PAR
  115 \{ $mc[$b]->print_q() \}
  116 
  117 \{ $mc[$b]->print_a() \}
  118 $PAR
  119 
  120 END_TEXT
  121 
  122 ANS(radio_cmp($mc[$a]->correct_ans));
  123 ANS(radio_cmp($mc[$b]->correct_ans));
  124 
  125 ENDDOCUMENT();       # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9