Calculate relative frequencies in a variety of scenarios.

"}, "functions": {}, "ungrouped_variables": ["no_people", "free_range", "no_students", "rel_freq", "dog", "cat", "hamster", "parrot", "n"], "parts": [{"minValue": "{free_range}/{no_people}", "scripts": {}, "customMarkingAlgorithm": "", "precisionMessage": "You must give your answer as a decimal to 2 decimal places.

", "mustBeReducedPC": 0, "precisionType": "dp", "showPrecisionHint": true, "prompt": "$\\var{no_people}$ people were asked whether they preferred to buy free-range eggs or caged eggs in supermarkets. $\\var{free_range}$ people said that they preferred to buy free-range eggs. What is the relative frequency of people who prefer buying free-range eggs? Give your answer as a decimal, to $2$ decimal places.

\n", "type": "numberentry", "variableReplacements": [], "allowFractions": false, "correctAnswerStyle": "plain", "strictPrecision": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "precision": "2", "unitTests": [], "correctAnswerFraction": false, "showFeedbackIcon": true, "maxValue": "{free_range}/{no_people}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "showCorrectAnswer": true, "precisionPartialCredit": 0}, {"minValue": "{no_students}*{rel_freq}", "scripts": {}, "customMarkingAlgorithm": "", "precisionMessage": "Round your answer to the nearest integer.

", "mustBeReducedPC": 0, "precisionType": "dp", "showPrecisionHint": true, "prompt": "The heights of a class of students were measured. The relative frequency of a student being taller than $150$ cm is known to be $\\var{rel_freq}$. If there are $\\var{no_students}$ students in the class, estimate the number of students who are taller than $150$ cm.

", "type": "numberentry", "variableReplacements": [], "allowFractions": false, "correctAnswerStyle": "plain", "strictPrecision": false, "extendBaseMarkingAlgorithm": true, "marks": 1, "precision": 0, "unitTests": [], "correctAnswerFraction": false, "showFeedbackIcon": true, "maxValue": "{no_students}*{rel_freq}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "showCorrectAnswer": true, "precisionPartialCredit": 0}, {"marks": 0, "unitTests": [], "variableReplacements": [], "gaps": [{"marks": 1, "minValue": "{dog}+{cat}+{hamster}+{parrot}", "unitTests": [], "correctAnswerFraction": false, "variableReplacements": [], "maxValue": "{dog}+{cat}+{hamster}+{parrot}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "mustBeReduced": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true}, {"minValue": "{dog}/({dog}+{cat}+{hamster}+{parrot})", "scripts": {}, "customMarkingAlgorithm": "", "precisionMessage": "Round your answer to 2 decimal places.

", "precisionType": "dp", "showPrecisionHint": true, "precisionPartialCredit": 0, "type": "numberentry", "variableReplacements": [], "allowFractions": false, "correctAnswerStyle": "plain", "strictPrecision": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "precision": "2", "unitTests": [], "correctAnswerFraction": false, "showFeedbackIcon": true, "maxValue": "{dog}/({dog}+{cat}+{hamster}+{parrot})", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0}], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "prompt": "A survey was conducted to find out what type of pet is the most common. The results are given in the table below.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nType of Pet | Frequency |

Dog | $\\var{dog}$ |

Cat | $\\var{cat}$ |

Hamster | $\\var{hamster}$ |

Parrot | \n $\\var{parrot}$ \n |

*i) *

What was the sample size for the survey?

\n[[0]]

\n*ii)*

What is the relative frequency of a person having a dog as a pet? Give your answer as a decimal, to $2$ decimal places.

\n[[1]]

\n", "scripts": {}, "type": "gapfill", "showCorrectAnswer": true, "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true}], "variable_groups": [], "variables": {"cat": {"definition": "random(10..50 except dog)", "templateType": "anything", "name": "cat", "description": "Frequency of cat in part c.

", "group": "Ungrouped variables"}, "free_range": {"definition": "random(10..40)", "templateType": "anything", "name": "free_range", "description": "Number of people who prefer free-range eggs in part a)

", "group": "Ungrouped variables"}, "no_students": {"definition": "random(20..40 #10)", "templateType": "anything", "name": "no_students", "description": "Number of students in the class for part b

", "group": "Ungrouped variables"}, "hamster": {"definition": "random(10..40 except dog except cat) ", "templateType": "anything", "name": "hamster", "description": "Frequency of hamster in part c

", "group": "Ungrouped variables"}, "rel_freq": {"definition": "random(0.1..0.9 # 0.01)", "templateType": "anything", "name": "rel_freq", "description": "Relative frequency for part b

", "group": "Ungrouped variables"}, "no_people": {"definition": "random(50..150 #10)", "templateType": "anything", "name": "no_people", "description": "Number of people asked in part a)

", "group": "Ungrouped variables"}, "parrot": {"definition": "random(10..50 except dog except cat except hamster)", "templateType": "anything", "name": "parrot", "description": "Frequency of guinea pig in part c.

", "group": "Ungrouped variables"}, "n": {"definition": "dog+cat+hamster+parrot", "templateType": "anything", "name": "n", "description": "Sample size for part c

", "group": "Ungrouped variables"}, "dog": {"definition": "random(10..50)", "templateType": "anything", "name": "dog", "description": "Frequency of dog in part c

", "group": "Ungrouped variables"}}, "rulesets": {}, "preamble": {"js": "", "css": ""}, "tags": [], "statement": "The relative frequency of an outcome is the frequency of the outcome divided by the number of trials.

", "advice": "The relative frequency of an outcome is the frequency of the outcome divided by the number of trials.

\nWe are told that $\\var{no_people}$ people were asked whether they preferred to buy free-range eggs or caged eggs in supermarkets and that $\\var{free_range}$ of these people said that they preferred to buy free-range eggs.

\nTo calculate the relative frequency of people who prefer buying free-range eggs we need the number of trials and the frequency of people who said that they preferred buying free-range eggs.

\nSo, the number of trials in this situation is the number of people who were asked the question, which is $\\var{no_people}$.

\nThe frequency of people who said that they preferred to buy free-range eggs is $\\var{free_range}$.

\nTherefore, the relative frequency of people who prefer buying free-range eggs is

\n\\[

\\frac{\\var{free_range}}{\\var{no_people}} = \\var{dpformat({free_range/no_people}, 2)} \\; (\\text{rounded to $2$ decimal places}).

\\]

We are told that the relative frequency of a student being taller than $150$ cm is $\\var{rel_freq}$.

\nHere, we must use the formula for relative frequency in reverse in order to estimate the number of students in the class who are taller than $150$ cm.

\nAs we are using relative frequency to calculate this number, our answer may not be completely accurate, therefore our answer will be an estimate of the actual number.

\nIf we let $n$ denote the number of students in the class who are taller than $150$ cm and if there are $\\var{no_students}$ students in the class then

\n\\[

\\begin{align}

\\frac{n}{\\var{no_students}} &= \\var{rel_freq}\\\\

n &= \\var{rel_freq} \\times \\var{no_students}\\\\

&= \\var{{rel_freq}*{no_students}}.

\\end{align}

\\]

As $n$ represents a number of people we must round our value of $n$ to the nearest integer.

\nSo, the estimated number of students in the class who are taller than $150$ cm is $\\var{dpformat({rel_freq}*{no_students},0)}$.

\n* *

*i) *

Using the frequency table given in the question, we can calculate the sample size of the survey by adding together the frequencies of each of the different types of pets.

\nSo, the sample size of the survey is

\n\\[

\\var{dog}+\\var{cat}+\\var{hamster}+\\var{parrot} = \\var{{dog}+{cat}+{hamster}+{parrot}}.

\\]

*ii) *

To calculate the relative frequency of a person having a dog as a pet, we divide the frequency of people in the survey who had a dog as a pet by the sample size of the survey.

\nSo, the relative frequency is

\n\\[

\\frac{\\var{dog}}{\\var{n}} = \\var{dpformat({dog/n}, 2)} \\; (\\text{rounded to $2$ decimal places}).

\\]

Two unbiased, 6-sided dice were rolled together and the total of the numbers shown on the faces was recorded.

\nThe experiment was repeated $\\var{no_rolls}$ times.

\nThis table gives the frequency of each outcome.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTotal | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
---|---|---|---|---|---|---|---|---|---|---|---|

Frequency | $\\var{Freq[0]}$ | $\\var{Freq[1]}$ | $\\var{Freq[2]}$ | $\\var{Freq[3]}$ | $\\var{Freq[4]}$ | $\\var{Freq[5]}$ | $\\var{Freq[6]}$ | $\\var{Freq[7]}$ | $\\var{Freq[8]}$ | $\\var{Freq[9]}$ | $\\var{Freq[10]}$ |

List of Frequencies for theoretical probability.

", "templateType": "anything", "definition": "[1,2,3,4,5,6,5,4,3,2,1]"}, "sum": {"group": "Ungrouped variables", "name": "sum", "description": "Sums obtained from no_rolls of two dice part a)

", "templateType": "anything", "definition": "repeat(random(2..12), no_rolls)"}, "gcd2": {"group": "Ungrouped variables", "name": "gcd2", "description": "Gcd for answer in part a) ii)

