// Numbas version: exam_results_page_options {"name": "Divisibility: 9", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "preventleave": false, "showfrontpage": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "variable_groups": [], "tags": [], "name": "Divisibility: 9", "parts": [{"unitTests": [], "displayColumns": 0, "maxMarks": 0, "steps": [{"unitTests": [], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "type": "information", "prompt": "

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

\n

\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\$.

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}], "scripts": {}, "marks": 0, "minMarks": 0, "extendBaseMarkingAlgorithm": true, "type": "1_n_2", "showCellAnswerState": true, "customMarkingAlgorithm": "", "matrix": ["seed", "1-seed"], "variableReplacements": [], "shuffleChoices": false, "distractors": ["", ""], "prompt": "

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

", "displayType": "radiogroup", "showFeedbackIcon": true, "stepsPenalty": "1", "showCorrectAnswer": true, "choices": ["Yes", "No"], "variableReplacementStrategy": "originalfirst"}], "advice": "", "type": "question", "functions": {}, "extensions": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "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.

", "preamble": {"css": "", "js": ""}, "variables": {"thirdsum": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "thirdsum", "definition": "sum(td)"}, "thismany": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "thismany", "definition": "num/9"}, "nine": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "nine", "definition": "random(1008..9999#9)"}, "firstsum": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "firstsum", "definition": "sum(d)"}, "d": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "d", "definition": "[mod(num,10),mod(floor(num/10),10),mod(floor(num/100),10),mod(floor(num/1000),10)]"}, "td": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "td", "definition": "[mod(secondsum,10),mod(floor(secondsum/10),10)]"}, "secondsum": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "secondsum", "definition": "sum(sd)"}, "seed": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "seed", "definition": "random(0,1)"}, "num": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "num", "definition": "if(seed=0, nine+random(1..8),nine)"}, "sd": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "sd", "definition": "[mod(firstsum,10),mod(floor(firstsum/10),10)]"}}, "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.

"}, "ungrouped_variables": ["seed", "nine", "num", "thismany", "d", "firstsum", "sd", "secondsum", "td", "thirdsum"]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}