-
-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathp1.pg
More file actions
111 lines (75 loc) · 2.25 KB
/
Copy pathp1.pg
File metadata and controls
111 lines (75 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
## DESCRIPTION
## Linear Inequality: Graphical
## ENDDESCRIPTION
## Tagged by nhamblet
## DBsubject(Algebra)
## DBchapter(Systems of equations and inequalities)
## DBsection(Inequalities)
## Institution(ASU)
## Level(2)
## KEYWORDS('Inequalities', 'Linear')
#
# First comes some stuff that appears at the beginning of every problem
#
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"PGgraphmacros.pl",
"PGasu.pl",
"PGcourse.pl"
);
TEXT(beginproblem());
$NO_SPACE = '@{}';
$rrr = 'r@{}r@{}r@{}r';
@systems = ('
\begin{array}{'."$rrr".'}
3 x & -2 y & \ge & 0 \\
2 x & + 3 y & \ge & 6
\end{array} ',
'\begin{array}{'."$rrr".'}
3 x & -2 y & \ge & 0 \\
2 x & + 3 y & \le & 6
\end{array} ',
' \begin{array}{'."$rrr".'}
3 x & -2 y & \le & 0 \\
2 x & + 3 y & \le & 6
\end{array} ',
' \begin{array}{'."$rrr".'}
3 x & -2 y & \le & 0 \\
2 x & + 3 y & \ge & 6
\end{array}');
@answers = ("a","b","c","d");
$tag = random(0,3,1);
$graph1 = init_graph(-3,-3,4,4,'axes'=>[0,0],'grid'=>[7,7]);
$dom = 4;
$f1 = FEQ("3/2*x for x in <-$dom,$dom> using color:blue and weight:2");
$f2 = FEQ("2-2/3*x for x in <-$dom,$dom> using color:black and weight:2");
($fref2) = plot_functions( $graph1, $f1,$f2);
# Label some points
$label1 = new Label(3, 9/4, "A",'black','center');
$label2 = new Label(3/2, -1, "B",'black','left');
$label3 = new Label(-1,1,"C",'black','left');
$label4 = new Label(1,3,"D",'black','left');
$graph1->lb($label1,$label2,$label3,$label4);
BEGIN_TEXT
\{ image(insertGraph($graph1),
alt=>"Two intersecting lines dividing the plane into four regions labeled A, B, C, and D, representing a system of linear inequalities."
) \}
$PAR
Determine which of the regions A, B, C or D, in the figure above, represents the graph
of the given
system of linear inequalities:
$BR
$PAR
The regions A, B, C and D are nonoverlapping regions bounded by the indicated lines.
(to get a better look at the graph, you can click on it).
$BR
\[ \left\lbrace $systems[$tag] \right. \]
$BR
$PAR
Region: \{ans_rule(10)\} $BITALIC enter A, B, C or D $EITALIC
END_TEXT
$ans = "$answers[$tag]" ;
ANS(str_cmp($ans));
ENDDOCUMENT(); # This should be the last executable line in the problem.