// 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": [{"statement": "

Convert the number $\\var{b1}\\var{b2}\\var{b3}\\var{b4}\\var{b5}\\var{b6}\\var{b7}\\var{b8}$ to decimal.

", "name": "Simon's copy of Binary to Decimal", "preamble": {"js": "", "css": ""}, "functions": {}, "variable_groups": [], "tags": [], "ungrouped_variables": ["a", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8"], "variables": {"b3": {"description": "", "name": "b3", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b6": {"description": "", "name": "b6", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b2": {"description": "", "name": "b2", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b8": {"description": "", "name": "b8", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b1": {"description": "", "name": "b1", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b7": {"description": "", "name": "b7", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b5": {"description": "", "name": "b5", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "b4": {"description": "", "name": "b4", "templateType": "randrange", "definition": "random(0..1#1)", "group": "Ungrouped variables"}, "a": {"description": "", "name": "a", "templateType": "randrange", "definition": "random(1..10000#1)", "group": "Ungrouped variables"}}, "advice": "

In binary the position of each digit indicates a power of 2.

\n

Note that $2^0=1, 2^1=2,2^2=4,2^3=8,2^4=16,2^5=32$ etc

\n

We 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

\n

So 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

", "parts": [{"variableReplacements": [], "maxValue": "{b8}*1+{b7}*2+{b6}*4+{b5}*8+{b4}*16+{b3}*32+{b2}*64+{b1}*128", "correctAnswerStyle": "plain", "allowFractions": false, "customMarkingAlgorithm": "", "unitTests": [], "scripts": {}, "mustBeReduced": false, "mustBeReducedPC": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "marks": "2", "showFeedbackIcon": true, "type": "numberentry", "minValue": "{b8}*1+{b7}*2+{b6}*4+{b5}*8+{b4}*16+{b3}*32+{b2}*64+{b1}*128"}], "metadata": {"description": "

rebelmaths

\n

Converting a number from binary to decimal.

", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": [], "type": "question", "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}