banner



Brilliant.org Discrete Mathematics Problem 71 Answer

The easiest way to understand modular arithmetic is to think of it as finding the remainder of a number upon division by another number. For example, since both 15 and -9 leave the same remainder 3 when divided by 12, we say that

15 9 ( m o d 12 ) . 15 \equiv -9\pmod{12}.

This allows us to have a simple way of doing modular arithmetic: first perform the usual arithmetic, and then find the remainder. For example, to find 123 + 321 ( m o d 11 ) 123 + 321 \pmod{11} , we can take

123 + 321 = 444 123 + 321 = 444

and divide it by 11, which gives us

123 + 321 4 ( m o d 11 ) . 123 + 321 \equiv 4\pmod{11}.

However, this could get messy when the numbers get larger. One approach that we could take is to first find the remainders of 123 and 321 when divided by 11 (the remainders are both 2), perform the usual arithmetic, and find the remainder again. In this example, since 123 2 ( m o d 11 ) 123 \equiv 2\pmod{11} and 321 2 ( m o d 11 ) 321 \equiv 2\pmod{11} , we can conclude that

123 + 321 2 + 2 ( m o d 11 ) 4 ( m o d 11 ) . \begin{aligned} 123 + 321 & \equiv 2+2 & \pmod{11} \\ & \equiv 4 & \pmod{11}. \end{aligned}

For a positive integer n n , the integers a a and b b are congruent m o d n \bmod\ n if their remainders when divided by n n are the same.

52 24 ( m o d 7 ) 52 \equiv 24\pmod 7

As we can see above, 52 and 24 are congruent (mod 7) because 52 ( m o d 7 ) = 3 52\pmod 7 = 3 and 24 ( m o d 7 ) = 3. 24\pmod 7 = 3.

Note that = = is different from . \equiv.

Another way of defining this is that integers a a and b b are congruent m o d n \bmod\ n if their difference ( a b ) (a - b) is an integer multiple of n n , that is, if a b n \frac{a-b}{n} has a remainder of 0.

36 10 ( m o d 13 ) 36 \equiv 10\pmod{13}

36 and 10 are said to be congruent (mod 13) because their difference 36 10 = 26 36 - 10 = 26 is an integer multiple of n = 13 n=13 , that is, 26 = 2 × 13. 26 = 2\times 13.

Properties of addition in modular arithmetic:

  1. If a + b = c a+b = c , then a ( m o d N ) + b ( m o d N ) c ( m o d N ) . a\pmod N+b\pmod N \equiv c \pmod N.
  2. If a b ( m o d N ) a\equiv b\pmod N , then a + k b + k ( m o d N ) a+k \equiv b+k \pmod N for any integer k . k.
  3. If a b ( m o d N ) a\equiv b\pmod N and c d ( m o d N ) c\equiv d\pmod N , then a + c b + d ( m o d N ) . a+c \equiv b+d \pmod N.
  4. If a b ( m o d N ) a \equiv b\pmod N , then a b ( m o d N ) . -a \equiv -b\pmod N.

It is currently 7:00 PM. What time (in AM or PM) will it be in 1000 hours?


Time "repeats" every 24 hours, so we work modulo 24. Since

1000 16 + ( 24 × 41 ) 16 ( m o d 24 ) , 1000 \equiv 16 + (24\times 41) \equiv 16 \pmod{24},

the time in 1000 hours is equivalent to the time in 16 hours. Therefore, it will be 11:00 AM in 1000 hours. _\square

Find the sum of 31 and 148 in modulo 24.


Solution 1:
31 in modulo 24 is equivalent to 7. If we use the first modular addition rule stated in this wiki, we find that 31 + 148 7 + 148 155 ( m o d 24 ) 31 + 148 \equiv 7 + 148 \equiv 155\pmod{24} . 155 in modulo 24 is 11. _ \square

Solution 2:
As stated previously, 31 in modulo 24 is 7. Instead of using the first rule, we'll use the second rule. 148 is 4 in modulo 24. So now, all we need to find is 7+4, which is 11 11 . _ \square

Find the remainder when 123 + 234 + 32 + 56 + 22 + 12 + 78 123 + 234+ 32+ 56+ 22 + 12 + 78 is divided by 3. 3.


