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

Applied questions that could be done with modulo arithmetic.

"}, "extensions": [], "type": "question", "statement": "

Modulo arithmetic can help in situations where a finite number of cases is continually cycled through. 

", "variable_groups": [], "preamble": {"css": "", "js": ""}, "variables": {"offset": {"templateType": "anything", "name": "offset", "group": "Ungrouped variables", "description": "", "definition": "random(400..1500)"}, "name2": {"templateType": "anything", "name": "name2", "group": "Ungrouped variables", "description": "", "definition": "nameList[1]"}, "event": {"templateType": "anything", "name": "event", "group": "Ungrouped variables", "description": "", "definition": "random('appointment', 'doctors appointment', 'dentist appointment', 'TV show', 'work shift')"}, "day1number": {"templateType": "anything", "name": "day1number", "group": "Ungrouped variables", "description": "", "definition": "random(0..359)"}, "day1": {"templateType": "anything", "name": "day1", "group": "Ungrouped variables", "description": "", "definition": "dayList[day1number]"}, "nameList": {"templateType": "anything", "name": "nameList", "group": "Ungrouped variables", "description": "", "definition": "shuffle(['Ben','Annie', 'Clinton', 'Annette', 'Jill', 'David', 'Fran', 'Andrew', 'Keith', 'Abbey', 'Sophie', 'John', 'Simon', 'Klee', 'Daniel', 'Jason', 'Tom', 'Matt', 'Stephan','Elizabeth'])"}, "name1": {"templateType": "anything", "name": "name1", "group": "Ungrouped variables", "description": "", "definition": "nameList[0]"}, "dayList": {"templateType": "anything", "name": "dayList", "group": "Ungrouped variables", "description": "", "definition": "list(0..359)"}, "modoffset": {"templateType": "anything", "name": "modoffset", "group": "Ungrouped variables", "description": "", "definition": "mod(offset,360)"}, "day2number": {"templateType": "anything", "name": "day2number", "group": "Ungrouped variables", "description": "", "definition": "mod(day1number+offset,360)"}, "day2": {"templateType": "anything", "name": "day2", "group": "Ungrouped variables", "description": "", "definition": "dayList[day2number]"}}, "tags": [], "parts": [{"variableReplacements": [], "showFeedbackIcon": true, "prompt": "

A true bearing is an angle measured clockwise from true north. For example, the true bearing of $090^\\circ$ is more commonly known as east.

\n

If you were originally facing a true bearing of $\\var{day1}^\\circ$ and then you spun $\\var{offset}$ degrees clockwise, your true bearing would be [[0]]$^\\circ$.

\n

", "showCorrectAnswer": true, "type": "gapfill", "marks": 0, "gaps": [{"variableReplacements": [], "minValue": "{day2}", "type": "numberentry", "maxValue": "{day2}", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "mustBeReduced": false, "allowFractions": false, "mustBeReducedPC": 0, "showCorrectAnswer": true, "scripts": {}, "marks": "1"}], "variableReplacementStrategy": "originalfirst", "scripts": {}}], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

There are $360$ degrees in a full revolution (so your true bearing can be from $000^\\circ$ up to $359^\\circ$) so to do a question such as the above we should work modulo $360$.

\n

Since $\\var{offset}\\div 360=\\var{floor(offset/360)}$$\\frac{\\var{modoffset}}{360}$, when it comes to true bearings, '$\\var{offset}$ degrees clockwise' is the same as '$\\var{modoffset}$ degrees clockwise'.

\n

Since we started at $\\var{day1}^\\circ$, an extra $\\var{modoffset}$ degrees clockwise leaves us at $\\var{day2}^\\circ$.

\n

\n

\n

A better way to do this question would be to add the original bearing and the extra rotation first and then find its least residue mod $360$:

\n\n

That is the final true bearing is $\\var{day2}^\\circ$.

\n

\n

", "functions": {}, "rulesets": {}, "ungrouped_variables": ["offset", "dayList", "day1number", "day1", "day2number", "day2", "nameList", "name1", "name2", "event", "modoffset"], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}