[npl] / trunk / NationalProblemLibrary / ASU-topics / set119LPsimplex / nonstand1.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/ASU-topics/set119LPsimplex/nonstand1.pg

Sat Jan 14 02:13:08 2006 UTC (7 years, 4 months ago) by jj
File size: 1372 byte(s)
New problems for the library.


    1 ##DESCRIPTION
2 ##   Evaluation of a simple algebraic expression
3 ##ENDDESCRIPTION
4
5 ##KEYWORDS('percent')
6
7 #
8 # First comes some stuff that appears at the beginning of every problem
9 #
10
11 DOCUMENT();        # This should be the first executable line in the problem.
12
14 "PG.pl",
15 "PGbasicmacros.pl",
16 "PGchoicemacros.pl",
18 "PGauxiliaryFunctions.pl",
19 "PGasu.pl"
20 );
21
22 TEXT(&beginproblem);
23
24 $b = random(2,4); 25$b1 = $b+1; 26$k = random(3,6);
27 $a = random($b*$k+1,($b+1)*$k-1); 28$f= random(2,4);
29 $e =$f+random(1,4);
30 $rr=$b*$b1*$k;
31 $c=random(2,5); 32$rrp = $b1*($a-$b*$k)+$c*$b*($b1*$k-$a); 33$rrp = $a if$a>$rrp; 34$rrp = $b1*$k if $b1*$k > $rrp; 35$rrp += random(1,5);
36
37
38 BEGIN_TEXT
39 Use the mixed-constraint simplex method to maximize
40 $P = e x_1 + f x_2$
41 subject to
42 $43 \begin{array}{rrrrr} 44 x_1 & + & x_2 & \ge & a \cr 45 b x_1 & + & b1 x_2 & \ge & rr \cr 46 x_1 & + & c x_2 & \le & rrp \cr 47 \end{array} 48$
49 $BR 50 $x_1 \ge 0\ \qquad x_2 \ge 0$ 51$BR$BR 52 If there are no solutions, enter$BITALIC None $EITALIC for $$P$$. 53$BR$BR 54 Maximum value is 55 $$P =$$ \{ans_rule(40)\} 56$BR$BR 57 where $$x_1=$$ \{ans_rule(40)\} 58$BR$BR 59 and $$x_2=$$ \{ans_rule(40)\} 60 END_TEXT 61 62 ANS(num_cmp($rrp*$e, strings=>['None'])); 63 ANS(num_cmp($rrp, strings=>['None']));
64 ANS(num_cmp(0, strings=>['None']));
65
66 ENDDOCUMENT();        # This should be the last executable line in the problem.
67