// Numbas version: exam_results_page_options {"name": "Ugur's copy of Percentages and ratios - box of chocolates", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Ugur's copy of Percentages and ratios - box of chocolates", "tags": [], "metadata": {"description": "

A simple situational question about a box of chocolates, asking how many of each type there are, what percentage of the box they represent, the probability of picking one and ratios of different types.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "
\n
\n
\n

", "advice": "
\n

a)

\n

100% represents the whole box of chocolates. As there are 5 different kinds of chocolate in the box and they are all represented equally, to calculate the percentage chocolates which are caramel, divide 100 by 5.

\n

Caramel chocolate = $\\displaystyle\\frac{100}{5}$ = $20$% of the box.

\n

\n

\n

b) 

\n

The original number of chocolates in the box is stated. We worked out above that each type of chocolate makes up 20% of the box, so we need to work out 20% of {chocs}.

\n

To do this, either divide {chocs} by 100 and multiply by 20, OR multiply {chocs} by 0.2. The two methods will give the same result.

\n

Method 1: $\\displaystyle\\frac{\\var{chocs}}{100}$ x $20$ = $\\var{type}$;

\n

OR

\n

Method 2: $\\var{chocs}$ x $0.2$ = $\\var{type}$.

\n

\n

\n

c)

\n

There are now {type} fewer chocolates in the box, but the remaining chocolates now represent 100% of the box. There are now only 4 types of chocolate in it and there is still equal representation inside the box.

\n

Use the method from part a) to find out the equal share of each chocolate type.

\n

Each type = $\\displaystyle\\frac{100}{4}$ = $25$% of the box.

\n

\n

\n

d) 

\n

i)

\n

The first section asks you to compare plain chocolate and dark chocolate. It states that there are {p} plain chocolates and {d} dark chocolates left in the box.

\n

Insert the numbers of each into the gaps.

\n

Plain $\\var{p}$ : $\\var{d}$ Dark

\n

From this, we should look to see if this answer can be simplified down. To do this, we need to find the greatest common divisor of $\\var{p}$ and $\\var{d}$. 

\n

The greatest common divisor is $\\var{gcd}$.

\n

Using this value to simplify down the ratio by dividing each term by the value, the final answer is

\n

Plain $\\var{ratio_plain}$ : $\\var{ratio_dark}$ Dark.

\n

