[rochester] / trunk / rochester_problib / setProbability4Conditional / ur_pb_4_1.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/rochester_problib/setProbability4Conditional/ur_pb_4_1.pg

Mon Jun 25 19:20:51 2001 UTC (11 years, 11 months ago) by sam
File size: 846 byte(s)
```added problem library as webwork/ww_prob_lib with revision tag prob-lib-2
```

```    1 ##DESCRIPTION
2 ##KEYWORDS('probability','events','conditional')
3 ##
4 ##ENDDESCRIPTION
5
6 DOCUMENT();        # This should be the first executable line in the problem.
7
9 "PG.pl",
10 "PGbasicmacros.pl",
11 "PGchoicemacros.pl",
13 "PGgraphmacros.pl",
14 "PGauxiliaryFunctions.pl"
15 );
16
17 TEXT(&beginproblem);
19
20 \$a = random(0.2,0.5,0.1);
21 \$b = random(0.6,0.9,0.1);
22 \$d = 0;
23 if (\$a + \$b > 1 ) {\$d = \$a + \$b -1;}
24 \$c = random(\$d,\$a,0.05);
25 \$ans1 = \$c / \$b;
26 \$ans2 = \$c / \$a;
27
28 BEGIN_TEXT
29 \$BR
30 If \( P(A) = \$a \), \( \ P(B) = \$b \), \ and \( \ P(A \cap B) = \$c \), \ then \$BR
31 (a) \( \) \( P(A|B) = \)\{ans_rule(10)\} \ and \$BR
32 (b) \( \) \( P(B|A) = \)\{ans_rule(10)\}
33
34 END_TEXT
35
36 &ANS(arith_num_cmp(\$ans1));
37 &ANS(arith_num_cmp(\$ans2));
38
39
40 ENDDOCUMENT();       # This should be the last executable line in the problem.
41
```