// Numbas version: exam_results_page_options {"name": "Hannah's copy of Rounding numbers to a given number of significant figures", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"showfrontpage": false, "preventleave": false, "allowregen": true}, "question_groups": [{"questions": [{"contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/530/", "name": "Hannah Bartholomew"}], "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": "100"}, "type": "question", "statement": "

Rounding to a given number of significant figures.

", "ungrouped_variables": ["sf", "ddig", "edig", "d1", "e1"], "functions": {"n_from_digits": {"language": "jme", "parameters": [["digits", "list"]], "type": "number", "definition": "if(\n len(digits)=0,\n 0,\n digits+10*n_from_digits(digits[1..len(digits)])\n)"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Round numbers to a given number of significant figures.

The first thing to do when we are rounding numbers is to identify the last digit we are keeping.

\n

When you're asked to round your answer to a number of significant figures, you need to decide whether to keep the last digit same (rounding down) or increase it by 1 (rounding up). If the following digit is less than 5 we round down and we round up when the next digit is 5 or more.

\n

To write it down in steps:

\n
\n
\n
\n
\n
1. Identify the last digit we need to keep.
2. \n
3. Look at the following digit.
4. \n
5. If it's 5 or more, increase the previous digit by one.
6. \n
7. If it's 4 or less, keep the previous digit the same.
8. \n
9. Fill any spaces to the right of the digit with zeros if needed.
10. \n
\n
\n
\n
\n

It is important to keep in mind that if the digit we are increasing is 9, it becomes zero and we increase the previous digit instead. If this digit is 9 as well, we move along to the left side until we find a digit less than 9.

\n

When asked to round to significant figures, it may seem tricky at first to identify the last digit we want to keep. If we round to one significant figure, we look at the first non-zero digit from left to right. If we round to \$n\$ significant figures, we want to keep all digits up to the \$n\$th number of places next to the last zero number. Once we identify this digit, the rounding method is the same as previously. It may be easier to understand with an example:

\n

\$0.02554\$ rounded to 2 significant figures is \$0.026\$ as digits \$25\$ are the 2 significant figures we keep.

\n

Similarly, \$52124\$ rounded to 3 significant figures is \$52100\$ since digits \$521\$ are the 3 significant figures we keep.

\n

a)

\n

i)

\n

We round \$\\var{d1}\$ to 1 significant figure. The first non-zero digit is \$\\var{ddig}\$. The following digit is \$\\var{ddig}\$ so we round updown to get \$\\var{dpformat(siground(d1, 1), 0)}\$.

\n

ii)

\n

We round \$\\var{d1}\$ to {sf} significant figures. The first non-zero digit is \$\\var{ddig}\$. The second following digit is \$\\var{ddig}\$, the third following digit is \$\\var{ddig}\$ and the fourth following digit is \$\\var{ddig}\$. The digit following the last digit we are keeping is \$\\var{ddig}\$\$\\var{ddig}\$\$\\var{ddig}\$, so we round to get \$\\var{sigformat(d1, sf)}\$. These are our {sf} significant figures.

\n

\n

b)

\n

i)

\n

We round \$\\var{e1}\$ to 1 significant figure. The first non-zero digit is \$\\var{edig}\$, followed by \$\\var{edig}\$. This is lower than 5 so we round downmore than 5 so we round up to get \$\\var{sigformat(e1,1)}\$.

\n

ii)

\n

We round \$\\var{e1}\$ to {sf} significant figures. The first non-zero digit is \$\\var{edig}\$. The second following digit is \$\\var{edig}\$, the third following digit is \$\\var{edig}\$ and the fourth following digit is \$\\var{edig}\$. The digit following the last digit we are keeping is \$\\var{edig}\$\$\\var{edig}\$\$\\var{edig}\$, so we round to get \$\\var{sigformat(e1, sf)}\$. These are our {sf} significant figures.

\n

", "variables": {"edig": {"templateType": "anything", "name": "edig", "group": "Ungrouped variables", "description": "", "definition": "repeat(random(1..9), 5)"}, "sf": {"templateType": "anything", "name": "sf", "group": "Ungrouped variables", "description": "

Number of significant figures to round.

", "definition": "random(2..4)"}, "e1": {"templateType": "anything", "name": "e1", "group": "Ungrouped variables", "description": "

Random number with 7 decimal places.

", "definition": "n_from_digits(edig)*10^(-6)"}, "d1": {"templateType": "anything", "name": "d1", "group": "Ungrouped variables", "description": "

Random integer.

", "definition": "n_from_digits(ddig)"}, "ddig": {"templateType": "anything", "name": "ddig", "group": "Ungrouped variables", "description": "", "definition": "repeat(random(1..9), 6)"}}, "variable_groups": [], "tags": [], "parts": [{"variableReplacements": [], "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

Round \$\\var{d1}\$ to 1 and {sf} significant figures.

\n

i) \$\\var{d1}\$ rounded to 1 significant figure is:  []

\n

ii) \$\\var{d1}\$ rounded to {sf} significant figures is:  []

", "type": "gapfill", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacements": [], "scripts": {}, "maxValue": "precround(siground(d1, 1),0)", "marks": 1, "correctAnswerFraction": false, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "showFeedbackIcon": true, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "precround(siground(d1, 1),0)", "correctAnswerStyle": "plain"}, {"variableReplacements": [], "scripts": {}, "maxValue": "siground(d1, sf)", "marks": 1, "correctAnswerFraction": false, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "showFeedbackIcon": true, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "siground(d1, sf)", "correctAnswerStyle": "plain"}]}, {"variableReplacements": [], "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

Round \$\\var{e1}\$ to 1 and {sf} significant figures.

\n

iii) \$\\var{e1}\$ rounded to 1 significant figure is:  []

\n

iv) \$\\var{e1}\$ rounded to {sf} significant figures is:  []

", "type": "gapfill", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacements": [], "scripts": {}, "maxValue": "siground(e1, 1)", "marks": 1, "correctAnswerFraction": false, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "showFeedbackIcon": true, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "siground(e1, 1)", "correctAnswerStyle": "plain"}, {"variableReplacements": [], "scripts": {}, "maxValue": "siground(e1, sf)", "marks": 1, "correctAnswerFraction": false, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "showFeedbackIcon": true, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "siground(e1, sf)", "correctAnswerStyle": "plain"}]}], "preamble": {"css": "", "js": ""}, "extensions": [], "name": "Hannah's copy of Rounding numbers to a given number of significant figures"}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/530/", "name": "Hannah Bartholomew"}]}