// Numbas version: exam_results_page_options {"name": "haifa's copy of Cumulative percent decrease", "extensions": ["random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "

Given the original price of a smartphone and the rate at which it decreases, calculate its price after a given number of months. In the second part, calculate the time remaining until the price goes below a certain point.

", "licence": "Creative Commons Attribution 4.0 International"}, "name": "haifa's copy of Cumulative percent decrease", "functions": {}, "statement": "

A smartphone's value decreases by $\\var{perc}$% every month. The original price when it is released is $£\\var{price}$.

", "variable_groups": [{"name": "Part a)", "variables": ["price", "perc"]}, {"name": "Part b)", "variables": ["threshold", "pricee1", "pricee2", "pricee3", "testn", "test", "price2", "n", "person"]}], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

We can use the multiplier method to calculate the new price. If the price decreases by {perc}%, this its value is {100-perc}% of the original value after 1 month. The decimal multiplier for {100-perc}% is

\n

\\[\\frac{\\var{100-perc}}{100} = \\var{(100-perc)/100} \\text{.}\\]

\n

Each month our smartphone's value can be found by multiplying the previous month's value by the decimal multiplier. For example, after the first month, the value is

\n

\\[ \\var{(100-perc)/100} \\times\\mathrm{£}\\var{price} = \\mathrm{£}\\var{dpformat(price*(100-perc)/100,2)}\\text{.} \\]

\n

To calculate the price after 5 months, we multiply the original price of the smartphone by our multiplier 5 times:

\n

\\[ \\begin{align} \\text{Final worth} &= \\var{price} \\times \\var{(100-perc)/100} \\times \\var{(100-perc)/100} \\times \\var{(100-perc)/100} \\times \\var{(100-perc)/100} \\times \\var{(100-perc)/100} \\\\&=  \\var{price} \\times \\var{(100-perc)/100}^{5} \\\\&= £\\var{precround(price*((100-perc)/100)^5, 2)} {.} \\end{align}\\]

\n

b)

\n

From part a), the value after 5 months is  £$\\var{precround(price*((100-perc)/100)^5, 2)}$. Continuing to multiply the price by the decimal multiplier,

\n

\\[£\\var{precround(price*((100-perc)/100)^5, 2)} \\times \\var{(100-perc)/100} = £\\var{precround(precround(price*((100-perc)/100)^5, 2)*(100-perc)/100, 2)}\\]

\n

\\[£\\var{precround(price*((100-perc)/100)^5, 2)} \\times \\var{(100-perc)/100}^2 = £\\var{precround(precround(price*((100-perc)/100)^6, 2)*(100-perc)/100, 2)}\\]

\n

\\[£\\var{precround(price*((100-perc)/100)^5, 2)} \\times \\var{(100-perc)/100}^3 = £\\var{precround(precround(price*((100-perc)/100)^7, 2)*(100-perc)/100, 2)}\\]

\n

\\[£\\var{precround(price*((100-perc)/100)^5, 2)} \\times \\var{(100-perc)/100}^4 = £\\var{precround(precround(price*((100-perc)/100)^8, 2)*(100-perc)/100, 2)}\\]

\n

\n

The smartphone's value will be below $£\\var{threshold}$ after {n-5} more months ({n} months in total since its release).

", "tags": ["decrease", "percentages", "taxonomy"], "variablesTest": {"maxRuns": "1000", "condition": ""}, "variables": {"pricee2": {"group": "Part b)", "definition": "precround(price*((100 - perc)/100)^(testn-1),2)", "name": "pricee2", "templateType": "anything", "description": ""}, "test": {"group": "Part b)", "definition": "precround(precround(price*((100-perc)/100)^5, 2)*((100-perc)/100)^(n-5), 2)", "name": "test", "templateType": "anything", "description": "

Calculated value of price2 to ensure we mention rounding errors in advice only when needed.

"}, "threshold": {"group": "Part b)", "definition": "siground(pricee1+5,2)", "name": "threshold", "templateType": "anything", "description": ""}, "price2": {"group": "Part b)", "definition": "if(pricee2 < threshold, pricee2, pricee1)", "name": "price2", "templateType": "anything", "description": ""}, "n": {"group": "Part b)", "definition": "if(pricee2 < threshold, testn-1, testn)", "name": "n", "templateType": "anything", "description": ""}, "price": {"group": "Part a)", "definition": "random(300..800) + 0.99", "name": "price", "templateType": "anything", "description": "

The original price.

