Skip to content

Commit 4c88988

Browse files
authored
Merge pull request #1154 from gajennings/main
Fix bug 4827, update to MathObjects and PGML, add solution
2 parents 91e4d11 + 8fb7610 commit 4c88988

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

OpenProblemLibrary/ASU-topics/setStat/dueck7_3_4.pg

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,41 @@ DOCUMENT();
1616

1717
loadMacros(
1818
"PGstandard.pl",
19-
"PGchoicemacros.pl",
20-
"PGgraphmacros.pl",
21-
"PGnumericalmacros.pl",
19+
"MathObjects.pl",
20+
"PGML.pl",
2221
"PGstatisticsmacros.pl",
2322
"PGcourse.pl"
2423
);
2524

26-
TEXT(beginproblem());
2725
$showPartialCorrectAnswers = 1;
2826

27+
Context("Numeric");
28+
2929
$n = random(5,10,1);
3030
$mean = random(12.09,12.15,0.01);
3131
$dev = random(0.09,0.13,0.01);
3232
$newdev = $dev/sqrt($n);
33-
$ans = normal_prob($mean, 'infty', mean=>12, deviation=>$newdev);
34-
35-
BEGIN_TEXT
33+
$z = Compute( "($mean - 12)/$newdev" );
34+
$p = normal_prob($mean, 'infty', mean=>12, deviation=>$newdev);
35+
$ans = Compute($p)->cmp(
36+
tolerance => 0.005,
37+
tolType => 'relative'
38+
);
3639

37-
Cans of regular Coke are labeled as containing \(12 \mbox{ oz}\). $BR
38-
Statistics students weighed the contents of \($n\) randomly chosen cans, and found the mean
39-
weight to be \($mean\) ounces. $BR
40+
BEGIN_PGML
4041

41-
Assume that cans of Coke are filled so that the actual amounts are normally distributed with a mean of \(12.00 \mbox{ oz}\)
42-
and a standard deviation of \($dev \mbox{ oz}\). Find the probability that a sample of \($n\) cans will
43-
have a mean amount of at least \($mean \mbox{ oz}\). $BR
42+
Cans of regular Coke are labeled as containing [`12 \text{ oz}`].
43+
Statistics students weighed the contents of [$n] randomly chosen cans, and found the mean
44+
weight to be [$mean] ounces.
4445

45-
\{ans_rule(10)\}
46+
Assume that cans of Coke are filled so that the actual amounts are normally distributed with a mean of 12.00 oz and a standard deviation of [$dev] oz. Find the probability that a sample of [$n] cans will have a mean amount of at least [$mean] oz.
4647

47-
END_TEXT
48+
[_______]{$ans}
4849

49-
ANS(num_cmp($ans,tol=>0.0005));
50+
END_PGML
5051

52+
BEGIN_PGML_SOLUTION
53+
The z-score is [`z = \frac{x-\mu}{\sigma/\sqrt{n}} = \frac{[$mean]-12.00}{[$dev]/\sqrt{[$n]}} = [$z]`]. Using a computer or a table one finds that the probability [`z > [$z]`] is [$p] (approximately).
54+
END_PGML_SOLUTION
5155
ENDDOCUMENT(); # This should be the last executable line in the problem.
5256

0 commit comments

Comments
 (0)