", "templateType": "anything", "definition": "gcd(Freq2[x[0]],36)"}, "gcd1": {"group": "Ungrouped variables", "name": "gcd1", "description": "Gcd of numerator and denominator for advice for part a) i).

", "templateType": "anything", "definition": "gcd(Freq[sum[0]-2], no_rolls)"}, "die": {"group": "Ungrouped variables", "name": "die", "description": "number the die lands on in part a)

", "templateType": "anything", "definition": "[2,3,4,5,6,7,8,9,10,11,12]"}, "Freq": {"group": "Ungrouped variables", "name": "Freq", "description": "Frequencies of each possible sum of numbers from rolling 2 die. part a

", "templateType": "anything", "definition": "map(\nlen(filter(x=j,x,sum)),\nj, 2..12)"}, "add": {"group": "Ungrouped variables", "name": "add", "description": "", "templateType": "anything", "definition": "random(-5..5 except -1 except 1 except 0)"}, "no_rolls": {"group": "Ungrouped variables", "name": "no_rolls", "description": "Number of rolls of the die in part a.

", "templateType": "anything", "definition": "random(50..100 #10)"}, "remainder": {"group": "Ungrouped variables", "name": "remainder", "description": "", "templateType": "anything", "definition": "(ceil(10000/36)+add)+(ceil(10000/18)+add)+(ceil(2500/3)+add)+(ceil(10000/9)+add)+(ceil(12500/9)+add)+(ceil(12500/9)-add)+(ceil(10000/9)-add)+(ceil(2500/3)-add)+(ceil(5000/9)-add)+(ceil(2500/9)-add)"}, "x": {"group": "Ungrouped variables", "name": "x", "description": "Index for part a.

", "templateType": "anything", "definition": "indices(die, sum[0])"}}, "functions": {}, "tags": ["dice", "Dice", "Experimental probability", "Experimental Probability", "experimental probability", "Probability", "probability", "sum of two dice", "taxonomy", "theoretical probability", "Theoretical Probability"], "variable_groups": [], "parts": [{"scripts": {}, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "gaps": [{"correctAnswerFraction": true, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": true, "maxValue": "{Freq[{sum[0]}-2]}/{no_rolls}", "showFeedbackIcon": true, "minValue": "{Freq[{sum[0]}-2]}/{no_rolls}", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "marks": 1, "showCorrectAnswer": true}], "showCorrectAnswer": true, "prompt": "Find the experimental probability of rolling a total of $\\var{sum[0]}$.

