Back to Basics

by t0rajir0u, Jan 17, 2007, 1:17 AM

Modular division is a topic that people don't seem to know much about, so I figured it'd be worthwhile to cover it.

Definition: We say (for integers $a, b, c, m$ such that $gcd(b, m) = 1$) that $\frac{a}{b}\equiv c \bmod m$ iff $a \equiv bc \bmod m$

Definition: Given a number $a$, we say that $b$ is the multiplicative inverse of $a \bmod m$ iff $b \equiv \frac{1}{a}\bmod m$.

Notice that this is the same as the definition of multiplicative inverse in the real numbers, except we use equality rather than modular equivalence. Indeed, properties of multiplication and division from the real numbers are entirely preserved, which makes this a useful tool.

Problem: Calculate the last two digits of $1337^{9999}$.

I twisted around a problem I've seen several times asking for the last two digits of $7^{9999}$. That problem is trivial if you remember that $7^{4}= 2401$, but this one is less so.

Well, we're working $\bmod 100$. That means we only have to consider $37^{9999}$. By Totient Theorem,

$37^{40}\equiv 1 \bmod 100$

But this can only get us as far as

$1337^{9999}\equiv 37^{39}\bmod 100$

... Or can it? Well, let's go one $40$ further:

$1337^{9999}\equiv 37^{-1}\bmod 100$

Then all we have to do is figure out what the multiplicative inverse of $37 \bmod 100$ is. Well,

$999 = 27 \cdot 37 \equiv-1 \bmod 100$

So of course

$(100-27) \cdot 37 = (73) \cdot 37 \equiv 1 \bmod 100$

And therefore

$1337^{9999}\equiv \boxed{ 73 }\bmod 100$

See how nice that was?



If you're wondering how to calculate multiplicative inverses generally, it actually turns out to be equivalent to solving the linear Diophantine

$ax+my = 1$

Which, of course, is only possible if $gcd(a, m) = 1$ (this is the condition for the existence of multiplicative inverses.) Given the set of all such $a < m$, the product of any two of these numbers is another one $\bmod m$, so we say that they form a multiplicative group (closed under multiplication, and inverses exist). This group, of course, has $\varphi(m)$ members, and it is the study of this group that is used to prove the Totient Theorem (which can be generalized to any finite group).

But I digress. Solving this linear Diophantine generally makes use of the Extended Euclidean Algorithm (which is really just an application of the division algorithm), which I may or may not get to later.




Similarly, one can define modular roots.

Definition: Given an integer $a$, we say that $b$ is the $k^{th}$ root of $a \bmod m$ if

$b^{m}\equiv a \bmod m$

For example, $\sqrt{ 2 }\equiv 3, 4 \bmod 7$ because $3^{2}\equiv (-3)^{2}\equiv 2 \bmod 7$.

Just as there are $k$ different $k^{th}$ roots in the complex numbers, there are (well, in prime moduli) $k$ different modular $k^{th}$ roots (in fact, those two sets of numbers have some startling similarities!). For example,

$\sqrt[4]{ 3 }\equiv 2, 3, 10, 11 \bmod 13$

This is useful for solving polynomials $\bmod m$, but I will leave the details to you!


Practice Problem 1: Given an odd prime $p$ and integers $a, b, c$ such that $a \not \equiv 0 \bmod p$, find integers $x$ such that $ax^{2}+bx+c \equiv 0 \bmod p$.

Practice Problem 2: Factor the polynomial $x^{p-1}-1 \bmod p$. Use this factoring to prove that $(p-1)! \equiv-1 \bmod p$. What is $(p-2)! \bmod p$?

Comment

8 Comments

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Is your first definition correct? It seems to say that $\frac{0}{2}\equiv 3 \pmod{6}$.

by Ravi B, Jan 17, 2007, 1:52 AM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
$x^{p-1}-1 \equiv (x-1)(x-2) \cdots (x-p+1) \pmod{p}$ by FLT. Plug in zero to get $-1 \equiv (p-1)! \pmod{p}$. And $(p-2)! \equiv \frac{-1}{p-1}\equiv \frac{-1}{-1}\equiv 1 \pmod{p}$.

To resolve Ravi B's comment, maybe you should have $(b, m) = 1$ so the multiplicative inverse exists (and is unique).