"}, "person": {"group": "Part b)", "definition": "random_person()", "name": "person", "templateType": "anything", "description": ""}, "pricee1": {"group": "Part b)", "definition": "precround(price*((100 - perc)/100)^(testn),2)", "name": "pricee1", "templateType": "anything", "description": "

The resulting price after the total of testn months.

"}, "perc": {"group": "Part a)", "definition": "random(2..4 #0.5)", "name": "perc", "templateType": "anything", "description": "

Percentage decrease per month.

"}, "pricee3": {"group": "Part b)", "definition": "precround(price*((100 - perc)/100)^(testn-2),2)", "name": "pricee3", "templateType": "anything", "description": ""}, "testn": {"group": "Part b)", "definition": "random(6..9)", "name": "testn", "templateType": "anything", "description": "

Number of months in total.

"}}, "extensions": ["random_person"], "rulesets": {}, "parts": [{"prompt": "

How much will the smartphone be worth after $5$ months?

\n

£ [[0]]

", "gaps": [{"notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "minValue": "precround(price*((100-perc)/100)^5, 2)", "showPrecisionHint": true, "precisionMessage": "

Round your answer to $2$ decimal places.

", "correctAnswerFraction": false, "mustBeReducedPC": 0, "precisionType": "dp", "strictPrecision": false, "precision": "2", "correctAnswerStyle": "plain", "showCorrectAnswer": true, "scripts": {}, "marks": "2", "mustBeReduced": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "maxValue": "precround(price*((100-perc)/100)^5, 2)", "precisionPartialCredit": 0, "variableReplacements": []}], "showFeedbackIcon": true, "steps": [{"prompt": "

The original price of the phone is $£\\var{price}$ and we are told that the price decreases by $\\var{perc}$% every month.

\n

", "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information", "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "minValue": "1-{perc}/100", "correctAnswerFraction": false, "mustBeReducedPC": 0, "marks": "0.5", "maxValue": "1-{perc}/100", "correctAnswerStyle": "plain", "showCorrectAnswer": true, "scripts": {}, "prompt": "

What is the decimal multiplier for the decrease in the smartphones each month?

", "mustBeReduced": false, "type": "numberentry", "showFeedbackIcon": true, "variableReplacements": []}, {"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showPrecisionHint": true, "mustBeReducedPC": 0, "strictPrecision": false, "maxValue": "{price}*(1-{perc}/100)", "showCorrectAnswer": true, "precisionPartialCredit": 0, "marks": "0.5", "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "precisionMessage": "

Round your answer to $2$ decimal places.

", "minValue": "{price}*(1-{perc}/100)", "correctAnswerFraction": false, "precisionType": "dp", "correctAnswerStyle": "plain", "scripts": {}, "precision": "2", "prompt": "

Multiply the original price by the decimal multiplier to obtain the price after 1 month.

", "showFeedbackIcon": true, "variableReplacements": []}, {"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showPrecisionHint": true, "mustBeReducedPC": 0, "strictPrecision": false, "maxValue": "{price}*(1-{perc}/100)^2", "showCorrectAnswer": true, "precisionPartialCredit": 0, "marks": "0.5", "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "precisionMessage": "

Round your answer to $2$ decimal places.

", "minValue": "{price}*(1-{perc}/100)^2", "correctAnswerFraction": false, "precisionType": "dp", "correctAnswerStyle": "plain", "scripts": {}, "precision": "2", "prompt": "

Multiply your answer above by the decimal multiplier to obtain the price after 2 months. 

\n

Note that this is the same as multiplying the original price by $d^2$, where $d$ is the decimal multiplier.

", "showFeedbackIcon": true, "variableReplacements": []}], "scripts": {}, "stepsPenalty": 0, "marks": 0, "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"prompt": "

{person['name']} has $£\\var{threshold}$ to spend on a smartphone. After how many more full months will {person['pronouns']['they']} be able to afford the smartphone?

\n

[[0]] months

", "gaps": [{"notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "minValue": "n-5", "correctAnswerFraction": false, "mustBeReducedPC": 0, "maxValue": "n-5", "correctAnswerStyle": "plain", "showCorrectAnswer": true, "scripts": {}, "marks": "2", "mustBeReduced": false, "type": "numberentry", "showFeedbackIcon": true, "variableReplacements": []}], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "ungrouped_variables": [], "type": "question", "contributors": [{"name": "haifa abd", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2378/"}]}]}], "contributors": [{"name": "haifa abd", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2378/"}]}