\nEnter your answer as a fraction.

\n[[0]]

", "marks": 0}, {"correctAnswerFraction": true, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": true, "maxValue": "{Freq2[{x[0]}]}/36", "showFeedbackIcon": true, "prompt": "Now calculate the theoretical probability that the sum of the scores of the two dice is $\\var{sum[0]}$.

\nEnter your answer as a fraction.

", "minValue": "{Freq2[{x[0]}]}/36", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "marks": 1, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "gaps": [{"scripts": {}, "minMarks": 0, "distractors": ["", ""], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "choices": ["gets closer to the theoretical probability

", "gets further away from the theoretical probability

"], "showFeedbackIcon": true, "shuffleChoices": true, "matrix": ["1", 0], "variableReplacements": [], "marks": 0, "displayColumns": 0, "showCorrectAnswer": true, "maxMarks": 0, "type": "1_n_2"}], "showCorrectAnswer": true, "prompt": "As the number of rolls of the two dice increases, the experimental probability [[0]]

\n", "marks": 0}], "ungrouped_variables": ["die", "no_rolls", "sum", "Freq", "Freq2", "x", "gcd1", "gcd2", "add", "remainder"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Compute the experimental probability of a particular score on a die given a sample of throws, and compare it with the theoretical probability.

\nThe last part asks what you expect to happen to the experimental probability as the sample size increases.

"}, "preamble": {"css": "", "js": ""}, "advice": "There are two ways of assigning probability:

\n- \n
**Experimental Probability**is where you do an experiment, observe the outcome and record the relative frequency results. \n**Theoretical Probability**is where the probability is calculated based on fairness and symmetrical properties of the results. \n

