// Numbas version: exam_results_page_options {"name": "Calculate the original price before a decrease", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": [], "rulesets": {}, "name": "Calculate the original price before a decrease", "functions": {}, "ungrouped_variables": ["item", "name", "percentage", "name2", "oldprice", "newprice"], "metadata": {"description": "

Find the original price before a discount by dividing the new price by the percentage discount.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "variable_groups": [], "advice": "

We need to find the original price paid by {name2}. This value represents 100%.

\n

By the time {name} bought the {item}, the price had decreased by {percentage}%.

\n

{name} therefore paid {100-percentage}% of the price {name2} paid.

\n

\n

We use the unitary method to find the original price. We know the price paid by {name}

\n

\$\\var{100-percentage}\\text{%} = \\var{newprice} \\text{.}\$

\n

Divide both sides by {100-percentage} to get

\n

\\\begin{align} 1\\text{%} &= \\var{newprice} \\div \\var{100-percentage} \\\\&= \\var{newprice/(100-percentage)} \\text{.} \\end{align}\

\n

Multiply both sides by 100 to get

\n

\\\begin{align} 100\\text{%} &= \\var{newprice/(100-percentage)} \\times 100 \\\\&= \\var{newprice/(100-percentage)*100} \\\\&= \\var{oldprice}\\text{.} \\end{align}\

\n

This is the original price paid by {name2} before the {percentage}% decrease.

\n

We can check our answer with a different method.

\n

\\\begin{align} \\var{100-percentage}\\text{% of } \\var{oldprice} &= \\var{(100-percentage)/100} \\times \\var{oldprice} \\\\&= \\var{(100-percentage)/100*oldprice} \\\\&= \\var{precround((100-percentage)/100*oldprice, 2)} \\text{.} \\end{align}\

", "statement": "

{name} and {name2} are friends. {name} noticed {name2}'s new {item} when he came over to visit her house. He immediately knew he wanted to buy the same model. When he got home, he bought the {item} online for £{newprice}.

", "preamble": {"css": "", "js": ""}, "tags": ["decrease", "percentages", "taxonomy"], "parts": [{"variableReplacementStrategy": "originalfirst", "prompt": "

When {name} told {name2} how much he had paid for the {item}, {name2} said the price had decreased by {percentage}% since she bought it.

\n

How much did {name2} pay for the {item}?

\n

£  [[0]]

", "gaps": [{"variableReplacementStrategy": "originalfirst", "maxValue": "oldprice", "precision": "2", "scripts": {}, "correctAnswerStyle": "plain", "strictPrecision": false, "type": "numberentry", "marks": "2", "precisionMessage": "You have not given your answer to the correct precision.", "correctAnswerFraction": false, "precisionType": "dp", "allowFractions": false, "showPrecisionHint": true, "minValue": "oldprice", "mustBeReduced": false, "variableReplacements": [], "showFeedbackIcon": true, "mustBeReducedPC": 0, "precisionPartialCredit": 0, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true}], "variableReplacements": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "gapfill", "marks": 0, "scripts": {}}], "variables": {"newprice": {"templateType": "anything", "description": "", "name": "newprice", "group": "Ungrouped variables", "definition": "precround(oldprice*(100-percentage)/100,2)"}, "name2": {"templateType": "anything", "description": "

A female name.

", "name": "name2", "group": "Ungrouped variables", "definition": "random(\"Emily\", \"Kate\", \"Michaela\", \"Susan\", \"Sophie\")"}, "name": {"templateType": "anything", "description": "

A male name.

", "name": "name", "group": "Ungrouped variables", "definition": "random(\"Josh\", \"Adam\", \"Mike\", \"Trevor\", \"Alex\")"}, "oldprice": {"templateType": "anything", "description": "", "name": "oldprice", "group": "Ungrouped variables", "definition": "switch(\n item = \"TV\", random(179.99..1199.99 #10), \n item = \"laptop\", random(209.99..799.99 #10),\n item = \"smartphone\", random(109.99..799.99 #10),\n item = \"PC\", random(209.99..969.99 #10),\n item = \"gaming console\", random(89.99..349.99 #10),\n 399.99)"}, "percentage": {"templateType": "anything", "description": "

Discount percentage.

", "name": "percentage", "group": "Ungrouped variables", "definition": "random(5..30)"}, "item": {"templateType": "anything", "description": "

The bought item.

", "name": "item", "group": "Ungrouped variables", "definition": "random(\"TV\", \"laptop\", \"smartphone\", \"PC\", \"gaming console\")"}}, "variablesTest": {"maxRuns": "1000", "condition": "precround(precround(oldprice*(100-percentage)/100,2)*100/(100-percentage),2) = oldprice"}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}]}