4

$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.

Kiran
  • 4,198
  • 4
    you can only use (d) – Will Jagy Aug 18 '16 at 18:35
  • I have also seen $45 \equiv_7 3$ – naslundx Aug 18 '16 at 18:36
  • 1
    What is your definition of the remainder? – quid Aug 18 '16 at 18:40
  • @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? – Kiran Aug 18 '16 at 18:41
  • @quid, I mean, from my example with 3 as remainder, $7\times6+3=45$ – Kiran Aug 18 '16 at 18:42
  • 3
    That's not a definition. What is the remainder of $-45$ divided by $7$? What is the remainder of $45$ divided by $-7$? Why? – quid Aug 18 '16 at 18:43
  • @quid, and this definition itself is confusing. got it from my book and by definition, we can have more remainders. totally confused :( – Kiran Aug 18 '16 at 18:43
  • @quid, exactly. I found conflict with this as you mentioned. But, remainder is stated in my book as this and i feel it is a confusing definition – Kiran Aug 18 '16 at 18:44
  • also, why (a) cannot be used, it was also straight forward – Kiran Aug 18 '16 at 18:47
  • Regarding d) you have the correct idea what that notation means. It is very handy for number theory or abstract algebra. Less handy for computer programmers looking for function where 45 goes in one end and 3 (and only 3) comes out the other. But for most math, expressing the equivalence class in d) is more powerful then just calculating a remainder. – Doug M Aug 18 '16 at 19:07

2 Answers2

5

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$.

amWhy
  • 209,954
1

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.

quid
  • 42,135
  • 2
    thanks a lot, really helpful – Kiran Aug 18 '16 at 19:20
  • Euclid's lemma is the best way – Achari S Ganesha Aug 19 '16 at 12:45
  • @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? – quid Aug 19 '16 at 12:53