To calculate the experimental probability (relative frequency) of an outcome we divide the frequency of the outcome in the experiment by the number of trials.

\nWe are given that the experiment was repeated $\\var{no_rolls}$ times.

\nWe then need the number of times that the sum of the faces of the dice was equal to $\\var{sum[0]}$. From the frequency table, we can see that the frequency of rolling a $\\var{sum[0]}$ in the experiment was $\\var{Freq[sum[0]-2]}$.

\nTherefore, the experimental probability of rolling a $\\var{sum[0]}$ is

\n\\[ \\begin{align} P(\\text{total}=\\var{sum[0]}) &= \\displaystyle\\frac{\\text{number of times a total of $\\var{sum[0]}$ was rolled}}{\\text{total number of rolls}}\\\\&= \\displaystyle\\frac{\\var{Freq[sum[0]-2]}}{\\var{no_rolls}}.\\end{align}\\]

\n\\[\\begin{align} P(\\text{total}=\\var{sum[0]}) &= \\displaystyle\\frac{\\text{number of times a total of $\\var{sum[0]}$ was rolled}}{\\text{total number of rolls}}\\\\&= \\displaystyle\\frac{\\var{Freq[sum[0]-2]}}{\\var{no_rolls}}\\\\&= \\displaystyle\\var[fractionNumbers, simplifyFractions]{{Freq[sum[0]-2]/no_rolls}}.\\end{align}\\]

\nWhen two unbiased 6-sided dice are rolled and their scores are added, there are $11$ possible outcomes: the total must be between $2$ and $12$ inclusive.

\nTo work out the probabilities of each outcome occurring, we must be very careful about how the experiment is performed.

\nThere are a total of $36$ different outcomes when rolling two dice one after the other; these are shown in Table $1$.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n1 | 2 | 3 | 4 | 5 | 6 | |
---|---|---|---|---|---|---|

1 | (1,1) | (1,2) | (1,3) | (1,4) | (1,5) | (1,6) |

2 | (2,1) | (2,2) | (2,3) | (2,4) | (2,5) | (2,6) |

3 | (3,1) | (3,2) | (3,3) | (3,4) | (3,5) | (3,6) |

4 | (4,1) | (4,2) | (4,3) | (4,4) | (4,5) | (4,6) |

5 | (5,1) | (5,2) | (5,3) | (5,4) | (5,5) | (5,6) |

6 | (6,1) | (6,2) | (6,3) | (6,4) | (6,5) | (6,6) |

Note that these outcomes are all different. For example, the outcomes (2,1) and (1,2) are not the same because we know the order in which the dice were thrown so we can distinguish between these two outcomes; when the first die lands on $2$ and the second die lands on $1$ the outcome is (2,1), however when the first die lands on $1$ and the second die lands on $2$ the outcome is (1,2).

\nThe sum of the numbers in these outcomes is the same, we just count them as different outcomes.

\nAny one of these $36$ outcomes is equally likely to occur, so the probability of each of these outcomes is $\\displaystyle\\frac{1}{36}$.

\nHowever, if you roll two indistinguishable dice at the same time, you can't differentiate (a 1 and a 2) from (a 2 and a 1). From your point of view, they are the same outcome. The probabilities of the underlying events (each die's score) haven't changed, but the outcomes you observe have.

\nIn this case you have a total of $21$ outcomes; these outcomes are *not* all equally likely. There's only one way of obtaining two 1s, while there are two ways of obtaining a 1 and a 2, corresponding to two squares in Table $1$. Hence the probability of obtaining two 1s would be $\\displaystyle\\frac{1}{36}$, whereas the probability of obtaining a 1 and a 2 would be

\\[\\displaystyle\\frac{2}{36}=\\displaystyle\\frac{1}{18}.\\]

\nYou *can* do the experiment this way, but it's easier when you can tell the dice apart.

Table $2$ shows the corresponding total of the faces of the dice for each of the outcomes in Table $1$.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n+ | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|

1 | 2 | 3 | 4 | 5 | 6 | 7 |

2 | 3 | 4 | 5 | 6 | 7 | 8 |

3 | 4 | 5 | 6 | 7 | 8 | 9 |

4 | 5 | 6 | 7 | 8 | 9 | 10 |

5 | 6 | 7 | 8 | 9 | 10 | 11 |

6 | 7 | 8 | 9 | 10 | 11 | 12 |

For equally likely outcomes you can calculate the probability using the formula

