// Numbas version: finer_feedback_settings {"name": "Simon's copy of Binary to Decimal", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "rulesets": {}, "advice": "
In binary the position of each digit indicates a power of 2.
\nNote that $2^0=1, 2^1=2,2^2=4,2^3=8,2^4=16,2^5=32$ etc
\n\n(a)
\nWe look at our binary number $\\var{b3}\\var{b4}\\var{b5}\\var{b6}$ and work from the far right hand side.
\n\n\n$\\var{b3}\\var{b4}\\var{b5}\\,{\\bf\\var{b6}}$ means $\\var{b6}$ lots of 1
\n$\\var{b3}\\var{b4}\\,{\\bf\\var{b5}}\\,\\var{b6}$ means $\\var{b5}$ lots of 2
\n$\\var{b3}\\,{\\bf\\var{b4}}\\,\\var{b5}\\var{b6}$ means $\\var{b4}$ lots of 4
\n${\\bf\\var{b3}}\\,\\var{b4}\\var{b5}\\var{b6}$ means $\\var{b3}$ lots of 8
\n\n\nSo our answer is $(\\var{b6}\\times 1)+(\\var{b5}\\times 2)+(\\var{b4}\\times 4)+(\\var{b3}\\times 8)=\\simplify{{b6}*1+{b5}*2+{b4}*4+{b3}*8}$
\n\n
(b)
\nWe look at our binary number $\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}$ and work from the far right hand side.
\n\n\n$\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\,{\\bf\\var{b5}}$ means $\\var{b5}$ lots of 1
\n$\\var{b1}\\var{b2}\\var{b3}\\,{\\bf\\var{b4}}\\,\\var{b5}$ means $\\var{b4}$ lots of 2
\n$\\var{b1}\\var{b2}\\,{\\bf\\var{b3}}\\,\\var{b4}\\var{b5}$ means $\\var{b3}$ lots of 4
\n$\\var{b1}\\,{\\bf\\var{b2}}\\,\\var{b3}\\var{b4}\\var{b5}$ means $\\var{b2}$ lots of 8
\n${\\bf\\var{b1}}\\,\\var{b2}\\var{b3}\\var{b4}\\var{b5}$ means $\\var{b1}$ lots of 16
\n\nSo our answer is $(\\var{b5}\\times 1)+(\\var{b4}\\times 2)+(\\var{b3}\\times 4)+(\\var{b2}\\times 8)+(\\var{b1}\\times 16)=\\simplify{{b5}*1+{b4}*2+{b3}*4+{b2}*8+{b1}*16}$
\n\n(c)
\nWe look at our binary number $\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ and work from the far right hand side.
\n\n$\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\,{\\bf\\var{b8}}$ means $\\var{b8}\\,$ lots of 1
\n$\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\,{\\bf\\var{b7}}\\,\\var{b8}$ means $\\var{b7}$ lots of 2
\n$\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\,{\\bf\\var{b6}}\\,\\var{b7}\\var{b8}$ means $\\var{b6}$ lots of 4
\n$\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\,{\\bf\\var{b5}}\\,\\var{b6}\\var{b7}\\var{b8}$ means $\\var{b5}$ lots of 8
\n$\\var{b1}\\var{b2}\\var{b3}\\,{\\bf\\var{b4}}\\,\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ means $\\var{b4}$ lots of 16
\n$\\var{b1}\\var{b2}\\,{\\bf\\var{b3}}\\,\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ means $\\var{b3}$ lots of 32
\n$\\var{b1}\\,{\\bf\\var{b2}}\\,\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ means $\\var{b2}$ lots of 64
\n${\\bf\\var{b1}}\\,\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ means $\\var{b1}$ lots of 128
\n\nSo our answer is $(\\var{b8}\\times 1)+(\\var{b7}\\times 2)+(\\var{b6}\\times 4)+(\\var{b5}\\times 8)+(\\var{b4}\\times 16)+(\\var{b3}\\times 32)+(\\var{b2}\\times 64)+(\\var{b1}\\times 128)=\\simplify{{b8}*1+{b7}*2+{b6}*4+{b5}*8+{b4}*16+{b3}*32+{b2}*64+{b1}*128}$
\n\n", "statement": "", "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["a", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Converting Binary to Decimal
\nrebelmaths
"}, "extensions": [], "variables": {"a": {"templateType": "randrange", "name": "a", "definition": "random(1..20#1)", "group": "Ungrouped variables", "description": ""}, "b1": {"templateType": "randrange", "name": "b1", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}, "b3": {"templateType": "randrange", "name": "b3", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}, "b6": {"templateType": "randrange", "name": "b6", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}, "b5": {"templateType": "anything", "name": "b5", "definition": "random(0..1 except b6)", "group": "Ungrouped variables", "description": ""}, "b7": {"templateType": "randrange", "name": "b7", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}, "b2": {"templateType": "anything", "name": "b2", "definition": "random(0..1 except b3)", "group": "Ungrouped variables", "description": ""}, "b8": {"templateType": "randrange", "name": "b8", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}, "b4": {"templateType": "randrange", "name": "b4", "definition": "random(0..1#1)", "group": "Ungrouped variables", "description": ""}}, "functions": {}, "variable_groups": [], "parts": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "minValue": "{b6}+{b5}*2+{b4}*4+{b3}*8", "prompt": "Convert the number $\\var{b3}\\var{b4}\\var{b5}\\var{b6}$ to decimal.
", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "allowFractions": false, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "maxValue": "{b6}+{b5}*2+{b4}*4+{b3}*8", "marks": "2", "type": "numberentry", "unitTests": [], "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "minValue": "{b5}*1+{b4}*2+{b3}*4+{b2}*8+{b1}*16", "prompt": "Convert the number $\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}$ to decimal.
", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "allowFractions": false, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "maxValue": "{b5}*1+{b4}*2+{b3}*4+{b2}*8+{b1}*16", "marks": "2", "type": "numberentry", "unitTests": [], "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "minValue": "{b8}*1+{b7}*2+{b6}*4+{b5}*8+{b4}*16+{b3}*32+{b2}*64+{b1}*128", "prompt": "Convert the number $\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ to decimal.
", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "allowFractions": false, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "maxValue": "{b8}*1+{b7}*2+{b6}*4+{b5}*8+{b4}*16+{b3}*32+{b2}*64+{b1}*128", "marks": "2", "type": "numberentry", "unitTests": [], "mustBeReducedPC": 0}], "name": "Simon's copy of Binary to Decimal", "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}