## MATH1014 Quizzes

Quiz 4: Code Vectors and Modular Arithmetic
Question 1 Questions
What is $5×3-4×2$ in ${ℤ}_{6}$? (Hint: recall that the elements of ${ℤ}_{6}$ are $\left\{0,\phantom{\rule{0.3em}{0ex}}1,\phantom{\rule{0.3em}{0ex}}2,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}4,\phantom{\rule{0.3em}{0ex}}5\right\}$. ) Exactly one option must be correct)
 a) 0 b) 1 c) 2 d) 3 e) 4 f) 5

Choice (a) is incorrect
Choice (b) is correct!
$5×3-4×2=15-8=7=6+1$, and so the answer in ${ℤ}_{6}$ is 1.
Choice (c) is incorrect
Choice (d) is incorrect
Choice (e) is incorrect
Choice (f) is incorrect
Find $\left(\left(9×2\right)+5\right)\left(3+8+4\right)\left(1+\left(6×7\right)\right)$ in ${ℤ}_{10}$. Enter your answer into the answer box.

Correct!
We have $\left(\left(9×2\right)+5\right)\left(3+8+4\right)\left(1+\left(6×7\right)\right)=23×15×43=3×5×3=5\phantom{\rule{0.3em}{0ex}}$ in ${ℤ}_{10}$.
Incorrect. Please try again.
Remember that all computations in ${ℤ}_{10}$ should be reduced by subtracting multiples of 10 so that the answer lies from 0 to 9 (inclusive).
Find the dot product $\left[1,3,2\right]\cdot \left[4,5,1\right]$ in ${ℤ}_{5}^{3}$.

Correct!
$\left[1,3,2\right]\cdot \left[4,5,1\right]=4+15+2=21=1$ in ${ℤ}_{5}$.
Incorrect. Please try again.
Remember that the dot product is calculated in the usual way and the answer is then reduced so it is one of the elements of ${ℤ}_{5}$.
How many solutions are there in ${ℤ}_{6}$ of the equation $2x=0$? Exactly one option must be correct)
 a) None b) One c) Two d) Three e) More than three

Choice (a) is incorrect
Remember that ${ℤ}_{6}$ contains the elements $\left\{0,\phantom{\rule{0.3em}{0ex}}1,\phantom{\rule{0.3em}{0ex}}2,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}4,\phantom{\rule{0.3em}{0ex}}5\right\}$. You can use trial and error to find all elements that satisfy the given equation.
Choice (b) is incorrect
Remember that ${ℤ}_{6}$ contains the elements $\left\{0,\phantom{\rule{0.3em}{0ex}}1,\phantom{\rule{0.3em}{0ex}}2,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}4,\phantom{\rule{0.3em}{0ex}}5\right\}$. You can use trial and error to find all elements that satisfy the given equation.
Choice (c) is correct!
By trial and error, we find that $x=0$ and $x=3$ are the only solutions of the equation. We have $2×0=0$ and $2×3=6=0$ in ${ℤ}_{6}$.
Choice (d) is incorrect
Remember that ${ℤ}_{6}$ contains the elements $\left\{0,\phantom{\rule{0.3em}{0ex}}1,\phantom{\rule{0.3em}{0ex}}2,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}4,\phantom{\rule{0.3em}{0ex}}5\right\}$. You can use trial and error to find all elements that satisfy the given equation.
Choice (e) is incorrect
Remember that ${ℤ}_{6}$ contains the elements $\left\{0,\phantom{\rule{0.3em}{0ex}}1,\phantom{\rule{0.3em}{0ex}}2,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}4,\phantom{\rule{0.3em}{0ex}}5\right\}$. You can use trial and error to find all elements that satisfy the given equation.
The solutions in ${ℤ}_{10}$ of the equation ${x}^{2}=3x$ are: Exactly one option must be correct)
 a) $x=0$ b) $x=0,\phantom{\rule{0.3em}{0ex}}3$ c) $x=0,\phantom{\rule{0.3em}{0ex}}3,\phantom{\rule{0.3em}{0ex}}5,\phantom{\rule{0.3em}{0ex}}8$ d) $x=0,\phantom{\rule{0.3em}{0ex}}8$