\n\\[\\text{Probability of an event} = \\displaystyle\\frac{\\text{number of favourable outcomes}}{\\text{total number of outcomes}}.\\]

\nTable $3$ gives the theoretical probabilities of each of the possible totals of the two dice occurring:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTotal | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Probability | $\\displaystyle\\frac{1}{36}$ | $\\displaystyle\\frac{2}{36}$ | $\\displaystyle\\frac{3}{36}$ | $\\displaystyle\\frac{4}{36}$ | $\\displaystyle\\frac{5}{36}$ | $\\displaystyle\\frac{6}{36}$ | $\\displaystyle\\frac{5}{36}$ | $\\displaystyle\\frac{4}{36}$ | $\\displaystyle\\frac{3}{36}$ | $\\displaystyle\\frac{2}{36}$ | $\\displaystyle\\frac{1}{36}$ |

\\[P(\\text{total}=\\var{sum[0]}) = \\displaystyle\\frac{\\var{Freq2[x[0]]}}{36}.\\]

\\[\\begin{align} P(\\text{total}=\\var{sum[0]}) &= \\displaystyle\\frac{\\var{Freq2[x[0]]}}{36}\\\\ &= \\displaystyle\\var[fractionNumbers,simplifyFractions]{Freq2[x[0]]/36}. \\end{align}\\]

\nFor any experiment, as we make the number of trials very large the experimental probability tends towards the theoretical probability.

\nFor this experiment, for example, the theoretical probability of the sum of the faces of the two dice being $3$ is

\n\\[\\displaystyle\\frac{2}{36} = \\var{sigformat(1/18,3)} \\text{ (rounded to $3$ significant figures)}.\\]

\nIf we were to roll the two dice a very large number of times, for example $10000$ times, the frequencies of each outcome would be different.

\nThe table below was produced by the recording the frequency of each outcome after rolling the two dice 10,000 times.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTotal | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

\n Frequency \n | $\\var{ceil(10000/36)+{add}}$ | $\\var{ceil(10000/18)+{add}}$ | $\\var{ceil(2500/3)+{add}}$ | $\\var{ceil(10000/9)+{add}}$ | $\\var{ceil(12500/9)+{add}}$ | $\\var{10000-{remainder}}$ | $\\var{ceil(12500/9)-{add}}$ | $\\var{ceil(10000/9)-{add}}$ | $\\var{ceil(2500/3)-{add}}$ | $\\var{ceil(5000/9)-{add}}$ | $\\var{ceil(2500/9)-{add}}$ |

This means that the new experimental probability of the sum of the faces of the two dice being $3$ is

\n\\[\\displaystyle\\frac{\\var{ceil(10000/18) + {add}}}{10000} = \\var{sigformat((ceil(10000/18)+{add})/10000,3)} \\text{ (rounded to $3$ significant figures)}.\\]

\nThis is very close to the theoretical probability, so we can see how the experimental probability changes as we increases the number of trials.

"}, {"name": "Stem and Leaf Plot", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}], "functions": {"join_numbers": {"language": "jme", "parameters": [["numbers", "list"]], "type": "string", "definition": "'^\\\\s*'+join(numbers,'(\\\\s+|\\\\s*,\\\\s*)')+'\\\\s*,?\\\\s*$'"}}, "ungrouped_variables": ["d", "dsort", "d_unit_value"], "variables": {"dsort": {"name": "dsort", "templateType": "anything", "definition": "sort(d)", "group": "Ungrouped variables", "description": ""}, "d_unit_value": {"name": "d_unit_value", "templateType": "anything", "definition": "[dsort[0]-10,dsort[1]-10,dsort[2]-10,dsort[3]-10,dsort[4]-10,dsort[5]-20,dsort[6]-20,dsort[7]-30,dsort[8]-40,dsort[9]-50]", "group": "Ungrouped variables", "description": "Returns list of values of units of numbers in list for the unit part of the stem and leaf diagram.

