0

STEP 1: Divide Dividend (-9) from Divisor (12).

-9 / 12 = -0.75

Where,

0 is whole part.

75 is fractional part.

STEP 2: Whole part from the result of STEP 1 to be multiplied by Divisor (12).

0 * 12 = 0

STEP 3: Subtract result from STEP 2 from Dividend (-9).

-9-0 = -9

Whereas, The Actual answer is 3. Where am I missing?

Maqsud
  • 113
  • 1
    $-9=-1\times12+3$ – J. W. Tanner Jan 18 '21 at 19:45
  • 1
    Modulo $12$ means up to multiples of $12$. Since $-9+1\cdot 12=3$, the answer can be $3$. But of course $-9=3$ in $\Bbb Z/12$, because $12=0$. – Dietrich Burde Jan 18 '21 at 19:45
  • What about this article? https://divisible.info/Modulo/What-is-1-mod-12.html – Maqsud Jan 18 '21 at 19:47
  • @DietrichBurde Can you provide complete answer with step and article to refer for practising Modulo. – Maqsud Jan 18 '21 at 19:49
  • @DietrichBurde, Whats that Z symbol is? – Maqsud Jan 18 '21 at 19:52
  • $\Bbb Z={\cdots, -4,-3,-2,-1,0,1,2,3,4,\cdots}$ is the ring of integers. – Dietrich Burde Jan 18 '21 at 19:56
  • And $\Bbb Z/12$ is the ring of integers modulo 12. It's common to use the set of residues ${0, 1, 2, \dots, m-1}$ when working in modulus $m$, but it may be convenient to use a different residue set. Eg, for mod $9$ we might use ${-4, -3, -2, -1, 0, 1, 2, 3, 4}$. See https://en.wikipedia.org/wiki/Modular_arithmetic#Residue_systems – PM 2Ring Jan 18 '21 at 20:14

2 Answers2

1

Following your algorithm...

You get $-0.75$ from the division. You are reading that as $0$ for the integer part and $.75$ for the rest. But the next lowest integer under $-0.75$ is $-1$. So if you want to follow this algorithm, you should be using $-1$ for the integer part (and $+0.25$ for the fractional part):

$$-9-(\stackrel{\downarrow}{-1})(12)=-9+12=3$$

2'5 9'2
  • 54,717
1

The integer division of $a$ by $d$ is defined the following way: $$a = qd + r$$ Where $d$ is divisor, $q$ is quotient, and $r$ is the remainder, for which $$0 \le r < |d|$$ Check reference here. This is an important thing to keep in mind while doing modular arithmetic and working with congruences.

For your case: $$ -9 = 12q + r$$ The $q$ which gives the biggest $r$ which falls in the range discussed above is $q = -1$ (which is actually integer floor of the $-0.75$ you got in your algorithm). So if you decide to go your way, you should take the integer floor of the result obtained in STEP 1. $$ -9 = 12*(-1) + 3$$

junumboxo
  • 121