// Numbas version: exam_results_page_options {"name": "Harry's copy of Hannah's copy of Rounding numbers to a given number of significant figures", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Harry's copy of Hannah's copy of Rounding numbers to a given number of significant figures", "rulesets": {}, "variable_groups": [], "functions": {"n_from_digits": {"type": "number", "parameters": [["digits", "list"]], "definition": "if(\n len(digits)=0,\n 0,\n digits[0]+10*n_from_digits(digits[1..len(digits)])\n)", "language": "jme"}}, "variables": {"d1": {"description": "

Random integer.

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

Number of significant figures to round.

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

Random number with 7 decimal places.

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

Round numbers to a given number of significant figures.

", "licence": "Creative Commons Attribution 4.0 International"}, "extensions": [], "statement": "

Rounding to a given number of significant figures.

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

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

\n

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

\n

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

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

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

\n

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

\n

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

", "type": "gapfill", "showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 0, "scripts": {}}], "variablesTest": {"maxRuns": "100", "condition": ""}, "advice": "

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[5]}$. The following digit is $\\var{ddig[4]}$ 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[5]}$. The second following digit is $\\var{ddig[4]}$, the third following digit is $\\var{ddig[3]}$ and the fourth following digit is $\\var{ddig[2]}$. The digit following the last digit we are keeping is $\\var{ddig[3]}$$\\var{ddig[2]}$$\\var{ddig[1]}$, 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[4]}$, followed by $\\var{edig[3]}$. 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[4]}$. The second following digit is $\\var{edig[3]}$, the third following digit is $\\var{edig[2]}$ and the fourth following digit is $\\var{edig[1]}$. The digit following the last digit we are keeping is $\\var{edig[2]}$$\\var{edig[1]}$$\\var{edig[0]}$, so we round to get $\\var{sigformat(e1, sf)}$. These are our {sf} significant figures. 

\n

", "type": "question", "contributors": [{"name": "Hannah Bartholomew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/530/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "contributors": [{"name": "Hannah Bartholomew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/530/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}