"}, "d": {"name": "d", "templateType": "anything", "definition": "shuffle(repeat(random(10..19),5) + repeat(random(20..29),2)+repeat(random(30..39),1)+repeat(random(40..49),1)+repeat(random(50..59),1))", "group": "Ungrouped variables", "description": ""}}, "variable_groups": [], "parts": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "gaps": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "answer": "{d_unit_value[0]},{d_unit_value[1]},{d_unit_value[2]},{d_unit_value[3]},{d_unit_value[4]}", "showFeedbackIcon": true, "unitTests": [], "customMarkingAlgorithm": "", "displayAnswer": "{d_unit_value[0]},{d_unit_value[1]},{d_unit_value[2]},{d_unit_value[3]},{d_unit_value[4]}", "type": "patternmatch", "marks": "1", "extendBaseMarkingAlgorithm": true, "matchMode": "regex", "variableReplacements": []}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "answer": "{d_unit_value[5]},{d_unit_value[6]}", "showFeedbackIcon": true, "unitTests": [], "customMarkingAlgorithm": "", "displayAnswer": "{d_unit_value[5]},{d_unit_value[6]}", "type": "patternmatch", "marks": "1", "extendBaseMarkingAlgorithm": true, "matchMode": "regex", "variableReplacements": []}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "answer": "{d_unit_value[7]}", "showFeedbackIcon": true, "unitTests": [], "customMarkingAlgorithm": "", "displayAnswer": "{d_unit_value[7]}", "type": "patternmatch", "marks": "1", "extendBaseMarkingAlgorithm": true, "matchMode": "regex", "variableReplacements": []}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "answer": "{d_unit_value[8]}", "showFeedbackIcon": true, "unitTests": [], "customMarkingAlgorithm": "", "displayAnswer": "{d_unit_value[8]}", "type": "patternmatch", "marks": "1", "extendBaseMarkingAlgorithm": true, "matchMode": "regex", "variableReplacements": []}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "answer": "{d_unit_value[9]}", "showFeedbackIcon": true, "unitTests": [], "customMarkingAlgorithm": "", "displayAnswer": "{d_unit_value[9]}", "type": "patternmatch", "marks": "1", "extendBaseMarkingAlgorithm": true, "matchMode": "regex", "variableReplacements": []}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "scripts": {}, "minValue": "10", "mustBeReduced": false, "showFeedbackIcon": true, "unitTests": [], "correctAnswerStyle": "plain", "maxValue": "10", "customMarkingAlgorithm": "", "type": "numberentry", "marks": 1, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "scripts": {}, "minValue": "1", "mustBeReduced": false, "showFeedbackIcon": true, "unitTests": [], "correctAnswerStyle": "plain", "maxValue": "1", "customMarkingAlgorithm": "", "type": "numberentry", "marks": 1, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "mustBeReducedPC": 0}], "prompt": "Construct a stem and leaf plot for these data. The \"stem\" is given; you should enter the \"leaves\" in the boxes to the right, separating neighbouring values with a comma.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n1 | [[0]] |
---|---|

2 | [[1]] |

3 | [[2]] |

4 | [[3]] |

5 | \n [[4]] \n |

What are the stem and leaf units?

\nStem unit = [[5]]

\nLeaf unit = [[6]]

", "showFeedbackIcon": true, "sortAnswers": false, "unitTests": [], "customMarkingAlgorithm": "", "type": "gapfill", "marks": 0, "extendBaseMarkingAlgorithm": true, "variableReplacements": []}], "metadata": {"licence": "None specified", "description": ""}, "statement": "The following data are points scored by rugby team Newcastle Sparrows in their last $10$ matches.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n$\\var{d[0]}$ | $\\var{d[1]}$ | $\\var{d[2]}$ | $\\var{d[3]}$ | $\\var{d[4]}$ | $\\var{d[5]}$ | $\\var{d[6]}$ | $\\var{d[7]}$ | $\\var{d[8]}$ | $\\var{d[9]}$ |

Stem | Leaves | |
---|---|---|

1 | {d_unit_value[0]},{d_unit_value[1]},{d_unit_value[2]},{d_unit_value[3]},{d_unit_value[4]} | Corresponds to {dsort[0]},{dsort[1]},{dsort[2]},{dsort[3]} and {dsort[4]}. |

2 | {d_unit_value[5]},{d_unit_value[6]} | Corresponds to {dsort[5]} and {dsort[6]} |

3 | {d_unit_value[7]} | ...and so on. |

4 | {d_unit_value[8]} | |

5 | {d_unit_value[9]} |

The stem unit is $10$. The leaf unit is $1$.

", "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"js": "", "css": ".question table th {\nborder-right: 1px solid #000;\n}\n.question table td {\n text-align: left;\n}"}, "rulesets": {}, "type": "question"}]}], "showQuestionGroupNames": false, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Questions on the subtleties and pitfalls of methods of data collection.

"}, "name": "Data collection - original without context", "type": "exam", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}], "extensions": [], "custom_part_types": [], "resources": []}