// Numbas version: finer_feedback_settings {"name": "Divisibility: 4", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "rulesets": {}, "extensions": [], "ungrouped_variables": ["seed", "fourer", "num", "thismany", "d1", "d0", "h", "q"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

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

"}, "variable_groups": [], "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": {"js": "", "css": ""}, "name": "Divisibility: 4", "variables": {"d1": {"name": "d1", "definition": "mod(floor(num/10),10)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "q": {"name": "q", "definition": "h/2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "h": {"name": "h", "definition": "(d1*10+d0)/2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "seed": {"name": "seed", "definition": "random(0,1)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "fourer": {"name": "fourer", "definition": "random(300..2000#4)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "d0": {"name": "d0", "definition": "mod(num,10)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "num": {"name": "num", "definition": "if(seed=0, fourer+random(1..3),fourer)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "thismany": {"name": "thismany", "definition": "num/4", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "parts": [{"distractors": ["", ""], "matrix": ["seed", "1-seed"], "variableReplacements": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "maxMarks": 0, "showCellAnswerState": true, "customMarkingAlgorithm": "", "type": "1_n_2", "steps": [{"extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "information", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "prompt": "

A number is divisible by $4$ if and only if the last two digits form a number that is divisible by $4$. 

\n

Of course, this means you need to either know all the multiples of $4$ up to $100$ (unlikely) or be willing to divide the two digit number by $4$ (which is as easy as halving then halving again!) and see if you get a whole number!

\n

Also useful is realising a number must be divisible by $2$ to have any chance of being divisible by $4$.

\n

$\\var{num}$ ends with the digits $\\var{d1}\\var{d0}$, which is NOT divisible by $4$ and so $\\var{num}$ is NOT divisible by $4$.

\n

How do we know $\\var{d1}\\var{d0}$ isn't divisible by $4$? Well, to be divisible by $4$ a number has to be divisible by $2$ (which means it has to end in a $0,\\,2,\\,4,\\,6$ or $8$) but $\\var{d1}\\var{d0}$ ends in a $\\var{d0}$ so it isn't even divisible by $2$ let alone $4$.

\n

How do we know $\\var{d1}\\var{d0}$ isn't divisible by $4$? Well, if we halve $\\var{d1}\\var{d0}$ we get $\\var{h}$. But if we try to halve $\\var{h}$ we will not get a whole number and so $\\var{d1}\\var{d0}$ is not divisible by $4$.

\n

$\\var{num}$ ends with the digits $\\var{d1}\\var{d0}$ which is divisible by $4$ and so $\\var{num}$ is divisible by $4$.

\n

How do we know $\\var{d1}\\var{d0}$ is divisible by $4$? Well, if we halve $\\var{d1}\\var{d0}$ we get $\\var{h}$ and if we halve $\\var{h}$ we get $\\var{q}$ which is a whole number and so $\\var{d1}\\var{d0}$ is divisible by $4$. 

\n

\n

", "scripts": {}, "unitTests": [], "marks": 0, "showCorrectAnswer": true, "variableReplacements": []}], "showFeedbackIcon": true, "choices": ["Yes", "No"], "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 0, "displayType": "radiogroup", "prompt": "

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

", "shuffleChoices": false, "stepsPenalty": "1", "marks": 0, "variableReplacementStrategy": "originalfirst", "unitTests": []}], "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/"}]}