Choice (a) is incorrect
This is one of the solutions but not the only one. You could try a systematic approach and find the squares of all the members of ${ℤ}_{10}$, then check to see which of these are equal to three times the original number.
Choice (b) is incorrect
These are certainly solutions but they aren’t the only ones. You could try a systematic approach and find the squares of all the members of ${ℤ}_{10}$, then check to see which of these are equal to three times the original number.
Choice (c) is correct!
Strangely, the quadratic equation has four solutions in ${ℤ}_{10}$! We see that
${0}^{2}=0=3×0,\phantom{\rule{1em}{0ex}}{3}^{3}=9=3×3,$
${5}^{2}=25=5=15=3×5,\phantom{\rule{1em}{0ex}}{8}^{2}=64=4=24=3×8.$
Choice (d) is incorrect
These are certainly solutions (${0}^{2}=0=3×0,\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}{8}^{2}=64=4=24=3×8$) but they aren’t the only ones. You could try a systematic approach and find the squares of all the members of ${ℤ}_{10}$, then check to see which of these are equal to three times the original number.
Find the solution of the following simultaneous equations in ${ℤ}_{12}$.
$3x=0,\phantom{\rule{2em}{0ex}}2x+4=0.$

Correct!
In ${ℤ}_{12}$, we see by trial and error that there are three values of $x$ satisfying $3x=0$, namely $x=0,\phantom{\rule{0.3em}{0ex}}x=4,\phantom{\rule{0.3em}{0ex}}x=8$. Neither $x=0$ nor $x=8$ satisfies $2x+4=0$, since $2×0+4=4$ and $2×8+4=20=8$. However, $2×4+4=8+4=12=0.$ Therefore $x=4$.
Incorrect. Please try again.
One method is to find all solutions to $3x=0$ in ${ℤ}_{12}$ by trying all possible values of $x$ from 0 to 11. Then see if any of these satisfy $2x+4=0$.
How many values of $a$ are there in ${ℤ}_{4}$ for which we can find an $x$ in ${ℤ}_{4}$ satisfying the equation $ax=1$? Exactly one option must be correct)
 a) None b) One c) Two d) Three

Choice (a) is incorrect
Work systematically. First let $a=0$ and see if $x$ can be found to satisfy $0×x=1$. Then let $a=1$ and repeat the process, etc.
Choice (b) is incorrect
Work systematically. First let $a=0$ and see if $x$ can be found to satisfy $0×x=1$. Then let $a=1$ and repeat the process, etc.
Choice (c) is correct!
We can’t find any solution to $ax=1$ when $a=0$, for then the left hand side is $0$. When $a=1$ we see that $x=1$ is a solution. When $a=2$ we see that $2x$ is either 0 or 2 but never 1. When $a=3$ we see that $3x=1$ has solution $x=3$. So $ax=1$ can be solved only when $a=1$ or $a=3$.
Choice (d) is incorrect
Work systematically. First let $a=0$ and see if $x$ can be found to satisfy $0×x=1$. Then let $a=1$ and repeat the process, etc.
How many of the following three ISBNs is/are correct? (Recall that the check vector for ISBNs is $\mathbf{c}=\left[10,9,8,7,6,5,4,3,2,1\right]$ and that operations are performed in ${ℤ}_{11}$.) $\mathbf{u}=\left[0,1,9,2,8,6,1,0,3,4\right]$ $\mathbf{v}=\left[0,1,4,0,0,8,3,7,1,3\right]$ $\mathbf{w}=\left[0,5,8,2,7,0,0,5,5,2\right]$ Exactly one option must be correct)
 a) All three are correct. b) Two are correct. c) One is correct. d) None are correct.

Choice (a) is incorrect
Choice (b) is incorrect
Choice (c) is correct!
There is a single correct ISBN, namely $\mathbf{u}$. This is the only one whose dot product with $\mathbf{c}$ equals zero in ${ℤ}_{11}$.
Choice (d) is incorrect
What is the value of the GTIN-13 check digit $d$ in $\mathbf{u}=\left[4,2,3,4,1,8,6,2,2,6,7,5,d\right]$? (Recall that the check vector for GTIN-13s is $\mathbf{c}=\left[1,3,1,3,1,3,1,3,1,3,1,3,1\right]$ and that operations are performed in ${ℤ}_{10}$.)

Correct!
The dot product of $\mathbf{u}$ and $\mathbf{c}$ equals
$\left(4×1\right)+\left(2×3\right)+\left(3×1\right)+\left(4×3\right)+\left(1×1\right)+\left(8×3\right)+\left(6×1\right)+\left(2×3\right)$

$+\left(2×1\right)+\left(6×3\right)+\left(7×1\right)+\left(5×3\right)+\left(d×1\right)$

$=4+6+3+12+1+24+6+6+2+18+7+15+d$

$=4+d.$

Thus $d=6$.

Incorrect. Please try again.
The dot product of the check vector and the GTIN-13 vector must equal 0 in ${ℤ}_{10}$. Calculate the dot product - it will contain a term in $d$. Select the correct value of $d$ to make the dot product a multiple of 10 (that is, equal to 0 in ${ℤ}_{10}$).
(Harder) Two adjacent entries in a correct ISBN have been transposed in error, resulting in an incorrect ISBN of