This states that for every {ratio_plain} plain {if(ratio_plain=1,\"chocolate\",\"chocolates\")}, there {if(ratio_dark=1,\"is\",\"are\")} {ratio_dark} dark {if(ratio_dark=1,\"chocolate\",\"chocolates\")}.

\n

Therefore, it is not possible to simplify further and the final answer is

\n

Plain $\\var{p}$ : $\\var{d}$ Dark.

\n

This states that for every {p} plain {if(p=1,\"chocolate\",\"chocolates\")}, there {if(d=1,\"is\",\"are\")}{d} dark {if(d=1,\"chocolate\",\"chocolates\")}.

\n

\n

ii)

\n

The second section asks you to compare coconut chocolates and the rest of the box. It states that there are {c} coconut chocolates. To calculate the number of chocolates in the rest of the box, add together the stated amounts of plain, dark and nutty chocolates:

\n

$\\var{p}+\\var{d}+\\var{n}$ = $\\var{rob}$.

\n

Insert these two figures into the gaps.

\n

Coconut $\\var{c}$ : $\\var{rob}$ Other chocolates

\n

From this, we should look to see if this answer can be simplified down. To do this, we need to find the greatest common divisor of $\\var{c}$ and $\\var{rob}$. 

\n

The greatest common divisor is $\\var{gcd2}$.

\n

Using this value to simplify down the ratio by dividing each term by the value, the final answer is

\n

Coconut $\\var{ratio_coconut}$ : $\\var{ratio_rest}$ Other chocolates.

\n

This states that for every {ratio_coconut} coconut {if(ratio_coconut=1,\"chocolate\",\"chocolates\")}, there {if(ratio_rest=1,\"is\",\"are\")} {ratio_rest} other {if(ratio_rest=1,\"chocolate\",\"chocolates\")} in the box.

\n

Therefore, it is not possible to simplify further and the final answer is 

\n

Coconut $\\var{c}$ : $\\var{rob}$ Other chocolates.

\n

This states that for every {c} coconut {if(c=1,\"chocolate\",\"chocolates\")}, there {if(rob=1,\"is\",\"are\")} {rob} other {if(rob=1,\"chocolate\",\"chocolates\")} in the box.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"ratio_dark": {"name": "ratio_dark", "group": "Ungrouped variables", "definition": "d/gcd(p,d)", "description": "
\n

Number of dark chocolates in ratio of plain to dark.

", "templateType": "anything", "can_override": false}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "precround({n/{a},2)", "description": "
\n

Probability that a nutty chocolate is selected from the box on day 3.

", "templateType": "anything", "can_override": false}, "type": {"name": "type", "group": "Ungrouped variables", "definition": "chocs/5", "description": "
\n

Number of each type of chocolate in the box initially.

", "templateType": "anything", "can_override": false}, "minusc": {"name": "minusc", "group": "Ungrouped variables", "definition": "{chocs-type}", "description": "
\n

Number of chocolates in the box minus caramel.

", "templateType": "anything", "can_override": false}, "chocs": {"name": "chocs", "group": "Ungrouped variables", "definition": "random(70 .. 95#5)", "description": "
\n
\n

Total number of chocolates in the box before eating.

", "templateType": "randrange", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "p+n+d+c", "description": "
\n
\n

Number of chocolates in the box on day 3.

", "templateType": "anything", "can_override": false}, "gcd2": {"name": "gcd2", "group": "Ungrouped variables", "definition": "gcd(c,rob)", "description": "
\n

", "templateType": "anything", "can_override": false}, "perc": {"name": "perc", "group": "Ungrouped variables", "definition": "100*(prob)", "description": "
\n

Percentage version of probability.

", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(1..14 except 7 except 11 except 13)", "description": "
\n
\n

Number of nutty chocolates on day 3.

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(1..3)*p", "description": "
\n
\n

Number of dark chocolates on day 3.

", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "
\n
\n

Number of plain chocolates on day 3.

", "templateType": "anything", "can_override": false}, "ratio_coconut": {"name": "ratio_coconut", "group": "Ungrouped variables", "definition": "c/gcd(c, rob)", "description": "
\n

Number of coconut chocolates in ratio of coconut to rest of box.

", "templateType": "anything", "can_override": false}, "ratio_plain": {"name": "ratio_plain", "group": "Ungrouped variables", "definition": "p/gcd(p,d)", "description": "
\n

Number of plain chocolates in ratio of plain to dark.

", "templateType": "anything", "can_override": false}, "rob": {"name": "rob", "group": "Ungrouped variables", "definition": "p+n+d", "description": "
\n
\n
\n

Sum of the rest of the box excluding coconut.

", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(1..14 except 7 except 11 except 13)", "description": "
\n
\n
\n

Number of coconut chocolates on day 3.

", "templateType": "anything", "can_override": false}, "ratio_rest": {"name": "ratio_rest", "group": "Ungrouped variables", "definition": "rob/gcd(c, rob)", "description": "
\n

Number of 'rest of box' chocolates in ratio of coconut to rest of box.

", "templateType": "anything", "can_override": false}, "gcd": {"name": "gcd", "group": "Ungrouped variables", "definition": "gcd(p,d)", "description": "
\n

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["chocs", "type", "p", "n", "d", "c", "rob", "prob", "a", "perc", "minusc", "ratio_plain", "ratio_dark", "ratio_coconut", "ratio_rest", "gcd", "gcd2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "
\n
\n

A family receive a box of chocolates as a gift. There are five different kinds of chocolate inside, plain, nut, caramel, dark and coconut.

\n

There are:

\n

$\\var{p}$ plain chocolates, $\\var{n}$ nutty chocolates, $\\var{c}$ coconut chocolates and $\\var{d}$ dark chocolates.

\n

\n

i) What is the probability of picking a plain chocolate 

\n

[[0]] Give your answer as fraction!

\n

\n

ii) What is the probablity of picking a coconut chocolate.

\n

[[1]] Give your answer as fraction!

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0.", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p}/{p+n+d+c}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{c}/{p+n+c+d}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Lauren Richards", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1589/"}, {"name": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}, {"name": "Ugur Efem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14200/"}]}]}], "contributors": [{"name": "Lauren Richards", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1589/"}, {"name": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}, {"name": "Ugur Efem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14200/"}]}