We know that 123 0 ( m o d 3 ) 123 \equiv 0 \pmod{3} , 234 0 ( m o d 3 ) 234 \equiv 0 \pmod{3} , 32 2 ( m o d 3 ) 32 \equiv 2 \pmod{3} , 56 2 ( m o d 3 ) 56 \equiv 2 \pmod{3} , 22 1 ( m o d 3 ) 22 \equiv 1 \pmod{3} , 12 0 ( m o d 3 ) 12 \equiv 0 \pmod{3} , and 78 0 ( m o d 3 ) 78 \equiv 0 \pmod{3} . From property 3, we have

123 + 234 + 32 + 56 + 22 + 12 + 78 0 + 0 + 2 + 2 + 1 + 0 + 0 5 ( m o d 3 ) . 123 + 234+ 32+ 56+ 22 + 12 + 78 \equiv 0+0+2+2+1+0+0 \equiv 5 \pmod{3}.

Since 5 5 has a remainder of 2 2 when divided by 3 3 , so does 123 + 234 + 32 + 56 + 22 + 12 + 78 , 123 + 234+ 32+ 56+ 22 + 12 + 78, and thus the answer is 2 2 . _\square

Modular multiplication appears in many fields of mathematics and has many far-ranging applications, including cryptography, computer science, and computer algebra.

Properties of multiplication in modular arithmetic:

  1. If a b = c a \cdot b = c , then a ( m o d N ) b ( m o d N ) c ( m o d N ) a\pmod N\cdot b\pmod N \equiv c \pmod{N} .
  2. If a b ( m o d N ) a \equiv b \pmod{N} , then k a k b ( m o d N ) ka \equiv kb \pmod{N} for any integer k k .
  3. If a b ( m o d N ) a \equiv b \pmod{N} and c d ( m o d N ) c \equiv d \pmod{N} , then a c b d ( m o d N ) ac \equiv bd \pmod{N} .

What is ( 8 × 16 ) ( m o d 7 ) ? (8 \times 16) \pmod{7}?


Since 8 1 ( m o d 7 ) 8 \equiv 1 \pmod{7} and 16 2 ( m o d 7 ) 16 \equiv 2 \pmod{7} , we have

( 8 × 16 ) ( 1 × 2 ) 2 ( m o d 7 ) . (8 \times 16) \equiv (1 \times 2) \equiv 2 \pmod{7} .\ _\square

Find the remainder when 124 134 23 49 235 13 124 \cdot 134 \cdot 23 \cdot 49 \cdot 235 \cdot 13 is divided by 3 3 .


We did a similar problem above, where the signs were all + + instead of × \times . In that case, manually adding the numbers up wouldn't take that much time, though the modular arithmetic solution was faster.

In this example, multiplying the numbers would be very tedious. Instead, we use property 3 repeatedly. We know that 124 1 124 \equiv 1 , 134 2 134 \equiv 2 , 23 2 23 \equiv 2 , 49 1 49 \equiv 1 , 235 1 235 \equiv 1 , and 13 1 13 \equiv 1 . Therefore,

124 134 23 49 235 13 1 2 2 1 1 1 4 1 ( m o d 3 ) , 124 \cdot 134 \cdot 23 \cdot 49 \cdot 235 \cdot 13 \equiv 1 \cdot 2 \cdot 2 \cdot 1 \cdot 1 \cdot 1 \equiv 4 \equiv 1 \pmod{3},

implying the product, upon division by 3 , 3, leaves a remainder of 1. 1. _\square

Prove property 3 of multiplication in modular arithmetic as stated below:

If a b ( m o d N ) a \equiv b \pmod{N} and c d ( m o d N ) c \equiv d \pmod{N} , then a c b d ( m o d N ) ac \equiv bd \pmod{N} .


By the definition of equivalence, a b a -b is a multiple of N N and c d c-d is a multiple of N . N. That is,

a b = k 1 N , c d = k 2 N a-b = k_1N, \quad c-d = k_2N

for constants k 1 k_1 and k 2 k_2 . Then

a c b d = a c b d + b c b c = c ( a b ) + b ( c d ) = c ( k 1 N ) + b ( k 2 N ) = ( c k 1 + b k 2 ) N . \begin{aligned} ac - bd &= ac - bd + bc - bc\\ & = c(a-b) + b(c-d)\\ & = c (k_1 N ) + b (k_2N)\\ & = (ck_1 + bk_2) N. \end{aligned}

This implies a c b d ac - bd is a multiple of N N and therefore a c b d 0 ( m o d N ) ac - bd \equiv 0 \pmod{N} , or a c b d ( m o d N ) ac \equiv bd \pmod{N} . _\square

What is the last digit when

1234 × 5678 1234 \times 5678

is multiplied out?

Since exponentiation is repeated multiplication, we have the following:

