// Numbas version: exam_results_page_options {"question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Group", "questions": [{"name": "Functions: floor and roof", "extensions": [], "custom_part_types": [], "resources": [["question-resources/Floor_function.svg.png", "/srv/numbas/media/question-resources/Floor_function.svg.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Introduces students to the floor and ceiling functions

"}, "tags": [], "parts": [{"failureRate": 1, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "answer": "{floor(x1)}", "marks": 1, "checkingAccuracy": 0.001, "type": "jme", "showPreview": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar x1 = unwrap(variables.x1);\n\n// compute its derivative\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (Math.floor(x1) == ans) {\n this.setCredit(1,\"Correct. This is the floor of $\" + x1 + \"$.\");\n }\n else if (Math.ceil(x1) == ans) { \n this.setCredit(0,\"Close. This is the ceiling of $\" + x1 + \"$.\");\n }\n else if (ans % 1 != 0) {\n this.setCredit(0,\"Your answer should be an integer.\"); \n }\n else {\n this.setCredit(0,\"Incorrect.\"); \n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "showFeedbackIcon": true, "checkVariableNames": false, "expectedVariableNames": [], "prompt": "

$\\lfloor \\var{x1}\\rfloor$

", "customMarkingAlgorithm": ""}, {"failureRate": 1, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "answer": "{ceil(x1)}", "marks": 1, "checkingAccuracy": 0.001, "type": "jme", "showPreview": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar x1 = unwrap(variables.x1);\n\n// compute its derivative\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (Math.floor(x1) == ans) {\n this.setCredit(0,\"Close. This is the floor of $\" + x1 + \"$.\");\n }\n else if (Math.ceil(x1) == ans) { \n this.setCredit(1,\"Correct. This is the ceiling of $\" + x1 + \"$.\");\n }\n else if (ans % 1 != 0) {\n this.setCredit(0,\"Your answer should be an integer.\"); \n }\n else {\n this.setCredit(0,\"Incorrect.\"); \n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "showFeedbackIcon": true, "checkVariableNames": false, "expectedVariableNames": [], "prompt": "

$\\lceil \\var{x1}\\rceil$

", "customMarkingAlgorithm": ""}, {"failureRate": 1, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "variableReplacements": [{"variable": "", "part": "p1", "must_go_first": false}], "showCorrectAnswer": true, "answer": "{floor(-x1)}", "marks": 1, "checkingAccuracy": 0.001, "type": "jme", "showPreview": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar x1 = -1*unwrap(variables.x1);\n\n// compute its derivative\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (Math.floor(x1) == ans) {\n this.setCredit(1,\"Correct. This is the floor of $\" + x1 + \"$.\");\n }\n else if (Math.ceil(x1) == ans) { \n this.setCredit(0,\"Close. This is the ceiling of $\" + x1 + \"$.\");\n }\n else if (ans % 1 != 0) {\n this.setCredit(0,\"Your answer should be an integer.\"); \n }\n else {\n this.setCredit(0,\"Incorrect.\"); \n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "showFeedbackIcon": true, "checkVariableNames": false, "expectedVariableNames": [], "prompt": "

$\\lfloor - \\var{x1}\\rfloor$

", "customMarkingAlgorithm": ""}, {"failureRate": 1, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "answer": "{ceil(-x1)}", "marks": 1, "checkingAccuracy": 0.001, "type": "jme", "showPreview": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar x1 = -1*unwrap(variables.x1);\n\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (Math.floor(x1) == ans) {\n this.setCredit(0,\"Close. This is the floor of $\" + x1 + \"$.\");\n }\n else if (Math.ceil(x1) == ans) { \n this.setCredit(1,\"Correct. This is the ceiling of $\" + x1 + \"$.\");\n }\n else if (ans % 1 != 0) {\n this.setCredit(0,\"Your answer should be an integer.\"); \n }\n else {\n this.setCredit(0,\"Incorrect.\"); \n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "showFeedbackIcon": true, "checkVariableNames": false, "expectedVariableNames": [], "prompt": "

$\\lceil -\\var{x1}\\rceil$

", "customMarkingAlgorithm": ""}], "functions": {}, "advice": "

Normally, when you round a number you round up to the nearest integer. For example $3.51$ gets rounded up to $4$, but $3.49$ gets rounded down to $3$.

\n

The floor and ceiling functions are two different ways of rounding a number.

\n
\n
• The floor function always rounds down: $\\lfloor 3.51\\rfloor = 3$.
• \n
• In contrast the ceiling function always rounds up: $\\lceil 3.49 \\rceil = 4$.
• \n
", "ungrouped_variables": ["x1"], "statement": "

