// Numbas version: finer_feedback_settings {"name": "Catherine's copy of Rewriting base 10 numbers in other bases", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "
In our usual number
In the base $\\var{b}$ system we only have $\\var{b}$ digits ($0$ to $\\var{b-1}$) and the place values are based on powers of $\\var{b}$.
", "extensions": [], "ungrouped_variables": ["b", "valueinbaseb", "hundredsA", "tensF", "tensA", "units", "valueinbase10", "btext"], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "The number $\\var{valueinbase10}$ is written in base $10$, so the place values are all powers of $10$. That is
\n\\[\\var{valueinbase10}=\\var{hundredsF}\\times 10^2+\\var{tensF}\\times 10^1+\\var{units}\\times 10^0.\\]
\nSince we want to write this number in base $\\var{b}$, the place values will be powers of $\\var{b}$, that is $\\dots \\var{b}^3, \\var{b}^2, \\var{b}^1,\\var{b}^0$, also known as $\\ldots \\var{b^3}, \\var{b^2}, \\var{b}, 1$.
\nWe now need to determine how many of each of these place values we need to add together in order to get $\\var{valueinbase10}$. We do this by working from largest to smallest.
\n\n\n\n", "functions": {"word": {"definition": "switch(r=0, 'Zero', r=1, 'One', r=2,'Two', r=3, 'Three', r=4, 'Four', r=5, 'Five', r=6, 'Six', r=7,'Seven', r=8, 'Eight','Nine')", "language": "jme", "type": "string", "parameters": [["r", "number"]]}}, "rulesets": {}, "name": "Catherine's copy of Rewriting base 10 numbers in other bases", "variable_groups": [{"name": "try this", "variables": ["hundredsF", "otherDigits", "listOfDigits"]}], "preamble": {"js": "", "css": ""}, "tags": [], "variables": {"hundredsF": {"name": "hundredsF", "description": "", "definition": "random(1..b-1)", "templateType": "anything", "group": "try this"}, "hundredsA": {"name": "hundredsA", "description": "", "definition": "hundredsF*b^2", "templateType": "anything", "group": "Ungrouped variables"}, "tensA": {"name": "tensA", "description": "", "definition": "tensF*b", "templateType": "anything", "group": "Ungrouped variables"}, "btext": {"name": "btext", "description": "", "definition": "switch(b=2,'two', b=3, 'three', b=4, 'four', b=5, 'five', b=6, 'six', b=7,'seven', b=8, 'eight','nine')", "templateType": "anything", "group": "Ungrouped variables"}, "units": {"name": "units", "description": "", "definition": "listOfDigits[2]", "templateType": "anything", "group": "Ungrouped variables"}, "b": {"name": "b", "description": "", "definition": "random(2..9)", "templateType": "anything", "group": "Ungrouped variables"}, "valueinbaseb": {"name": "valueinbaseb", "description": "
This is to get the number to display in base b
", "definition": "hundredsF*10^2+tensF*10+units", "templateType": "anything", "group": "Ungrouped variables"}, "listOfDigits": {"name": "listOfDigits", "description": "", "definition": "[hundredsF]+otherDigits", "templateType": "anything", "group": "try this"}, "valueinbase10": {"name": "valueinbase10", "description": "", "definition": "hundredsA+tensA+units", "templateType": "anything", "group": "Ungrouped variables"}, "tensF": {"name": "tensF", "description": "", "definition": "listOfDigits[1]", "templateType": "anything", "group": "Ungrouped variables"}, "otherDigits": {"name": "otherDigits", "description": "don't want repeated digits unless we really need to (binary)
", "definition": "if(b=2,shuffle(0..b-1)[0..2],shuffle(0..b-1 except hundredsF)[0..2])", "templateType": "anything", "group": "try this"}}, "parts": [{"showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "prompt": "The base-10 number $\\var{valueinbase10}$ is equal to [[0]]$_\\var{btext}$ in base $\\var{b}$.
", "scripts": {}, "marks": 0, "gaps": [{"maxValue": "valueinbaseb", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "valueinbaseb", "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "mustBeReducedPC": 0, "correctAnswerFraction": false, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "type": "numberentry", "allowFractions": false, "marks": 1}], "variableReplacements": [], "showCorrectAnswer": true}], "metadata": {"description": "Converting base 10 Integers in another base (from 2 to 9)
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "contributors": [{"name": "Catherine Byrne", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/894/"}]}]}], "contributors": [{"name": "Catherine Byrne", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/894/"}]}