Property of Exponentiation in Modular Arithmetic:

If a b ( m o d N ) a\equiv b\pmod{N} , then a k b k ( m o d N ) a^k \equiv b^k \pmod{N} for any positive integer k k .

We can write a a in the form of a = N p + b a = Np + b , where p p is some integer. Then we have

a k = ( N p + b ) k = i = 0 k ( k i ) ( N p ) k i b i . a^{k} = (Np + b)^{k} = \sum_{i = 0}^{k}\binom{k}{i}(Np)^{k-i}b^{i}.

Now notice how all the terms of this sum are multiples of N N , except the last when i = k i = k . Hence

a k 0 + 0 + + 0 + b k = b k ( m o d N ) . a^{k} \equiv 0 + 0 + \cdots + 0 + b^{k} = b^{k} \pmod{N}.\ _\square

What is 3 16 ( m o d 4 ) ? 3^{16} \pmod{4}?


We observe that

3 2 9 1 ( m o d 4 ) . 3^2 \equiv 9 \equiv 1 \pmod{4}.

Then by the property of exponentiation, we have

3 16 ( m o d 4 ) ( 3 2 ) 8 ( m o d 4 ) ( 1 ) 8 ( m o d 4 ) 1 ( m o d 4 ) . \begin{aligned} 3^{16} \pmod{4} &\equiv \big(3^2\big)^8 \pmod{4} \\ &\equiv (1)^8 \pmod{4} \\ &\equiv 1 \pmod{4}. \ _\square \end{aligned}

In the above example, we do not need to find the exact value of 3 16 3 ^ {16} , which is very large

What is the last digit of 1 7 17 ? 17^{17}?


The last digit of a number is equivalent to the number taken modulo 10. Working modulo 10, we have

1 7 17 7 17 ( 7 2 ) 8 7 ( m o d 10 ) ( 49 ) 8 7 9 8 7 ( m o d 10 ) ( 9 2 ) 4 7 ( 81 ) 4 7 ( m o d 10 ) 1 4 7 7 ( m o d 10 ) . \begin{array} { l l l l } 17^{17} & \equiv 7^{17} & \equiv \big(7^2\big)^8 \cdot 7 & \pmod{10}\\ & \equiv (49)^8 \cdot 7 & \equiv 9^8 \cdot 7 & \pmod{10} \\ & \equiv \big(9^2\big)^4 \cdot 7 & \equiv (81)^4 \cdot 7 & \pmod{10} \\ & \equiv 1^4 \cdot 7 & \equiv 7 & \pmod{10}. \ _\square \end{array}

Find the last three digits of 2 40 . 2^{40}.


We have

2 40 = ( 2 10 ) 4 = 102 4 4 2 4 4 57 6 2 ( m o d 1000 ) . \begin{aligned}2^{40} &=& \big(2^{10}\big)^4 \\ &=& 1024^4 \\ &\equiv& 24^4 \\ &\equiv& 576^2 \pmod{1000}.\end{aligned}

We can write 57 6 2 576^2 as

( 500 + 76 ) ( 500 + 76 ) = 250000 + 2 × 500 × 76 + 76 × 76 = 250000 + 76000 + 5776 0 + 5776 776 ( m o d 1000 ) . \begin{aligned}(500+76)(500+76) &=& 250000+2\times500\times 76+76\times76 \\ &=& 250000 + 76000 + 5776 \\ &\equiv& 0 + 5776 \\ &\equiv& 776 \pmod{1000}.\end{aligned}

Since 2 40 2^{40} leaves a remainder of 776 776 when divided by 1000 1000 , its last three digits are 776 776 . _\square

What is the remainder when 2 123456789 2^{123456789} is divided by 7?

Find an example of integers a , x , y , n , a, x, y, n, where x y ( m o d n ) x \equiv y \pmod{n} , but a x ≢ a y ( m o d n ) a^x \not \equiv a^y \pmod{n} .


Many combinations of a , x , y , n a, x, y, n will work here. We present the case with n = 3 , a = 2 , x = 2 n = 3, a =2, x = 2 and y = 5 y = 5 , where we get 2 5 ( m o d 3 ) 2 \equiv 5 \pmod{3} , but 2 2 1 ( m o d 3 ) 2^2 \equiv 1 \pmod {3} while 2 5 2 ( m o d 3 ) 2^5 \equiv 2\pmod{3} . _\square

The important takeaway is that the exponentiation property only works on the base. If you want to work with the powers, you will need Euler's theorem.

