Skip to content

Commit 8f76638

Browse files
committed
Update some problems and create new ones
This was work on DEI and accessibility to improve some statistics problems in the OPL and some new ones. The update includes converting problems to PGML and graphs to tikz with a focus on appropriate DEI language and ensuring accessibility especially in regards to graphs via alternate text.
1 parent 233a1b1 commit 8f76638

File tree

66 files changed

+3039
-2778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3039
-2778
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ pm_to_blib
1616
*.swp
1717
.ai
1818
.svg
19+
.bak
1920
setDefs/
2021

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## DESCRIPTION
2+
## A problem that asks students to determine that a person is allergic to some
3+
## cookies.
4+
##
5+
## This problem is derived from a homework problem in Introductory Statistics,
6+
## licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0).
7+
## Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu
8+
## ENDDESCRIPTION
9+
10+
## DBsubject(Probability)
11+
## DBchapter(Sample Space)
12+
## DBsection(Probability: direct computation, inclusion/exclusion)
13+
## Institution(Fitchburg State University)
14+
## Author(Michael Stassen)
15+
## Level(1)
16+
## KEYWORDS('DEI')
17+
18+
DOCUMENT();
19+
loadMacros(
20+
"PGstandard.pl", "PGML.pl",
21+
"contextPercent.pl", 'randomPerson.pl',
22+
'PGcourse.pl'
23+
);
24+
25+
Context("Percent");
26+
27+
$cookies = random(32, 46);
28+
$nuts = random(10, 16);
29+
$both = random(2, 8);
30+
31+
$p = randomPerson();
32+
33+
$allergic = ($cookies + $nuts - $both) / 100;
34+
$safe = 1 - $allergic;
35+
36+
BEGIN_PGML
37+
In a box of assorted cookies, [$cookies]% contain chocolate, [$nuts]%
38+
contain nuts, and [$both]% contain both chocolate and nuts. [$p] is
39+
allergic to both chocolate and nuts.
40+
41+
a) What is the probability that a cookie contains chocolate or nuts
42+
(they can't eat it)? [___________]{Percent($allergic)}
43+
b) What is the probability that a cookie does not contain chocolate or nuts
44+
(they can eat it)? [___________]{Percent($safe)}
45+
END_PGML
46+
47+
ENDDOCUMENT();
48+
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# DESCRIPTION
2+
# A problem that asks students to ...
3+
#
4+
# This problem is derived from a homework problem in Introductory Statistics,
5+
# licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0).
6+
# Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu
7+
# ENDDESCRIPTION
8+
9+
## DBsubject(Probability)
10+
## DBchapter(Sample Space)
11+
## DBsection(Probability: direct computation, inclusion/exclusion)
12+
## Institution(Fitchburg State University)
13+
## Author(Rachael Norton)
14+
15+
DOCUMENT();
16+
loadMacros(
17+
"PGstandard.pl", "PGML.pl",
18+
"contextPercent.pl", "niceTables.pl",
19+
'contextFraction.pl', 'PGcourse.pl'
20+
);
21+
22+
Context("Percent");
23+
24+
$cupchocolate = random(16, 24);
25+
$conechocolate = random(76, 84);
26+
$cupvanilla = random(2, 8);
27+
$conevanilla = random(11, 19);
28+
$cupswirl = random(11, 19);
29+
$coneswirl = random(60, 70);
30+
$cupstrawberry = random(1, 5);
31+
$conestrawberry = random(8, 16);
32+
33+
$cup = $cupchocolate + $cupvanilla + $cupswirl + $cupstrawberry;
34+
$cone = $conechocolate + $conevanilla + $coneswirl + $conestrawberry;
35+
$chocolate = $cupchocolate + $conechocolate;
36+
$vanilla = $cupvanilla + $conevanilla;
37+
$swirl = $cupswirl + $coneswirl;
38+
$strawberry = $cupstrawberry + $conestrawberry;
39+
40+
$total = $cup + $cone;
41+
42+
BEGIN_PGML
43+
A soft-serve ice cream shop sold [$total] ice creams in a day. The following
44+
table identifies the ice creams they sold by flavor and whether they were
45+
served in a cup or cone. Fill in the missing values.
46+
47+
[@ DataTable(
48+
[
49+
['Flavor', 'Chocolate', 'Vanilla', 'Swirl', 'Strawberry', 'Total'],
50+
['Cup', $cupchocolate, PGML('[____]{$cupvanilla}'), $cupswirl, $cupstrawberry, $cup],
51+
['Cone', $conechocolate, $conevanilla, PGML('[____]{$coneswirl}'), $conestrawberry, PGML('[____]{$cone}')],
52+
['Total', PGML('[____]{$chocolate}'), $vanilla, PGML('[____]{$swirl}'), PGML('[____]{$strawberry}'), PGML('[____]{$total}')],
53+
],
54+
padding => [0.5, 0.5],
55+
align => '|c|c|c|c|c|c|',
56+
horizontalrules => 1)
57+
@]*
58+
59+
a) What is the probability that a randomly selected ice cream was served in a cup? [____]{$cup/$total}
60+
b) What is the probability that a randomly selected ice cream was either chocolate or swirl? [____]{($chocolate+$swirl)/$total}
61+
c) What is the probability that a randomly selected ice cream was chocolate served in a cup? [____]{$cupchocolate/$total}
62+
d) What is the probability that a randomly selected ice cream was strawberry, given that it was served in a cone? [____]{$conestrawberry/$cone}
63+
e) What is the probability that a randomly selected ice cream was not chocolate? [____]{($total-$chocolate)/$total}
64+
END_PGML
65+
66+
ENDDOCUMENT();
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#DESCRIPTION
2+
## Algebra: Probability
3+
##ENDDESCRIPTION
4+
5+
## DBsubject(Probability)
6+
## DBchapter(Sample Space)
7+
## DBsection(Conditional probability -- direct)
8+
## Date(05/03/2012)
9+
## Institution(University of Minnesota)
10+
## Author(Justin Sukiennik)
11+
## Level(3)
12+
## MO(1)
13+
## TitleText1('Algebra for College Students')
14+
## AuthorText1('Kaufmann, Schwitters')
15+
## EditionText1('8')
16+
## Section1('15.4')
17+
## Problem1('38')
18+
## KEYWORDS('algebra', 'probability','DEI')
19+
20+
DOCUMENT();
21+
22+
loadMacros(
23+
'PGstandard.pl', 'PGML.pl',
24+
'niceTables.pl', 'contextFraction.pl',
25+
'PGcourse.pl'
26+
);
27+
28+
Context('Fraction');
29+
30+
$a = list_random(20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33);
31+
$c = list_random(15, 20, 30, 35);
32+
33+
$b = Compute("50-$a");
34+
$d = Compute("50-$c");
35+
36+
$e = Compute("$a+$c");
37+
$f = Compute("$b+$d");
38+
39+
$ans1 = Fraction(100 - $d, 100);
40+
$ans2 = Fraction(100 - $a, 100);
41+
$ans3 = Fraction(100 - $b, 100);
42+
43+
#####################################################################
44+
45+
BEGIN_PGML
46+
One hundred nurses were surveyed about their living situation. The results of this survey are given in the following table.
47+
48+
>>
49+
[@ DataTable([
50+
['',PGML('_Renter_ (`R`)'), PGML('_Homeowner_ ([`R^{\prime}`])'), PGML('_Total_')],
51+
[PGML('Lives Alone (`A`)'),$a,$b,'50'],
52+
[PGML('Does not live alone (`A^{\prime}`)'), $c, $d, '50'],
53+
[PGML('Total'), $e, $f, 100]
54+
],
55+
padding => [0.5, 0.5],
56+
align => '|l|c|c|c|',
57+
horizontalrules => 1
58+
) @]* <<
59+
60+
61+
If a nurse is selected at random from those surveyed, find the probability of each of the following events.
62+
63+
a) The nurse is a renter or lives alone.
64+
Answer: [_]{$ans1}{20}
65+
66+
b) The nurse is a homeowner or does not live alone.
67+
Answer: [_]{$ans2}{20}
68+
69+
c) The nurse is a renter or does not live alone.
70+
Answer: [_]{$ans3}{20}
71+
END_PGML
72+
73+
ENDDOCUMENT();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## DESCRIPTION
2+
## A problem that asks students to find probabilities of even numbers or colors
3+
## of cards.
4+
##
5+
## This problem is derived from a homework problem in Introductory Statistics,
6+
## licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0).
7+
## Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu
8+
## ENDDESCRIPTION
9+
10+
## DBsubject(Probability)
11+
## DBchapter(Sample Space)
12+
## DBsection(Outcomes & events)
13+
## Institution(Fitchburg State University)
14+
## Author(Michael Stassen)
15+
## KEYWORDS('DEI', 'events', 'conditional probability')
16+
## updated by Rachael Norton and Peter Staab, Fitchburg State University,
17+
## January 2023
18+
19+
DOCUMENT();
20+
loadMacros("PGstandard.pl", "PGML.pl", 'contextFraction.pl', 'PGcourse.pl');
21+
Context('Fraction');
22+
23+
($color1, $color2) =
24+
random_subset(2, 'red', 'gray', 'yellow', 'blue', 'purple');
25+
26+
do {
27+
$num1 = random(5, 9);
28+
$num2 = random(5, 9);
29+
} until ($num1 != $num2);
30+
$total = $num1 + $num2;
31+
32+
$even1 = $num1 % 2 == 0 ? $num1 / 2 : ($num1 - 1) / 2;
33+
$even2 = $num2 % 2 == 0 ? $num2 / 2 : ($num2 - 1) / 2;
34+
35+
$ans1 = Fraction($num1, $total);
36+
$ans2 = Fraction($even1 + $even2, $total);
37+
$ans3 = Fraction($even1, $total);
38+
$ans4 = Fraction($num1 + $even2, $total);
39+
$ans5 = Fraction($even1, $even1 + $even2);
40+
$ans6 = Fraction($even1, $num1);
41+
42+
BEGIN_PGML
43+
Suppose that you have [$total] cards. [$num1] are [$color1] and [$num2] are
44+
[$color2]. The [$color1] cards are numbered 1, 2, 3, ..., [$num1].
45+
The [$color2] cards are numbered 1, 2, 3, ... [$num2]. The cards are
46+
well shuffled. You randomly draw one card.
47+
48+
* [`G`] = the event the card drawn is [$color1]
49+
* [`E`] = the event the card drawn is even-numbered
50+
51+
a) [`P(G)`] = [__]{$ans1}
52+
b) [`P(E)`] = [__]{$ans2}
53+
c) [`P(G\text{ and }E)`] = [__]{$ans3}
54+
d) [`P(G\text{ or }E)`] = [__]{$ans4}
55+
e) [`P(G|E)`] = [__]{$ans5}
56+
f) [`P(E|G)`] = [__]{$ans6}
57+
END_PGML
58+
59+
ENDDOCUMENT();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## DESCRIPTION
2+
## A problem that asks students to find basic and conditional probabilities
3+
## of numbered and colored cards.
4+
##
5+
## This problem is derived from a homework problem in Introductory Statistics,
6+
## licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0).
7+
## Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu
8+
## ENDDESCRIPTION
9+
10+
## DBsubject(Probability)
11+
## DBchapter(Sample Space)
12+
## DBsection(Probability: direct computation, inclusion/exclusion)
13+
## Institution(Fitchburg State University)
14+
## Author(Michael Stassen)
15+
## KEYWORDS('DEI')
16+
## updated by Rachael Norton and Peter Staab, Fitchburg State University, January 2023
17+
18+
DOCUMENT();
19+
loadMacros("PGstandard.pl", "PGML.pl", 'contextFraction.pl', 'PGcourse.pl');
20+
21+
Context('Fraction');
22+
23+
($color1, $color2) =
24+
random_subset(2, 'red', 'gray', 'yellow', 'blue', 'purple');
25+
26+
$num1 = random(5, 11, 1);
27+
$num2 = random(3, $gray, 1);
28+
$total = $num1 + $num2;
29+
30+
$ans1 = Fraction($num1**2, $total**2);
31+
$ans2 = Fraction($total**2 - $num2**2, $total**2);
32+
$ans3 = Fraction($num1, $total);
33+
34+
BEGIN_PGML
35+
Suppose that you have [$total] cards. [$num1] are [$color1] and [$num2] are
36+
[$color2]. The cards are well shuffled. You randomly draw two cards,
37+
*with replacement*.
38+
39+
* [`G_1`] = the event the first card drawn is [$color1]
40+
* [`G_2`] = the event the second card drawn is [$color1]
41+
* [`E`] = the event at least one card is [$color1].
42+
43+
a) [`P(G_1\text{ and }G_2)`] = [__]{$ans1}
44+
b) [`P(E)`] = [__]{$ans2}
45+
c) [`P(G_2|G_1)`] = [__]{$ans3}
46+
END_PGML
47+
48+
ENDDOCUMENT();
49+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# DESCRIPTION
2+
# A problem that asks students to ...
3+
#
4+
# This problem is derived from a homework problem in Introductory Statistics,
5+
# licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0).
6+
# Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu
7+
# ENDDESCRIPTION
8+
9+
## DBsubject(Statistics)
10+
## DBchapter(Confidence intervals)
11+
## DBsection(One sample mean - z)
12+
## Institution(Fitchburg State University)
13+
## Author(Michael Stassen)
14+
15+
DOCUMENT();
16+
loadMacros(
17+
'PGstandard.pl', "PGML.pl",
18+
"contextPercent.pl", "PGstatisticsmacros.pl",
19+
'PGcourse.pl'
20+
);
21+
22+
Context("LimitedNumeric");
23+
loadMacros("fixedPrecision.pl"); # must come after Context is set.
24+
25+
$conf = list_random(90, 95);
26+
$alpha = 1 - $conf / 100;
27+
28+
$x = random(5, 9);
29+
$n = random(65, 70);
30+
31+
Context("Percent");
32+
Context()->flags->set(
33+
decimalPlaces => 1,
34+
tolerance => .05,
35+
);
36+
$p = $x / $n;
37+
$q = 1 - $p;
38+
39+
$z = normal_distr(0.5 - $alpha / 2);
40+
41+
$E = $z * sqrt($p * $q / $n);
42+
43+
$p1 = 100 * ($p - $E);
44+
$p2 = 100 * ($p + $E);
45+
46+
BEGIN_PGML
47+
In six packages of "The Flintstones Real Fruit Snacks" there were [$x] Bam-Bam
48+
snack pieces. The total number of snack pieces in the six bags was [$n]. We wish
49+
to calculate a [$conf]% confidence interval for the population proportion of Bam-Bam
50+
snack pieces. (Round percents to the nearest 0.1%)
51+
52+
a. What is the sample size?[____]{$n}
53+
b. What is the sample proportion?[____]{$p}
54+
c. What is the margin of error for a [$conf]% confidence interval?[____]{$E}
55+
d. The [$conf]% confidence interval is from [____]{$p1} to [____]{$p2}.
56+
57+
END_PGML
58+
59+
ENDDOCUMENT();

0 commit comments

Comments
 (0)