The floor of $x$ is defined to be the largest integer smaller than $x$. Similarly the ceiling of $x$ is defined to be the smallest integer bigger than $x$. We use the notation $\\lfloor x\\rfloor$ for the floor and $\\lceil x\\rceil$ for the ceiling. Evaluate the following:

\n

", "variables": {"x1": {"templateType": "anything", "name": "x1", "definition": "random(1..9)+random(1..9)/10", "description": "", "group": "Ungrouped variables"}}, "rulesets": {}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question"}, {"name": "Functions: injective", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "functions": {}, "statement": "

By definition, a function $f : A \\mapsto B$ has the property that $a$ uniquely determines $f(a)$. But can $f(a)$ also uniquely determine $a$? If so we say that the function is injective or one-to-one.

\n

Formally, a function $f(x)$ is said to be injective when $f(x_1) = f(x_2)$ implies that $x_1=x_2$.

", "tags": [], "parts": [{"type": "gapfill", "sortAnswers": false, "marks": 0, "gaps": [{"type": "numberentry", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "marks": "0", "correctAnswerFraction": false, "mustBeReduced": false, "scripts": {"validate": {"order": "instead", "script": "return true;"}, "mark": {"order": "instead", "script": "this.setCredit(1,\"There is no mark available for this part.\");\n"}}, "allowFractions": false, "customMarkingAlgorithm": "", "maxValue": "0.1", "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "minValue": "0.1", "showFeedbackIcon": false, "unitTests": []}, {"type": "numberentry", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "marks": "1", "correctAnswerFraction": false, "mustBeReduced": false, "scripts": {"validate": {"order": "instead", "script": "return true;"}, "mark": {"order": "instead", "script": "var unwrap = Numbas.jme.unwrapValue;\n\ntry {\n // get the student's answers to the first two steps\n var gap0 = parseFloat(this.parentPart.gaps[0].studentAnswer);\n var gap1 = parseFloat(this.parentPart.gaps[1].studentAnswer);\n \n var floor0 = Math.floor(gap0);\n var floor1 = Math.floor(gap1);\n\n if (gap0 == gap1) {\n this.multCredit(0.5,\"You must choose $x_1 \\\\neq x_2$.\");\n return;\n } else if (floor0 == floor1) {\n this.setCredit(1,\"Based on your choice of $x_1$ and $x_2$, $\\\\lfloor x_1 \\\\rfloor = \" + floor0 + \" = \\\\lfloor x_2 \\\\rfloor$ as required.\" ); \n } else {\n this.multCredit(0.5,\"You must choose $x_1$ and $x_2$ such that $\\\\lfloor x_1 \\\\rfloor = \\\\lfloor x_2 \\\\rfloor$. But, based on your choices $\\\\lfloor x_1 \\\\rfloor = \" + floor0 + \" \\\\neq \" + floor1 + \" = \\\\lfloor x_2 \\\\rfloor$.\" ); \n }\n //var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "allowFractions": false, "customMarkingAlgorithm": "", "maxValue": "0.2", "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "minValue": "0.2", "showFeedbackIcon": true, "unitTests": []}], "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "

Prove that the floor function $\\lfloor \\,\\, \\rfloor : \\mathbb R \\mapsto \\mathbb Z$ is not injective by finding two values $x_1, x_2$ such $\\lfloor x_1 \\rfloor = \\lfloor x_2 \\rfloor$ but $x_1 \\neq x_2$.

\n

$x_1 =$ [[0]] and $x_2 =$ [[1]].

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": []}, {"type": "m_n_2", "choices": ["

$\\sin : \\mathbb R \\mapsto [-1,1]$

", "

$f(x) = \\mathbb R \\mapsto \\mathbb R, \\, f(x) = 2x$

", "

$g: \\mathbb R \\mapsto \\mathbb R, \\, g(x) =x^2$

", "

$h : \\mathbb R \\mapsto \\mathbb R,\\, h(x) = x^3 + x - 1$

"], "minAnswers": 0, "warningType": "none", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "

Which of the following functions are injective?

", "displayColumns": 0, "variableReplacements": [], "showFeedbackIcon": true, "unitTests": [], "shuffleChoices": true, "matrix": ["-1", "1", "-1", "1"], "marks": 0, "scripts": {}, "maxMarks": 0, "minMarks": 0, "distractors": ["$\\sin$ is not injective since $\\sin(0) = \\sin(\\pi)$ but $0 \\neq \\pi$.", "", "$g(x)$ is not injective since $g(-1) = g(1)$ but $-1 \\neq 1$.", "$h(x)$ is injective because it is continuous and $h^\\prime(x) > 0$."], "variableReplacementStrategy": "originalfirst", "maxAnswers": 0, "displayType": "checkbox", "showCorrectAnswer": true}], "variables": {}, "variable_groups": [], "rulesets": {}, "ungrouped_variables": [], "advice": "

Part a shows that to prove a function is not injective, find specific values of $x_1,x_2$ such that $f(x_1) = f(x_2)$ but $x_1 \\neq x_2$.

\n

Part b, this same method can be used to show that

\n
\n
• $\\sin$ is not injective since $\\sin(0) = \\sin(\\pi)$ but $0 \\neq \\pi$.
• \n
• $g(x)$ is not injective since $g(-1) = g(1)$ but $-1 \\neq 1$.
• \n
\n

There are two common methods to show a function is injective.

\n
\n
• If the function is continuous and has strictly positive (or strictly negative) derivative, then the function is injective. This is useful to prove that $\\tan(x)$ is injective because it is continuous on $(-\\pi/2,\\pi/2)$ and has derivative $\\sec^2(x) > 0$.
• \n
• For some simple functions it is possible to prove the injective property directly. For example if you assume
• \n
\n

$f(x_1) = f(x_2)$

\n

by definition of $f$

\n

$2x_1 = 2x_2$

\n

and dividing by $2$:

\n

$x_1=x_2$.

\n

Hence $f(x) = 2x$ is injective.

", "preamble": {"js": "", "css": ""}, "metadata": {"description": "

Gives students an introduction to the injective property of functions

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question"}, {"name": "Functions: surjective", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "functions": {}, "variable_groups": [], "advice": "

This question introduces the surjective property of a function. You will need to be able to confidently identify the domain, codomain and range of a function before you can understand the surjective property.

\n

There are two proof styles.

\n
\n
• To prove that a function $f$ is surjective, start with a generic element $b$ from the codomain and, by solving $f(a) = b$ for $a$, show that $a$ is in the domain.
• \n
• Always prove that a function $f$ is not surjective by contradiction. Start with a specific element $b \\in B$ and, by solving $f(a) = b$ for $a$, show that $a$ is not in the domain. This contradiction proves it is not possible for the function to be surjective.
• \n
\n
\n

The codomain of $f_1$ is $\\mathbb Z$. Suppose that $f_1$ is surjective, which means that the whole codomain gets mapped to, and in particular that there is some integer $a$ such that $f(a) = 1 \\in \\mathbb Z$. Then

\n

$f_1(a) = 2a = 1$

\n

and so $a = \\frac{1}{2}$. But $\\frac{1}{2} \\not\\in \\operatorname{Domain}(f_1) = \\mathbb Z$, so our assumption that $f_1$ is surjective must be false.

\n
\n

The codomain of $f_2$ is $\\mathbb Z$. For any $b \\in \\mathbb Z$ suppose that $f(a) = b$. Then

\n

$f_2(a) = \\lceil a \\rceil = b$.

\n

There are many values of $a$ which map to $b$, and one such value is just $a=b \\in \\operatorname{Domain}(f_2) = \\mathbb R$. So $f_2$ is surjective.

\n
\n

The codomain of $f_3$ is the positive rationals $\\mathbb Q^+$. For any $\\frac{p}{q} \\in \\mathbb Q^+$ suppose that $f(a) = \\frac{p}{q}$. Then

\n

$f_3(a) = \\frac{1}{a} = \\frac{p}{q}$

\n

and so $a = \\frac{q}{p} \\in \\operatorname{Domain}(f_3) = \\mathbb Q^+$. So $f_3$ is surjective.

", "ungrouped_variables": [], "variables": {}, "tags": [], "statement": "

Consider the example

\n

$f: \\mathbb Z \\mapsto \\mathbb R, \\quad f(x) = \\left|x\\right|$.

\n
\n
• The set of possible inputs $\\mathbb Z$ is called the domain.
• \n
• The set of possible outputs $\\mathbb R$ is called the codomain.
• \n
\n

A function must be defined for every element of its domain, but the codomain may contain additional elements that are unused.

", "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

An introduction to terminology about the surjective property of a function.

"}, "parts": [{"showFeedbackIcon": true, "maxMarks": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "shuffleChoices": true, "choices": ["

$\\mathbb N$

", "

$\\mathbb Z^+$

", "

$\\mathbb Z$

", "

$\\mathbb R$

"], "variableReplacements": [], "marks": 0, "showCorrectAnswer": true, "displayType": "radiogroup", "minMarks": 0, "matrix": ["1", 0, 0, 0], "distractors": ["", "$f(0) = 0 \\not\\in \\mathbb Z^+$, and the range must include all the elements that are mapped to.", "There is no integer $a$ such that $f(a) = a^2 = -1 \\in \\mathbb Z$.", "There is no integer $a$ such that $f(a) = a^2 = \\sqrt{2} \\in \\mathbb R$."], "displayColumns": 0, "type": "1_n_2", "prompt": "

The set of actual outputs is called the range and may be different to the codomain. In other words, the range is the set of all elements that are actually mapped to, or in the language of sets

\n

$\\operatorname{Range}(f) = \\left\\{ b | \\, f(a) = b, a \\in \\mathbb Z\\right\\}$.

\n

What is the range of $f$?

"}, {"showFeedbackIcon": true, "maxMarks": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "shuffleChoices": true, "choices": ["

$\\mathbb Z$

", "

$\\mathbb N$

", "

$\\mathbb R$

"], "variableReplacements": [], "marks": 0, "showCorrectAnswer": true, "displayType": "radiogroup", "minMarks": 0, "matrix": [0, 0, "1"], "distractors": ["The question asked for codomain, but you selected the domain.", "The question asked for codomain, but you selected the range.", ""], "displayColumns": 0, "type": "1_n_2", "prompt": "

If the codomain and range are equal the function is said to be surjective or onto. The function $f$ is not surjective because the codomain is different to the range. The codomain is

"}, {"showFeedbackIcon": true, "maxMarks": 0, "maxAnswers": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "choices": ["

$f_1 : \\mathbb Z \\mapsto \\mathbb Z, \\quad f_1(x) = 2x$

", "

$f_2 : \\mathbb R \\mapsto \\mathbb Z, \\quad f_2(x) = \\lceil x\\rceil$

", "

$f_3 : \\mathbb Q^+ \\mapsto \\mathbb Q^+, \\quad f_3(x) = \\frac{1}{x}$

"], "variableReplacements": [], "marks": 0, "showCorrectAnswer": true, "distractors": ["The range of $f_1$ is the even integers, which is not the same as the codomain.", "", ""], "displayType": "checkbox", "minMarks": 0, "matrix": ["-1", "1", "1"], "minAnswers": 0, "displayColumns": 0, "type": "m_n_2", "prompt": "

Select all functions that are surjective. For this question the set of positive rational numbers is denoted by $\\mathbb Q^+$.

", "warningType": "none"}], "preamble": {"js": "", "css": ""}, "rulesets": {}, "type": "question"}, {"name": "Functions: bijective", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "parts": [{"variableReplacements": [], "gaps": [{"variableReplacements": [], "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "type": "jme", "showCorrectAnswer": true, "showFeedbackIcon": true, "showPreview": true, "unitTests": [], "vsetRangePoints": 5, "marks": 1, "failureRate": 1, "customMarkingAlgorithm": "", "expectedVariableNames": [], "scripts": {}, "answer": "1/b"}], "prompt": "

Prove that $f(x)$ surjective.

\n

Assume that $b \\in \\mathbb R$. We must find some $a$ such that $f(a) = b$. There are two cases to consider.

\n

If $b=0$ then choose $a = 0$.

\n

Otherwise, $b \\neq 0$ and then choose $a =$ [[0]].

\n

In either case, $f(a) = b$ and so the function is surjective.

", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "sortAnswers": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacementStrategy": "originalfirst"}, {"variableReplacements": [], "gaps": [{"variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "maxValue": "0", "mustBeReducedPC": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "marks": 1, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "allowFractions": false, "minValue": "0", "scripts": {}, "variableReplacementStrategy": "originalfirst"}], "prompt": "

Prove that $f(x)$ is injective.

\n

Assume that $f(x_0) = f(x_1)$. We must prove that $x_0 = x_1$. There are two cases to consider.

\n

If $f(x_0) = f(x_1) = 0$ then $x_0 = x_1 =$ [[0]].

\n

Otherwise, $f(x_0) = f(x_1) \\neq 0$ and then

\n

$x_0 = \\frac{1}{f(x_0)} = \\frac{1}{f(x_1)} = x_1$.

\n

In either case, $x_0 = x_1$ and so the function is injective.

", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "sortAnswers": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacementStrategy": "originalfirst"}, {"variableReplacements": [], "gaps": [{"variableReplacements": [], "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "type": "jme", "showCorrectAnswer": true, "showFeedbackIcon": true, "showPreview": true, "unitTests": [], "vsetRangePoints": 5, "marks": 1, "failureRate": 1, "customMarkingAlgorithm": "", "expectedVariableNames": [], "scripts": {}, "answer": "x"}], "prompt": "

Because $f$ is surjective and injective, it is bijective and therefore has an inverse.

\n

In this case we can actually see that $f$ is its own inverse because $f(f(x)) =$ [[0]].

", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "sortAnswers": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacementStrategy": "originalfirst"}], "tags": [], "statement": "

A function which is both surjective and injective is said to be bijective.

\n

This is an important property because it guarantees that $f: A \\mapsto B$ has an inverse function $f^{-1} : B \\mapsto A$.

\n
\n

Let's prove that the function $f: \\mathbb R \\mapsto \\mathbb R$ defined by

\n

$f(x) = \\left\\{ \\begin{array}{cl} \\frac{1}x & x \\neq 0 \\\\ 0 & x = 0.\\end{array}\\right.$

\n

has an inverse.

\n

This question summarizes the definitions of surjective and injective, and applies them to prove the existance of an inverse.

\n
\n

For continuous functions it is possible to prove that it injective by using the derivative. But $f$ is not continuous, and nor is it strictly increasing or strictly decreasing. In fact it is strictly decreasing for $x<0$ and strictly increasing for $x>0$.

\n

{myscript()}

\n

So we pretty much have to prove that $f$ is injective directly from the definition.

\n
\n

Since $f$ is a bijection we know that an inverse exists, but this information does not tell us how to find it. This example is special because the inverse is easy to find.

", "preamble": {"css": "", "js": ""}, "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

This question summarizes the definitions of surjective and injective, and applies them to prove the existance of an inverse.

"}, "functions": {"myscript": {"definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in\n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox: [-4,4,4,-4],\n axis: true,\n showNavigation: false,\n grid: true\n });\n\n// div.board is the object created by JSXGraph, which you use to\n// manipulate elements\nvar board = div.board;\n\n// Then do whatever you want with the board....\nboard.create('functiongraph',[function(x){ return (0 == x ? 0 : 1/x);},0.01,4]);\nboard.create('functiongraph',[function(x){ return (0 == x ? 0 : 1/x);},-4,0.01]);\nvar p = board.createElement('point',[0,0], {visible: true, size:1, color:'blue',fixed:true});\np.setLabel(\"\");\n\n//var theLine = board.create('line',[[-4,0],[4,0]],{visible: false});\n//var x = board.create('glider',[theLine],{name:'x'});\n//var pointoncurve = board.create('point',[x.X(),(0 == x.X() ? 0 : 1/x.X())],{name:'f2',visible:true,size:3,color:'blue'});\n\n\n// and return the container div\nreturn div;", "type": "html", "language": "javascript", "parameters": []}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "ungrouped_variables": [], "variables": {}, "type": "question"}, {"name": "Modular Arithmetic: time", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}], "ungrouped_variables": ["hours24", "hours12", "start", "duration", "ansA", "ansB", "startb", "ansC", "c"], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a. In 24 hour time: {hours24[start]} + {duration}:00 = {start+duration+1}:00 = {hours24[mod(start+duration,24)]}

\n

b. In 12 hour time {hours12[startb]} + {duration}:00 = {startb+duration+1}:00 = {hours12[mod(startb+duration,12)]}

\n

c. A time of {hours12[c]} in 12-hour format could mean {hours24[c]} or {hours24[c+12]} in 24-hour format.

Simple intro to mod arithmetic

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "rulesets": {}, "functions": {}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "tags": [], "variables": {"startb": {"group": "Ungrouped variables", "name": "startb", "definition": "random(5..10)", "templateType": "anything", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "definition": "random(0..11)", "templateType": "anything", "description": ""}, "hours24": {"group": "Ungrouped variables", "name": "hours24", "definition": "[\"01:00\",\"02:00\",\"03:00\",\"04:00\",\"05:00\",\"06:00\",\"07:00\",\"08:00\",\"09:00\",\"10:00\",\"11:00\",\"12:00\",\"13:00\",\"14:00\",\"15:00\",\"16:00\",\"17:00\",\"18:00\",\"19:00\",\"20:00\",\"21:00\",\"22:00\",\"23:00\",\"00:00\"]", "templateType": "anything", "description": ""}, "start": {"group": "Ungrouped variables", "name": "start", "definition": "random(18..22 except startb+12)", "templateType": "anything", "description": ""}, "hours12": {"group": "Ungrouped variables", "name": "hours12", "definition": "[\"1:00\",\"2:00\",\"3:00\",\"4:00\",\"5:00\",\"6:00\",\"7:00\",\"8:00\",\"9:00\",\"10:00\",\"11:00\",\"12:00\"]", "templateType": "anything", "description": ""}, "ansC": {"group": "Ungrouped variables", "name": "ansC", "definition": "map(if(mod(x,12) = c,1,-1), x, 0..23)", "templateType": "anything", "description": ""}, "ansB": {"group": "Ungrouped variables", "name": "ansB", "definition": "map(if(mod(startb + duration,12) = x,1,0), x, 0..11)", "templateType": "anything", "description": ""}, "ansA": {"group": "Ungrouped variables", "name": "ansA", "definition": "map(if(mod(start + duration,24) = x,1,0), x, 0..23)", "templateType": "anything", "description": ""}, "duration": {"group": "Ungrouped variables", "name": "duration", "definition": "random(7..10)", "templateType": "anything", "description": ""}}, "parts": [{"showCorrectAnswer": true, "maxMarks": 0, "customName": "", "type": "1_n_2", "variableReplacements": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "dropdownlist", "matrix": "{ansA}", "shuffleChoices": false, "minMarks": 0, "scripts": {}, "useCustomName": false, "displayColumns": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

If you go to bed at $\\var{hours24[start]}$ and sleep for $\\var{duration}$ hours, at what time will you wake up? Give your answer in 24-hour format.

", "showCellAnswerState": true, "choices": "{hours24}", "marks": 0}, {"showCorrectAnswer": true, "maxMarks": 0, "customName": "", "type": "1_n_2", "variableReplacements": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "dropdownlist", "matrix": "{ansB}", "shuffleChoices": false, "minMarks": 0, "scripts": {}, "useCustomName": false, "displayColumns": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

If you go to bed at $\\var{hours12[startb]}$ and sleep for $\\var{duration}$ hours, at what time will you wake up? Give your answer in 12-hour format.

", "showCellAnswerState": true, "choices": "{hours12}", "marks": 0}, {"displayColumns": 0, "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "checkbox", "useCustomName": false, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

Deep in thought about discrete mathematics, you lost track of day and night. You glance at a 12-hour clock that reads $\\var{hours12[c]}$. What time is it in 24-hour time (tick all that could be true)?

", "minAnswers": 0, "maxAnswers": 0, "showCorrectAnswer": true, "customName": "", "warningType": "none", "variableReplacements": [], "maxMarks": 0, "shuffleChoices": false, "matrix": "{ansC}", "scripts": {}, "type": "m_n_2", "showCellAnswerState": true, "choices": "{hours24}", "marks": 0}], "statement": "

The concept of modular arithmetic is already familiar from everyday life.

", "type": "question"}, {"name": "Modular Arithmetic: quotient and remainder", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}], "tags": [], "metadata": {"description": "

Gentle intro to modular arithmetic through quotients and remainders

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "

Given integers $a,b \\in \\mathbb Z$ we can write $a$ in the form

\n

$a = qb + r$

\n

for some $q,r \\in \\mathbb Z$ where $0 \\leq r < p$. The numbers $q$ and $r$ are called the quotient and remainder when $a$ is divided by $b$:

\n

$\\displaystyle \\frac{a}{b} = q + \\frac{r}{b}$.

\n

In modular arithmetic (in this case, modulo $b$) our interest is focused on the remainder. The operation $a \\operatorname{mod} b = r$.

The first two questions introduce the idea that different numbers in $\\mathbb Z$ can be the same in modulo $b$. For example in modulo $\\var{p}$ the numbers

\n

$\\var{p}, \\var{2p}, \\var{3p}, \\cdots$

\n

are equivalent to zero. While the numbers

\n

$\\var{p2+1}, \\var{2p2+1}, \\var{3p2+1}, \\cdots$

\n

are equivalent to $1 \\pmod{\\var{p2}}$.

\n
\n

The next question introduce a simple divisibility test: $a=qb = qb+0$ exactly when $a\\equiv 0\\pmod{b}$. This is just another way to say that $b$ divides $a$, or that $a$ is a multiple of $b$. In particular

\n

$\\var{p*p2} = \\var{p}\\times \\var{p2}$ is divisible by $\\var{p}$ and $\\var{p2}$.

", "rulesets": {}, "variables": {"p2": {"name": "p2", "group": "Ungrouped variables", "definition": "random(4..9 except p)", "description": "", "templateType": "anything"}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(4..9)", "description": "", "templateType": "anything"}, "r": {"name": "r", "group": "Ungrouped variables", "definition": "random(1..(p-2))", "description": "", "templateType": "anything"}, "r2": {"name": "r2", "group": "Ungrouped variables", "definition": "random(1..(p2-2) except r)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["p", "r", "p2", "r2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Which numbers have a remainder of $\\var{r}$ when divided by $\\var{p}$? These numbers would be considered equal in modulo $\\var{p}$.

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["

$\\var{r+p}$

", "

$\\var{r-p}$

", "

$\\var{r+p+1}$

", "

$\\var{r-p-1}$

", "

$\\var{r-2p+1}$

", "

$\\var{r-2p}$

", "

$\\var{r+3p}$

"], "matrix": ["0.25", "0.25", "-0.25", "-0.25", "-0.25", "0.25", "0.25"], "distractors": ["$\\var{r+p} = 1\\times \\var{p} + \\var{r}$ and so has remainder $\\var{r}$.", "$\\var{r-p} = (-1)\\times \\var{p} + \\var{r}$ and so has remainder $\\var{r}$.", "$\\var{r+p+1} = 1\\times \\var{p} + \\var{r+1}$ and so has remainder $\\var{r+1}$.", "$\\var{r-p-1} = (-1)\\times \\var{p} + \\var{r-1}$ and so has remainder $\\var{r-1}$.", "$\\var{r-2p-1} = (-2)\\times \\var{p} + \\var{r-1}$ and so has remainder $\\var{r-1}$.", "$\\var{r-2p} = (-2)\\times \\var{p} + \\var{r}$ and so has remainder $\\var{r}$.", "$\\var{r+3p} = 3\\times \\var{p} + \\var{r}$ and so has remainder $\\var{r}$."]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Which numbers are equal to $\\var{r2}$ in modulo $\\var{p2}$?

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["

$\\var{r2+p2}$

", "

$\\var{r2-p2}$

", "

$\\var{r2+p2+1}$

", "

$\\var{r2-p2-1}$

", "

$\\var{r2}$

", "

$\\var{r2-2*p2}$

", "

$\\var{r2+3*p2-1}$

"], "matrix": ["0.25", "0.25", "-0.25", "-0.25", "0.25", "0.25", "-0.25"], "distractors": ["$\\var{r2+p2} = 1\\times \\var{p2} + \\var{r2}$ and so has remainder $\\var{r2}$.", "$\\var{r2-p2} = (-1)\\times \\var{p2} + \\var{r2}$ and so has remainder $\\var{r2}$.", "$\\var{r2+p2+1} = 1\\times \\var{p2} + \\var{r2+1}$ and so has remainder $\\var{r2+1}$.", "$\\var{r2-p2-1} = (-1)\\times \\var{p2} + \\var{r2-1}$ and so has remainder $\\var{r2-1}$.", "$\\var{r2} = (0)\\times \\var{p2} + \\var{r2}$ and so has remainder $\\var{r2}$.", "$\\var{r2-2*p2} = (-2)\\times \\var{p2} + \\var{r2}$ and so has remainder $\\var{r2}$.", "$\\var{r2+3*p2-1} = 3\\times \\var{p2} + \\var{r2-1}$ and so has remainder $\\var{r2-1}$."]}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar p1 = unwrap(variables.p);\nvar p2 = unwrap(variables.p2);\n\ntry {\n // get the student's answers to the first two steps\n var ans = Numbas.util.parseNumber(this.studentAnswer);\n \n var grade = 0;\n \n if (ans == 0) {\n this.markingComment(\"The question asks for a non-zero number.\");\n }\n else {\n var p = p1;\n for (var i = 0; i < 2; i++) \n { \n if (0 == (ans % p)) {\n grade += 0.5;\n this.markingComment(\"$\" + ans + \" = \" + (ans % p) + \" \\\\pmod{\" + p + \"}$.\");\n } \n else {\n this.markingComment(\"$\" + ans + \" = \" + (ans % p) + \" \\\\neq 0 \\\\pmod{\" + p + \"}$.\");\n };\n p = p2;\n }\n }\n this.setCredit(grade,\"\");\n //var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "instead"}, "validate": {"script": "return Numbas.util.isNumber(this.studentAnswer,false,\"\");", "order": "instead"}}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

A number $a$ is a multiple of $b$ precisely when $a=qb$ for some number $q$. In terms of modular arithmetic we would say $a \\operatorname{mod} b = 0$ because $a$ has no remainder when divided by $b$.

\n

Enter a non-zero number which is equivalent to $0 \\pmod{\\var{p}}$ and also equivalent to $0 \\pmod{\\var{p2}}$.

", "minValue": "{p*p2}", "maxValue": "{p*p2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}]}, {"name": "Modular Arithmetic: Greatest Common Divisor", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}], "tags": [], "metadata": {"description": "

Introduces the GCD and a simple form of the Euclidian Algorithm

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "

A number $n$ divides $a$ when $a = nq$ for some $q$.

\n

Any number which divides both $a$ and $b$ is called a common divisor of $a$ and $b$, the largest common divisor is called the greatest common divisor and is denoted $\\gcd(a,b)$.

Every number divides zero, so the largest number to divide $\\var{a1}$ is the greatest common divisor of $0$ and $\\var{a1}$. This means that $\\gcd(\\var{a1},0) = \\var{a1}$.

\n
\n

The Euclidian Algorithm presented here is a variation on the usual presentation. Another common method keeps track of the quotients:

\n

$\\var{gcd*(1+b*(1+a))} = \\var{b}\\times (\\var{gcd*(1+a)}) + \\var{a1}$

\n

$\\var{gcd*(1+a)} = \\var{gcd*(1+a)/a1}\\times (\\var{a1}) + 0$

\n

to write the $\\gcd$ in the form of Bézout's identity

\n

$\\var{gcd*(1+b*(1+a))} - \\var{b}\\times (\\var{gcd*(1+a)}) = \\var{a1}$.

", "rulesets": {}, "variables": {"a2": {"name": "a2", "group": "Ungrouped variables", "definition": "mod(gcd*(a+1),a1)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(2..9 except [a,gcd])", "description": "", "templateType": "anything"}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "mod(gcd*(1+b*(1+a)),gcd*(1+a))", "description": "", "templateType": "anything"}, "big": {"name": "big", "group": "Ungrouped variables", "definition": "random(100..199)", "description": "", "templateType": "anything"}, "gcd": {"name": "gcd", "group": "Ungrouped variables", "definition": "random(3..19)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..9 except gcd)", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "gcd*(1+a)/a1", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "gcd", "a1", "a2", "c", "big"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

As a consequence of these definitions, every number $n$ divides zero because $0 = n\\times 0$.

\n

So $\\gcd(\\var{big},0)$ is

", "minValue": "{big}", "maxValue": "{big}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

What is $\\gcd(\\var{gcd*(1+b*(1+a))},\\var{gcd*(1+a)})$?

", "stepsPenalty": 0, "steps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The procedure is to use the identity

\n

$\\gcd(a,b) = \\gcd(a\\mod b, b)$.

\n

to simplify the question.

\n

Compute $\\var{gcd*(1+b*(1+a))} \\mod{\\var{gcd*(1+a)}}$.

", "minValue": "{a1}", "maxValue": "{a1}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Hence $\\gcd(\\var{gcd*(1+b*(1+a))},\\var{gcd*(1+a)}) = \\gcd(\\var{a1},\\var{gcd*(1+a)})$. We can simplify this again using the identity

\n

$\\gcd(a,b) = \\gcd(a, b\\mod a)$.

\n

Compute $\\var{gcd*(a+1)} \\mod{\\var{a1}}$.

", "minValue": "{a2}", "maxValue": "{a2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

By re-applying these identities, the question has been simplified to something managable:

\n

$\\gcd(\\var{gcd*(1+b*(1+a))},\\var{gcd*(1+a)}) = \\gcd(\\var{a1},\\var{gcd*(1+a)}) = \\gcd(\\var{a1}, 0)$.

"}], "minValue": "{gcd}", "maxValue": "{gcd}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}]}]}], "feedback": {"showactualmark": true, "allowrevealanswer": true, "intro": "", "showtotalmark": true, "showanswerstate": true, "feedbackmessages": [], "advicethreshold": 0}, "showstudentname": true, "name": "Week 2: Functions and modular arithmetic", "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Formative assessment to introduce the concepts of modular arithmetic.

"}, "percentPass": 0, "showQuestionGroupNames": false, "navigation": {"showfrontpage": true, "allowregen": true, "onleave": {"message": "", "action": "none"}, "reverse": true, "showresultspage": "oncompletion", "preventleave": true, "startpassword": "", "browse": true}, "timing": {"allowPause": true, "timedwarning": {"message": "", "action": "none"}, "timeout": {"message": "", "action": "none"}}, "duration": 0, "type": "exam", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/Floor_function.svg.png", "/srv/numbas/media/question-resources/Floor_function.svg.png"]]}