This is tricky. Consider 4 8 ( m o d 4 ) 4 \equiv 8 \pmod{4} . Note that we cannot simply divide both sides of the equation by 2, since 2 ≢ 4 ( m o d 4 ) 2 \not \equiv 4 \pmod{4} . This shows that, in general, division is not well defined. As the following property shows, if we add the condition that k , N k, N are coprime, then division becomes well defined.

Property of division in modular arithmetic:

If gcd ( k , N ) = 1 \gcd(k,N)=1 and k a k b ( m o d N ) ka \equiv kb \pmod{N} , then a b ( m o d N ) a \equiv b \pmod{N} .

This property is true because if k ( a b ) k(a-b) is a multiple of N N and gcd ( k , N ) = 1 \gcd(k,N)=1 , then N N must divide a b a-b , or equivalently, a b ( m o d N ) a \equiv b \pmod{N} .

The modular inverse of a a in the ring of integers modulo m m is an integer x x such that

a x 1 ( m o d m ) . ax \equiv 1 \pmod{m}.

From the Euclidean division algorithm and Bézout's identity, we have the following result about the existence of multiplicative inverses in modular arithmetic:

If a a and N N are integers such that gcd ( a , N ) = 1 \gcd (a, N)=1 , then there exists an integer x x such that a x 1 ( m o d N ) ax \equiv 1 \pmod{N} .

x x is called the multiplicative inverse of a a modulo N . N.

The following Python code shows how we can calculate the modulo inverse by implementing the extended Euclidean algorithm:

Python Implementation

                        1  2  3  4  5  6  7  8  9 10 11 12 13 14
                                                                          def                          egcd                          (                          a                          ,                          b                          ):                          x                          ,                          y                          ,                          u                          ,                          v                          =                          0                          ,                          1                          ,                          1                          ,                          0                          while                          a                          !=                          0                          :                          q                          ,                          r                          =                          b                          //                          a                          ,                          b                          %                          a                          m                          ,                          n                          =                          x                          -                          u                          *                          q                          ,                          y                          -                          v                          *                          q                          b                          ,                          a                          ,                          x                          ,                          y                          ,                          u                          ,                          v                          =                          a                          ,                          r                          ,                          u                          ,                          v                          ,                          m                          ,                          n                          gcd                          =                          b                          return                          gcd                          ,                          x                          ,                          y                          def                          modinv                          (                          a                          ,                          m                          ):                          gcd                          ,                          x                          ,                          y                          =                          egcd                          (                          a                          ,                          m                          )                          if                          gcd                          !=                          1                          :                          return                          None                          # modular inverse does not exist                          else                          :                          return                          x                          %                          m                                              

One of the seven goblets above is made of real gold. If you start counting at A and wind back and forth while counting (A, B, C, D, E, F, G, F, E, D, ...), then the golden goblet would be the 100 0 th 1000^\text{th} one that you count.

Which one is the golden goblet?

Aditya is excited for his birthday party on Saturday, March 2, 2013. He is turning 16 years old. What day of the week was Aditya born?

Details and Assumptions:

  • The recent leap years are 2012, 2008, 2004, 2000, 1996, .... If your answer is Monday, type 1. If your answer is Tuesday, type 2, and so on and so forth. If your answer is Sunday, type 7.

Tuesday Wednesday Friday Saturday

Ashley went to the movies nine days ago. If Thursdays are the only day of the week that Ashley goes to the movies, then what day of the week is today?

6 6 6 6 6 6 6 \LARGE 6^{6^{6^{6^{6^{6^6}}}}}

What is the remainder when the above number is divided by 7?


Clarification: There are a total of seven 6's.

What is the remainder when

1 ! + 2 ! + 3 ! + + 50 ! 1! + 2!+3!+ \cdots +50!

is divided by 5 ! ? 5!\, ?

a x a 2 ( m o d ( a 1 ) ) {a^x \equiv a-2 \pmod{{\small(a-1)}}}

If a a and x x are positive integers greater than 2, what is the value of a ? a?

1111111 1 number of 1's = 124 ( m o d 271 ) = ? \underbrace{1111111\ldots 1}_{\text{number of 1's = 124}} \pmod {271} = \, ?

  • Chinese Remainder Theorem

  • Finding the Last Digit of a Power

Brilliant.org Discrete Mathematics Problem 71 Answer

Source: https://brilliant.org/wiki/modular-arithmetic/

Posted by: nelsenheratat.blogspot.com

0 Response to "Brilliant.org Discrete Mathematics Problem 71 Answer"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel