// Numbas version: exam_results_page_options {"name": "Divisibility: 9", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Is this number divisible by 9? Half the time the number is, half the time it isn't. Steps give the divisibility test.

"}, "variable_groups": [], "rulesets": {}, "preamble": {"js": "", "css": ""}, "advice": "", "functions": {}, "tags": [], "statement": "

If you are unsure of how to do a question, click on Show steps to see the full working. Then, once you understand how to do the question, click on Try another question like this one to start again.

", "name": "Divisibility: 9", "extensions": [], "parts": [{"type": "1_n_2", "showCorrectAnswer": true, "displayType": "radiogroup", "distractors": ["", ""], "prompt": "

Is $\\var{num}$ divisible by $9$?

", "marks": 0, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "choices": ["Yes", "No"], "shuffleChoices": false, "maxMarks": 0, "unitTests": [], "displayColumns": 0, "customMarkingAlgorithm": "", "stepsPenalty": "1", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "matrix": ["seed", "1-seed"], "showCellAnswerState": true, "steps": [{"type": "information", "unitTests": [], "prompt": "

A number is divisible by $9$ if and only if it has digits that add up to a number divisible by $9$. 

\n

Let's add the digits: $\\var{d[3]}+\\var{d[2]}+\\var{d[1]}+\\var{d[0]}=\\var{firstsum}$

\n

Since $\\var{firstsum}$ is NOT divisible by $9$, we conclude that $\\var{num}$ is NOT divisible by $9$.

\n

However, if we aren't sure whether $\\var{firstsum}$ is divisible by $9$ or not,  we can repeat the process as many times as we need!

\n

$\\var{sd[1]}+\\var{sd[0]}=\\var{secondsum}$ is NOT divisible by $9$ and so we conclude that $\\var{num}$ is NOT divisible by $9$. 

\n

$\\var{sd[1]}+\\var{sd[0]}=\\var{secondsum}$ is divisible by $9$ and so we conclude that $\\var{num}$ is divisible by $9$.

\n

However, if we aren't sure whether $\\var{secondsum}$ is divisible by $9$ or not, we can repeat the process again!

\n

$\\var{td[1]}+\\var{td[0]}=\\var{thirdsum}$ which is divisible by $9$.

\n

$\\var{td[1]}+\\var{td[0]}=\\var{thirdsum}$ which is NOT divisible by $9$.

\n

Note: the single digit numbers that are divisible by $9$ are $0$ and $9$.

", "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "customMarkingAlgorithm": ""}], "scripts": {}, "variableReplacements": []}], "ungrouped_variables": ["seed", "nine", "num", "thismany", "d", "firstsum", "sd", "secondsum", "td", "thirdsum"], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"d": {"templateType": "anything", "name": "d", "group": "Ungrouped variables", "definition": "[mod(num,10),mod(floor(num/10),10),mod(floor(num/100),10),mod(floor(num/1000),10)]", "description": ""}, "nine": {"templateType": "anything", "name": "nine", "group": "Ungrouped variables", "definition": "random(1008..9999#9)", "description": ""}, "sd": {"templateType": "anything", "name": "sd", "group": "Ungrouped variables", "definition": "[mod(firstsum,10),mod(floor(firstsum/10),10)]", "description": ""}, "thismany": {"templateType": "anything", "name": "thismany", "group": "Ungrouped variables", "definition": "num/9", "description": ""}, "seed": {"templateType": "anything", "name": "seed", "group": "Ungrouped variables", "definition": "random(0,1)", "description": ""}, "firstsum": {"templateType": "anything", "name": "firstsum", "group": "Ungrouped variables", "definition": "sum(d)", "description": ""}, "num": {"templateType": "anything", "name": "num", "group": "Ungrouped variables", "definition": "if(seed=0, nine+random(1..8),nine)", "description": ""}, "thirdsum": {"templateType": "anything", "name": "thirdsum", "group": "Ungrouped variables", "definition": "sum(td)", "description": ""}, "secondsum": {"templateType": "anything", "name": "secondsum", "group": "Ungrouped variables", "definition": "sum(sd)", "description": ""}, "td": {"templateType": "anything", "name": "td", "group": "Ungrouped variables", "definition": "[mod(secondsum,10),mod(floor(secondsum/10),10)]", "description": ""}}, "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}