[rochester] / trunk / rochester_problib / instructiveProblems / OldProblems / UR_VC_1_8.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/rochester_problib/instructiveProblems/OldProblems/UR_VC_1_8.pg

Thu Jul 19 16:22:01 2007 UTC (5 years, 10 months ago) by gage
File size: 1455 byte(s)
A collection of problems illustrating how to use MathObjects when
writing WeBWorK questions.


    1 ##DESCRIPTION
2 #  First Created: 5/30/00
4 #  Author: Joseph Neisendorfer
5 #  WebworK Entry: Robert Van Dam
6 #  Location: University of Rochester
7 #
8 #  Math 164 Problems - Assignment 1 - Problem 8
9 ##ENDDESCRIPTION
10
11 ##KEYWORDS('vector')
12
13 DOCUMENT();
14
16 "PG.pl",
17 "PGbasicmacros.pl",
18 "PGchoicemacros.pl",
20 "PGauxiliaryFunctions.pl",
21 "PGcourse.pl",
22 # "source.pl",
23 );
24
25 TEXT(beginproblem());
26 $showPartialCorrectAnswers = 1; 27 28 ################### 29 # 30 # Setup 31 32$a = random(-10, 10);
33 $b = random(-10, 10); 34$c = random(-10, 10);
35 $d = random(-10, 10); 36$e = random(-10, 10);
37 $f = random(-10, 10); 38$g = random(-10, 10);
39
40 $abs = sqrt(($a)**2 + ($b)**2 + ($c)**2);
41
42 ###################
43 #
44 #  Text
45
46 BEGIN_TEXT
47 $PAR 48 Let $$\bf a$$ = ($a, $b,$c) and $$\bf b$$ = ($d,$e, $f) be vectors. Compute the following 49 vectors. 50 51$PAR A. $$\bf a$$ + $$\bf b$$ = (\{ ans_rule(6) \}, \{ ans_rule(6) \},
52 \{ ans_rule(6) \})
53
54 $PAR 55 B.${g}$$\bf{a}$$= (\{ ans_rule(6) \}, \{ ans_rule(6) \}, \{
56 ans_rule(6) \})
57
58 $PAR 59 C. $$\bf a$$ - $$\bf b$$= (\{ ans_rule(6) \}, \{ ans_rule(6) \}, \{ 60 ans_rule(6) \}) 61 62$PAR
63 D. $$\left|{\bf a}\right|$$ = \{ ans_rule(40) \}
64 END_TEXT
65
66 ###################
67 #
69
70
71 ANS(num_cmp($a+$d));
72 ANS(num_cmp($b+$e));
73 ANS(num_cmp($c+$f));
74
75 ANS(num_cmp($g*$a));
76 ANS(num_cmp($g*$b));
77 ANS(num_cmp($g*$c));
78
79 ANS(num_cmp($a-$d));
80 ANS(num_cmp($b-$e));
81 ANS(num_cmp($c-$f));
82
83 ANS(num_cmp(\$abs));
84
85 ENDDOCUMENT();