[npl] / trunk / NationalProblemLibrary / ASU-topics / set119LinearSystems / p27.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/ASU-topics/set119LinearSystems/p27.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101 - (download) (annotate)
Wed Feb 22 20:38:15 2006 UTC (7 years, 2 months ago) by jjholt
File size: 2916 byte(s)
Tags as of Feb 22, 2006.
--JH

    1 ## DESCRIPTION
    2 ## Systems of Linear Equations
    3 ## ENDDESCRIPTION
    4 
    5 ## KEYWORDS('Algebra' 'Linear Equations' 'Matrix' 'Matrices')
    6 ## Tagged by tda2d
    7 
    8 ## DBsubject('Algebra')
    9 ## DBchapter('Systems of Equations and Inequalities')
   10 ## DBsection('Systems of Linear Equations')
   11 ## Date('')
   12 ## Author('')
   13 ## Institution('ASU')
   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 "PGasu.pl",
   24 "PG.pl",
   25 "PGbasicmacros.pl",
   26 "PGchoicemacros.pl",
   27 "PGanswermacros.pl",
   28 "PGmatrixmacros.pl"
   29 );
   30 
   31 TEXT(&beginproblem);
   32 $showPartialCorrectAnswers = 1;
   33 $ENV{'partial_weights'} = [1,1,1,1,1,1,1,1,1,1,1,1,12,12,12];
   34 install_problem_grader(~~&weighted_partial_grader);
   35 
   36 
   37 $a1 = random(10,50,.5);
   38 $a2 = random(10,50,.5);
   39 $a3 = random(10,50,.5);
   40 
   41 $x1 = random(10,50,10);
   42 $x2 = random(10,50,10);
   43 $x3 = random(10,50,10);
   44 
   45 $l = non_zero_random(.5,2,.5);
   46 $m = non_zero_random(10,20,5);
   47 $n = non_zero_random(10,20,5);
   48 
   49 $y1 = $x1*$l;
   50 $y2 = $x2*$l+$m;
   51 $y3 = $x3*$l+$n;
   52 
   53 $p = non_zero_random(.5,2,.5);
   54 $q = non_zero_random(10,20,10);
   55 do {$r = non_zero_random(10,20,10); } until (($m*$r != $q*$n));
   56 
   57 $z1 = $x1*$p;
   58 $z2 = $x2*$p+$q;
   59 $z3 = $x3*$p+$r;
   60 
   61 $tot1 = $a1*$x1+$a2*$y1+$a3*$z1;
   62 $tot2 = $a1*$x2+$a2*$y2+$a3*$z2;
   63 $tot3 = $a1*$x3+$a2*$y3+$a3*$z3;
   64 
   65 
   66 BEGIN_TEXT
   67 A dietician is planning a meal that supplies certain quantities of vitamin C, calcium, and
   68 magnesium.  Three foods will be used, their quantities measured in milligrams.  The
   69 nutrients supplied by these foods and the dietary requirements are given in the table below.
   70 $PAR
   71 $BCENTER
   72 \{begintable(5)\}
   73 \{row( "Nutrient", "Food 1", "Food 2", "Food 3", "Total Required (mg)")\}
   74 \{row("Vitamin C", "\($x1\)", "\($y1\)", "\($z1\)", "\($tot1\)")\}
   75 \{row("Calcium", "\($x2\)", "\($y2\)", "\($z2\)", "\($tot2\)")\}
   76 \{row("Magnesium", "\($x3\)", "\($y3\)", "\($z3\)", "\($tot3\)")\}
   77 \{endtable()\}
   78 $ECENTER
   79 $PAR
   80 Write the augmented matrix for this problem.
   81 
   82 $BCENTER
   83 \{display_matrix([[ans_rule(10),ans_rule(10),ans_rule(10),ans_rule(10)],
   84 [ans_rule(10),ans_rule(10),ans_rule(10),ans_rule(10)],
   85 [ans_rule(10),ans_rule(10),ans_rule(10),ans_rule(10)]],
   86 'align'=>"ccc|c")
   87 \}
   88 $ECENTER
   89 
   90 $PAR
   91 What quantity (mg) of Food 1 is necessary to meet the dietary requirements? $BR
   92 \{ans_rule(10)\} $PAR
   93 What quantity (mg) of Food 2 is necessary to meet the dietary requirements? $BR
   94 \{ans_rule(10)\} $PAR
   95 What quantity (mg) of Food 3 is necessary to meet the dietary requirements? $BR
   96 \{ans_rule(10)\}
   97 
   98 END_TEXT
   99 
  100 ANS(num_cmp($x1));
  101 ANS(num_cmp($y1));
  102 ANS(num_cmp($z1));
  103 ANS(num_cmp($tot1));
  104 ANS(num_cmp($x2));
  105 ANS(num_cmp($y2));
  106 ANS(num_cmp($z2));
  107 ANS(num_cmp($tot2));
  108 ANS(num_cmp($x3));
  109 ANS(num_cmp($y3));
  110 ANS(num_cmp($z3));
  111 ANS(num_cmp($tot3));
  112 
  113 ANS(num_cmp($a1));
  114 ANS(num_cmp($a2));
  115 ANS(num_cmp($a3));
  116 
  117 
  118 
  119 ENDDOCUMENT();       # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9