# How do i deal with fractions when using Modulo?

• Feb 11th 2011, 12:29 PM
sirellwood
How do i deal with fractions when using Modulo?
For example if i am using Z7, then first and foremost are the following correct?

-25 = 3

23 = 2

(just want to check im using modulo ok)

Then if i need to simplify 1/2 and 37/2 in Z7, then do i proceed the same? Im just wondering if the numbers have to be integers to use modulo?

At the minute i am thinkin that:

1/2 = 1/2 and
37/2 = 9/2

are these correct?

Thanks :-)
• Feb 11th 2011, 12:59 PM
emakarov
Quote:

For example if i am using Z7, then first and foremost are the following correct?

-25 = 3

23 = 2
That's correct.

Quote:

Then if i need to simplify 1/2 and 37/2 in Z7, then do i proceed the same? Im just wondering if the numbers have to be integers to use modulo?
By definition, $\displaystyle 1/2 = 1\cdot 2^{-1}$, so the problem is to find the reciprocal of 2 in $\displaystyle \mathbb{Z}_7$. It is easy to see that $\displaystyle 2^{-1}=4$ because $\displaystyle 2\cdot4\equiv1\pmod{7}$. In general, reciprocals can be found using Bézout's identity.
• Feb 11th 2011, 01:06 PM
sirellwood
Ah i see, so in this case would i find that:

1/2 = 4

and

37/2 = 1

?
• Feb 11th 2011, 01:25 PM
emakarov
Yes.