$45/7 \quad$ remainder $=3$

What is the correct way of representing this mathematically? I am asking this question because in this site, many times, experts use different ways to denote remainders. I am giving it below

(a) $45$ mod $7$ $=3$

(b) $45$ mod $7$ $\equiv3$

(c) $45\%7$ $=3$ (I believe this is mostly for programming and cannot generally use for mathematics. there is a thread for it)

(d) $45\equiv 3\pmod 7$

It is true that we can easily understand from the last expression that $45$ divided by $7$ gives $3$ as remainder. But, this relation is actually used to tell $45$ and $3$ gives same remainder when divided with $7$.

So, my understanding is that we can only (a). Please tell if I am right or wrong.

  • 4
    $\begingroup$ you can only use (d) $\endgroup$ – Will Jagy Aug 18 '16 at 18:35
  • $\begingroup$ I have also seen $45 \equiv_7 3$ $\endgroup$ – naslundx Aug 18 '16 at 18:36
  • 1
    $\begingroup$ What is your definition of the remainder? $\endgroup$ – quid Aug 18 '16 at 18:40
  • $\begingroup$ @WillJagy, I have a doubt in that. I was new to that notation and after learning more about it, I guess it means "45 and 3 gives same remainder when divided with 7". But, then how it can be used for remainder? $\endgroup$ – Kiran Aug 18 '16 at 18:41
  • 3
    $\begingroup$ That's not a definition. What is the remainder of $-45$ divided by $7$? What is the remainder of $45$ divided by $-7$? Why? $\endgroup$ – quid Aug 18 '16 at 18:43

To capture the nature of division of a number $a$ by another number $b$ (which seems to be what you're trying to convey in $a$, we can write $$a = qb + r$$ where q represents the unique quotient, and $r$ ($0\leq r\lt b$) represents the unique remainder.

We can also write $$a \equiv r \pmod b$$

The notation of the second form does not necessarily require that the '$r$' be such that $0\leq r \leq b$.

  • $\begingroup$ thanks. Can you also tell whether (a),(b),(c) are not mathematically correct statements as given my question? $\endgroup$ – Kiran Aug 18 '16 at 18:50
  • $\begingroup$ also, a doubt in this. we can also write as $a=(q-1)b+b+r$ So, we can also write $a \equiv b+r \pmod b$ right? (i.e., what I meant is we can add or subtract multiples of r ) $\endgroup$ – Kiran Aug 18 '16 at 18:53
  • 1
    $\begingroup$ The first form requires that $a$ be equal to the quotient multiplied by the dividend in a manner such that the remaining constant $r_2 = b+r$ falls in the range of $0\leq r_2\lt b$. The second form you are absolutely correct. $\endgroup$ – Namaste Aug 18 '16 at 19:00
  • 2
    $\begingroup$ This might be helpful, a theorem clarifying Euclidean division $\endgroup$ – Namaste Aug 18 '16 at 19:07
  • 1
    $\begingroup$ You're welcome, Kiran. $\endgroup$ – Namaste Aug 18 '16 at 19:11

The first thing to decide is what does the remainder actually mean.

In my experience, in mathematics, yet not in programming, the most common definition, as also given in amWhy's answer, is this (or something equivalent to it):

For integers $a,b$ where $b$ is non-zero, there exits unique integers $q,r$ with $0 \le r < |b|$ such that $a= bq +r$. We call this $r$ the remainder of the euclidean division of $a$ by $b$.

An source of ambiguity is to decide on the range, specifically on the sign, of the remainder (in case $a$ or $b$ are negative).

It is possible to denote the remainder concisely using standard notation like this: $$r = a - b \left \lfloor \frac{a}{b} \right\rfloor$$ Yet, this is not really a convenient notation for the remainder.

Now, back to your actual question.

(d) is notation where most every mathematician will agree on what it means and that makes clear that $3$ is the remainder. It is easy to see that $0 \le r < |b|$. And, the remainder is characterize by being the $r$ with $0 \le r < |b|$ such that $$a \equiv r \pmod{b}$$

It is true though that it is not really a notation for the remainder, as $45 \equiv 17 \pmod{7}$ is also true. One can only derive it by noting that $0 \le 3 < 7$ holds. Now, this is easy enough here, but in a slightly different contexts it might not be immediate to decide which of two numbers is larger.

In (d) the mod is used to indicate the modulus of the relation $\equiv$

For the others: (b) looks wrong to me. It's a mix of two usages of mod.

(a) is alright if you explain what is meant. It is perhaps not be very common in mathematics but I do not see a problem with it being used. Note that mod there is used in a different way, it is an operator there. But especially if you use it with negative variable makes sure to explain what it means exactly. (Also note programming languages have at least three different conventions.)

(c) regarding the substance it is just like (a), with the same caveat, yet it might stick out more in a mathematical text and is less expressive.

If you write a piece of mathematics where it is used a lot and appears inside other formulas, you might introduce some dedicated notation. I think $[a]_b$ or also $\{a\}_b$ is not uncommon. But always explain what is meant.

  • 2
    $\begingroup$ thanks a lot, really helpful $\endgroup$ – Kiran Aug 18 '16 at 19:20
  • $\begingroup$ Euclid's lemma is the best way $\endgroup$ – Achari S Ganesha Aug 19 '16 at 12:45
  • $\begingroup$ @AchariSGanesha I do not understand what you want to say, sorry. Euclid's lemma to me means the statement that if a prime number divides a product, then it divides one of the factors. I do not see how this is relevant in this context. Or did you mean the highlighted result related to Euclidean division? $\endgroup$ – quid Aug 19 '16 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.