$\left[0,4,9,5,0,4,1,4,2,7\right].$
Find the incorrect positions (where positions are numbered from right to left). (Recall that the check vector for ISBNs is $\mathbf{c}=\left[10,9,8,7,6,5,4,3,2,1\right]$ and that operations are performed in ${ℤ}_{11}$.) Exactly one option must be correct)
 a) 3rd and 4th positions from right. b) 8th and 9th positions from right. c) 4th and 5th positions from right. d) 5th and 6th positions from right. e) None of the above.

Choice (a) is incorrect
Suppose that the transposed elements are $a$ and $b$, where $a,b$ is the correct order. In the correct order, suppose $a$ is in the $\left(n+1\right)$th position from the right and $b$ is in the $n$th position from the right. The incorrect ISBN lists $b,a$ in these positions, respectively. In the calculation of the dot product with $\mathbf{c}$, the correct ISBN results in the inclusion of terms $\left(n+1\right)a+nb=na+nb+a$ whereas the incorrect ISBN results in the inclusion of $\left(n+1\right)b+na=na+nb+b$. All other terms in the dot product remain the same. Therefore the incorrect dot product minus the correct dot product equals $b-a$. Now calculate the dot product of the check vector with the incorrect ISBN. You will be very close to arriving at the answer!
Choice (b) is incorrect
Suppose that the transposed elements are $a$ and $b$, where $a,b$ is the correct order. In the correct order, suppose $a$ is in the $\left(n+1\right)$th position from the right and $b$ is in the $n$th position from the right. The incorrect ISBN lists $b,a$ in these positions, respectively. In the calculation of the dot product with $\mathbf{c}$, the correct ISBN results in the inclusion of terms $\left(n+1\right)a+nb=na+nb+a$ whereas the incorrect ISBN results in the inclusion of $\left(n+1\right)b+na=na+nb+b$. All other terms in the dot product remain the same. Therefore the incorrect dot product minus the correct dot product equals $b-a$. Now calculate the dot product of the check vector with the incorrect ISBN. You will be very close to arriving at the answer!
Choice (c) is correct!
Suppose that the transposed elements are $a$ and $b$, where $a,b$ is the correct order. In the correct order, suppose $a$ is in the $\left(n+1\right)$th position from the right and $b$ is in the $n$th position from the right. The incorrect ISBN lists $b,a$ in these positions, respectively. In the calculation of the dot product with $\mathbf{c}$, the correct ISBN results in terms $\left(n+1\right)a+nb=na+nb+a$ whereas the incorrect ISBN results in terms $\left(n+1\right)b+na=na+nb+b$. All other terms in the dot product remain the same. Calculating the dot product of the check vector with the incorrect ISBN gives an answer of 3. Therefore the incorrect dot product minus the correct dot product equals $b-a=3-0=3$. We search for two adjacent entries differing by 3 (modulo 11) in the incorrect ISBN, finding only one such pair, at the 4th and 5th positions from the right. The correct ISBN is therefore found by swapping these two entries, to give $\left[0,4,9,5,0,1,4,4,2,7\right]$.
Choice (d) is incorrect
Suppose that the transposed elements are $a$ and $b$, where $a,b$ is the correct order. In the correct order, suppose $a$ is in the $\left(n+1\right)$th position from the right and $b$ is in the $n$th position from the right. The incorrect ISBN lists $b,a$ in these positions, respectively. In the calculation of the dot product with $\mathbf{c}$, the correct ISBN results in the inclusion of terms $\left(n+1\right)a+nb=na+nb+a$ whereas the incorrect ISBN results in the inclusion of $\left(n+1\right)b+na=na+nb+b$. All other terms in the dot product remain the same. Therefore the incorrect dot product minus the correct dot product equals $b-a$. Now calculate the dot product of the check vector with the incorrect ISBN. You will be very close to arriving at the answer!
Choice (e) is incorrect
Suppose that the transposed elements are $a$ and $b$, where $a,b$ is the correct order. In the correct order, suppose $a$ is in the $\left(n+1\right)$th position from the right and $b$ is in the $n$th position from the right. The incorrect ISBN lists $b,a$ in these positions, respectively. In the calculation of the dot product with $\mathbf{c}$, the correct ISBN results in the inclusion of terms $\left(n+1\right)a+nb=na+nb+a$ whereas the incorrect ISBN results in the inclusion of $\left(n+1\right)b+na=na+nb+b$. All other terms in the dot product remain the same. Therefore the incorrect dot product minus the correct dot product equals $b-a$. Now calculate the dot product of the check vector with the incorrect ISBN. You will be very close to arriving at the answer!