by paladin8, Jan 17, 2007, 3:06 AM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Ravi B wrote:
Is your first definition correct? It seems to say that $\frac{0}{2}\equiv 3 \pmod{6}$.

Sorry; I should've mentioned that if the quotient isn't unique, then it doesn't exist.

by t0rajir0u, Jan 17, 2007, 11:40 PM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
So we say that $\frac{0}{2}\pmod 6$ is undefined?

by mysmartmouth, Jan 23, 2007, 11:58 AM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Quote:
Just as there are k different k^{th} roots in the complex numbers, there are (well, in prime moduli) k different modular k^{th} roots (in fact, those two sets of numbers have some startling similarities!). For example,

are you sure...??? Can you somehow show the proof? Because sometimes there are no solutions at all... For example, the square root of p-1 when p = 4k+3 is not defined, since there are no solutions.

And from my memory I think that the number of solutions to $x^{k}-a = 0$ is equivalent to the degree of the polynomial that's the gcd of $x^{k}-a$ and $x^{p}-x$.

Oh, for above, 0/2 is undefined because 1/2 has no meaning: it suppose to be the multiplicative inverse of 2, yet 2 has no multiplicative inverses in mod 6.

by pkerichang, Jan 25, 2007, 5:10 AM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
i was trying to solve $x^{2}-x-1\equiv 0 \bmod 7$ and got to $2x+\sqrt{5}\equiv-1\bmod 7$ but i could not find a number $x$ such that $\sqrt{5}\equiv x\bmod 7$ am i doing somehting wrong?

by maokid7, Feb 3, 2007, 8:30 PM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
maokid7 wrote:
i was trying to solve $x^{2}-x-1\equiv 0 \bmod 7$ and got to $2x+\sqrt{5}\equiv-1\bmod 7$ but i could not find a number $x$ such that $\sqrt{5}\equiv x\bmod 7$ am i doing somehting wrong?

It merely means that there is no solution in $\mathbb{Z}_{7}$, which is not so hard to verify. :)

by t0rajir0u, Feb 11, 2007, 12:10 AM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Your first problem can also be used to solve one of the problems on the first AIME.
$6^{83}+8^{83}$ mod 49

by bpms, Feb 11, 2007, 5:41 AM

Various mathematical thoughts, ranging from problem-solving techniques to attempts to tie together related concepts.

avatar

t0rajir0u
Archives
+ March 2009
+ October 2007
+ May 2007
Shouts
Submit
  • orz $~~~~$

    by clarkculus, Jan 10, 2025, 4:13 PM

  • Insanely auraful

    by centslordm, Jan 1, 2025, 11:17 PM

  • Fly High :(

    by Siddharthmaybe, Oct 22, 2024, 8:34 PM

  • Dang it he is gone :(( /revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive/revive.

    by 799786, Aug 4, 2022, 1:56 PM

  • annoying precision

    by centslordm, May 16, 2021, 7:34 PM

  • rip t0rajir0u

    by OlympusHero, Dec 5, 2020, 9:29 PM

  • Shoutbox bump xD

    by DuoDuoling0, Oct 4, 2020, 2:25 AM

  • dang hes gone :(

    by OlympusHero, Jul 28, 2020, 3:52 AM

  • First shout in July

    by smartguy888, Jul 20, 2020, 3:08 PM

  • https://artofproblemsolving.com/community/c2448

    has more.

    -πφ

    by piphi, Jun 12, 2020, 8:20 PM

  • wait hold up 310,000
    people visited this man?!?!??

    by srisainandan6, May 29, 2020, 5:16 PM

  • first shout in 2020

    by OlympusHero, Apr 4, 2020, 1:15 AM

  • in his latest post he says he moved to wordpress

    by MelonGirl, Nov 16, 2019, 2:43 AM

  • Please revive!

    by AopsUser101, Oct 30, 2019, 7:10 PM

  • first shout in october fj9odiais

    by bulbasaur., Oct 14, 2019, 1:14 AM

128 shouts
Tags
About Owner
  • Posts: 12167
  • Joined: Nov 20, 2005
Blog Stats
  • Blog created: Dec 5, 2006
  • Total entries: 48
  • Total visits: 321831
  • Total comments: 202
Search Blog
a