[npl] / trunk / NationalProblemLibrary / Rochester / setLinearAlgebra2SystemsApplications / ur_la_2_1.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setLinearAlgebra2SystemsApplications/ur_la_2_1.pg

Thu May 4 16:40:05 2006 UTC (7 years ago) by jjholt
File size: 2379 byte(s)
```Added tags.  --JH
```

```    1 ## DESCRIPTION
2 ## Linear Algebra
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS ('linear algebra','linear system')
6 ## Tagged by cmd6a 5/3/06
7
8 ## DBsubject('Linear Algebra')
9 ## DBchapter('Systems of Linear Equations and Matrices')
10 ## DBsection('Introduction to Systems of Linear Equations')
11 ## Date('')
12 ## Author('')
13 ## Institution('Rochester')
14 ## TitleText1('')
15 ## EditionText1('')
16 ## AuthorText1('')
17 ## Section1('')
18 ## Problem1('')
19
20 DOCUMENT();        # This should be the first executable line in the problem.
21
23 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "PGgraphmacros.pl",
28 "PGnumericalmacros.pl",
29 "PGauxiliaryFunctions.pl"
30 );
31
32 TEXT(beginproblem());
34
35 @girls = (4, 3, 3, 2, 2, 5, 2);
36 @boys  = (3, 4, 2, 3, 2, 2, 5);
37
38 @shehas = ('as many brothers as sisters', 'twice as many brothers as sisters',
39         'as many brothers as sisters', 'three times as many brothers as sisters',
40         'twice as many brothers as sisters', 'twice as many sisters as brothers',
41         'five times as many brothers as sisters');
42 @hehas = ('twice as many sisters as brothers', 'as many brothers as sisters',
43        'three times as many sisters as brothers', 'as many brothers as sisters',
44        'twice as many sisters as brothers', 'five times as many sisters as brothers',
45        'twice as many brothers as sisters');
46
47 \$probversiontag = random(0,6,1);
48 \$gnum = \$girls[\$probversiontag];
49 \$bnum = \$boys[\$probversiontag];
50 \$gsent = \$shehas[\$probversiontag];
51 \$bsent = \$hehas[\$probversiontag];
52
53 @gnames = ('Amanda', 'Kate', 'Emily', 'Tonya', 'Lisa', 'Sasha');
54 \$gntag = random(0,5,1);
55 \$gname = \$gnames[\$gntag];
56
57 @bnames = ('Mike', 'Sam', 'Fred', 'John', 'Steve', 'Bob');
58 \$bntag = random(0,5,1);
59 \$bname = \$bnames[\$bntag];
60
61 @name = (\$gname, \$bname);
62 @sb = ('sister', 'brother');
63 @sent = (\$gsent, \$bsent);
64 @gb = ('girls', 'boys');
65 @ans = (\$gnum, \$bnum);
66
67 \$first = random(0,1,1);
68 \$second = 1-\$first;
69
70 BEGIN_TEXT
71
72 \$name[\$first] and \$name[\$second] are \$sb[\$first] and \$sb[\$second]. \$name[\$first] has \$sent[\$first], and
73 \$name[\$second] has \$sent[\$second]. How many \$gb[\$first] and \$gb[\$second] are there in this family?
74 \$PAR
75 Answer: \{ans_rule(10)\} \$gb[\$first] and \{ans_rule(10)\} \$gb[\$second].
76
77 END_TEXT
78
79 ANS(num_cmp(\$ans[\$first]));
80 ANS(num_cmp(\$ans[\$second]));
81
82 ENDDOCUMENT();       # This should be the last executable line in the problem.
83
```