Talk:Remainder

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Remainder algorithms for various moduli[edit]

Such as number modulo 3 := sum of the digits (decimal base) Example: 62837 mod 3 = 6+2+8+3+7 mod 3 = 26 mod 3 = 2+6 mod 3 = 8 mod 3 = 2

Another: number modulo 7 := number lest the last digit - 2 * last digit (decimal base) Example: 62837 mod 7 = 6283-14 mod 7 = 6269 mod 7 = 626-18 mod 7 = 608 mod 7 = 60-16 mod 7 = 44 mod 7 = 2

Ïnteresting would be an algorithm for numbers modulo 31; with that you could calculate in your head certain check digits to forge a social security number in situ...

There already is an article about this: Divisibility rule. I will add this to the "see also" section. 93.95.251.162 (talk) 11:46, 15 March 2011 (UTC) Martin.[reply]

Remainder in non-integer division[edit]

As I mentioned in the discussion page for modulo operation, I made an edit to that article today that clarifies that computers do not constrain a and n to be integers. Rather, the evaluation of a mod n in computers is carried out such that quotient q is an integer and remainder r is allowed to be a non-integer.

I am unsure of the ramifications of this on the remainder article. It seems that it is possible to define "remainder" more generally, not just in the context of pure integer division / the division algorithm, so I think this should be perhaps mentioned here. Please do this, if you can, or correct me if I'm wrong. Thanks - mjb 04:44, 30 Jan 2005 (UTC)

You see, the remainder can indeed be defined for any real numbers of course. Even for complex numbers if you wish. However, mathematicians don't do that. Actually, mathematicians don't even bother to define the remainder for negative numbers (I know you had been struggling with that issue).
You see, unlike in computer science, where the remainder is just a function, in math the remainder is a concept, albeit a very important one. It has to do with the arithmetic of natural numbers. That's why mathematicians have no use for the generalizations to the real numbers, or even to the negative integers.
Good job on modulo operation. Oleg Alexandrov | talk 04:54, 30 Jan 2005 (UTC)
Thanks, and thanks for your contributions and assistance throughout this process. I still think we can improve this remainder article, though. I can accept that the concept of remainder in math is only for natural numbers. It does seem, though, that there is a separate, less restrictive concept of remainder in computing. Because of this, and especially since modulo operation currently is defined in terms of the definition given in remainder, I think it may be best to at least acknowledge the existence of the schism. - mjb 07:00, 30 Jan 2005 (UTC)

Remainder (Reply to User:Mjb)[edit]

Thank you for your edits. However, you are not mathematically correct.

The word "remainder" means "leftover", "residue". As such, the remainder of division of 5 by 3 is not 5, is not 8, it is 2, and only 2. As such, your addition of the section "Other definitions" in the remainder article is not mathematically correct.

The concept of remainder is well-defined in Mathematics. The only possible ambiguity is when you talk about negative numbers, there you have a choice in sign. But that is all. Please take a look at Division algorithm and Euclidean algorithm.

I think you confuse remainder with modular arithmetic.

You are right that the remainder can be defined for real numbers, I will add a section for this. But, still the same basic truth holds, the remainder is always smaller in absolute value than the quotient.

Tomorrow I will go back to remainder and correct things. Please do not take it personally. Oleg Alexandrov | talk 16:02, 30 Jan 2005 (UTC)

OK, you don't like the "other definitions" section. My response: I see three contradictions to your assertion that remainder is always smaller in absolute value than the quotient and your implication that it is not possible to define remainder in other ways:
(1) the explanations that User:Revolver gave to me in the discussion on Talk:Modular arithmetic last summer, in which he says that this is true in "basic arithmetic" only if you define it that way;
(2) the "Generalisations" section of Division algorithm which says "There is nothing particular special about the set of remainders {0, 1, ..., |d| − 1}. We could use any set of |d| integers, such that every integer is congruent to one of the integers in the set. This particular set of remainders is very convenient, but it is not the only choice."; and most importantly for me…
(3) E.L. Lady's very clear, informal paper on the Division Algorithm theorem, which states "In fact, after a while one might notice that q can be chosen quite arbitrarily. One could choose q=0 and r=a, or q=1 and r=a−d. This is in fact typical in mathematics: when there are more unknowns than equations, that usually means that there are lots of dierent solutions. When one looks at the example we started with, though, one sees that q=0 and q=1 are not correct values for the quotient when 1052 is divided by 29. The problem is that we have been considering only the equation a=qd+r instead of looking at the whole theorem. The values q=0 and q=1 don't work in the above example because they give the values 1052 and 1023 for r, and these don't satisfy the condition 0≤r<d. […] There's a very important insight to be learned from what we've just done. Namely, in the Division Algorithm, having two unknowns q and r is a smokescreen. The Division Algorithm is actually a statement about only one variable q.
Given the above references, it seems that one can define remainder as one likes. The Division Algorithm theorem does not; it constrains remainder to the well-known set 0≤r<d. You seem to be saying that this is the one and only definition of remainder. It seems to me that while this is the preferred, well-known definition, it is indeed arbitrary, and generalisations can be made without invalidating the theorem. The Division Algorithm states some facts about q, d, a and r ***when*** 0≤r<d. It does not follow from this that "remainder" in general must satisfy those same constraints. This article should make a clear distinction between the general definition and that of the Division Algorithm. - mjb 18:46, 30 Jan 2005 (UTC)
I think you have a point about the remainder thing. There is indeed one widely known definition, which is unambiguous, well-defined, and accepted by all mathematicians. Say, that is the default. But of course that does not need to be the only definition. Ultimately, the remainder can be in any set, even if in that case the word "remainder" loses its actual original meaning. I will think more of this. Oleg Alexandrov | talk 19:53, 30 Jan 2005 (UTC)
OK, I think we are on the same page. Hooray! :) I have made some minor edits to the article today, but I think it still could use further improvement. I think the last two sections should be combined somehow, in order to emphasize that there is the one widely accepted, default definition, and then there are the more general extrapolations, of which the one involving negative numbers is just one of many possible examples. Another example would be the use of non-integers… - mjb 20:08, 30 Jan 2005 (UTC)
I think you should not combine the last two sections. Do you remember how confused you were by these matters at the beginning? Putting the sections separate, shows the logical progression from the first definition, to the last definition. Putting things together might obscure the point and leaving the reader with the opinion that the remainder operation is impossible to define in satisfactory unambiguous manner, which is false. What do you think? Oleg Alexandrov | talk 21:04, 30 Jan 2005 (UTC)
The two sections I am referring to are "the case of general integers" and "other definitions". It is my understanding that you added "the case of general integers" under protest, and do not consider it to be anything more than a pointless theoretical exercise, just like the example in "other definitions". That is why I think it is safe to combine those two sections. - mjb 00:24, 31 Jan 2005 (UTC)
I think we should not include a mention of the division of reals. You see, you and me have different agendas. My agenda is to explain how the word "remainder" is used in math. Your agenda is to explain to yourself and others the rationale behind the mod function in computing.
In math, the definition of remainder for reals does not make sense. The reals can be divided without remainder. As such, there is no place in the math place for this generalization. Of course, people in computer science overload certain operators beyond its original meaning, but mathematicians do not bother with that. I think you should write about remainder of division of reals only on modulo operation, because that's a purely computing issue, and not a mathematical one. This is an opinion, other opinions welcome (you proved me wrong once). Oleg Alexandrov | talk 21:09, 30 Jan 2005 (UTC)

Remainder (continued)[edit]

When you say remainder for reals does not make sense since reals can be divided without remainder, I think you are assuming too much. It is true that reals can be divided without remainder, but this is only if you require that the quotient also be real. The modulo operation in computing (at least according to my observations) finds the remainder, given that q is limited to the set of integers — even though a, n, and r can be real. Thus there is often a remainder, which of course must be real. I do not see this as violating any principles. qn+r=a is still true and, I assume, provable, for the given sets of values allowed for each variable. Yet for some reason it is offensive to you. I don't understand why. The modulo operation merely "solves for r", given real or integer a and n and certain bounds, one of which is q being {…,−1,0,1…}. These equations, taken with their bounds, are statements of fact; one is no more valuable than the other. Mathematicians use one set of bounds, computer scientists another. This may not always be the case in the future. - mjb 00:24, 31 Jan 2005 (UTC)

OK now, my comments were too rough, I am sorry. I know how it feels, as your "wtf" subject line in the morning did not make me feel good either.
I just feel that all that stuff is not mathematical, rather, computational, so I don't know how much it belongs on a math page.
But what you say makes sense. Would you mind putting that in the third section, that is, in "Other definitions"? Oleg Alexandrov | talk 00:48, 31 Jan 2005 (UTC)

Proven or proved[edit]

To say "it can be proved" is correct English. See for example this Britannica article. For some reason, it sounds more natural to my ear than "it can be proven". That's why I will change this in remainder.Oleg Alexandrov 05:07, 10 Mar 2005 (UTC)

OK. I think this is one of those situations where what is correct and what sounds natural are sometimes different things, depending on regional dialects. I asked several people and got several answers. Everyone felt "proved" was right, but they also all hesitated and conceded that they hear "proven" used in that context just as often. - mjb 01:48, 11 Mar 2005 (UTC)
I see. If you feel strongly about it, you can revert to "proven". I am not a native speaker, and ultimately I can't know for sure. Oleg Alexandrov 02:08, 11 Mar 2005 (UTC)

Formula formatting[edit]

Can we discuss this before getting carried away with the edits today? — mjb 22:51, 11 May 2005 (UTC)[reply]

You mean the removal of ×? I don't care either way. But, since Michael Hardy removed one occurance, I thought to remove all of them for consistency. Oleg Alexandrov 23:02, 11 May 2005 (UTC)[reply]
Yeah, I thought you were going to remove every single instance of ×, which wouldn't be appropriate, in my opinion (see below). mjb 23:25, 11 May 2005 (UTC)[reply]

Actually, I probably would have removed them all if I hadn't been in a bit of a hurry. But I'm not going to be adamant about this point. Michael Hardy 02:49, 12 May 2005 (UTC)[reply]

Style guides[edit]

Are there other guides we can refer to?

No-break space[edit]

Regarding &nbsp; or &#160;)… the pros are that it

  • prevents formulas from wrapping, and
  • improves readability.

The cons are that:

  • Wikipedia gets confused sometimes and adds an extra space, such as the one before the d in x < r ≤ x + |d| (there is no space there in the original code); and this seems to have gone away in a recent MediaWiki upgrade
  • there are no clear rules on when and how to use them.

Is the formatting bug something you can live with? Is there a workaround?

I myself don't care. :) I asked Michael Hardy to comment on this. Oleg Alexandrov 23:46, 11 May 2005 (UTC)[reply]

Multiplication sign[edit]

I think it is reasonable to assume that standard algebraic notation is best for formulas, so two variables q and d being multiplied are probably best written as qd when presented in a formula. That is, when citing a formula, don't use &times;.

However, when explaining, for a general audience (not just mathematicians), the formula or giving examples of its application, I feel it is prudent to use the multiplication sign — "×", coded as &times;. So, I think these examples should remain as-is (although I added no-break spaces here):

  • When dividing 26 by 4, 6 is the quotient and 2 is the remainder, because 26 = 6 × 4 + 2.
  • −42 = 9 × (−5) + 3

Do others agree with this convention?

Yes! Oleg Alexandrov 23:46, 11 May 2005 (UTC)[reply]

Less-than sign[edit]

Wikipedia seems to be pretty good at dealing with unescaped "<" characters, but since the MediaWiki markup also uses HTML tags, I think it would be ideal to use &lt; when we want to represent the less-than sign, just like in HTML and XML.

Does anyone know of a style guide that addresses this issue and makes recommendations?

Remainder 'after' or 'of' division[edit]

Grammar question:

  • 2 is the remainder after division of 26 by 4.
  • 2 is the remainder of division of 26 by 4.

Is either one acceptable? Does one sound better than the other? — mjb 08:56, 9 August 2005 (UTC)[reply]

Quotient and remainder in programming languages[edit]

I just added a paragraph to the article. There seem to be no consensus among programming languages implementations regarding the choice for the remainder when negative integers are involved.

Negatives[edit]

In the article today −42 = 9×(−5) + 3

seems to be saying -42 divided by -5 has a quotient of 9 with a remainder 3.

This may be true, based on the article definition, but I'm not sure we should accept that. I think most people would accept that ±42 divided by ±5 would give some kind of 8 as a quotient, not a 9. Additionally, the article definition of remainder does not allow the ambiguity introduced in the section with the word ambiguity. Isn't THAT ambiguous? Something needs to be changed! I vote we find an actual source for the definition of remainder. 75.17.12.230 07:58, 8 September 2007 (UTC)[reply]

colloquial phrases?[edit]

I've seen the phrase "divides into" in print before, as in "a does not divide into b", referring to the fact the remainder of a/b is nonzero. Alternatively, "divides evenly by" is used sometimes to the same effect.

Could there be a place for this information either in this article or in Division (mathematics)#Notation or Multiple (mathematics)? —Preceding unsigned comment added by Kostmo (talkcontribs) 05:12, 15 February 2009 (UTC)[reply]

Other meanings[edit]

There are some other definitions of remainder that should be considered in this article:

  1. the result of a subtraction (historical)
  2. the amount left over after any stage of a long division
  3. the residual after polynomial long division
  4. the expression for the truncation error in Taylor's theorem.

I have been adding article links and references for these subjects. RockMagnetist (talk) 18:58, 29 January 2013 (UTC)[reply]

Residue?[edit]

I've written and edited middle school maths textbooks for students on two continents and taught post-high school maths on a third, and I've yet to encounter residue in a mathematical sense. Where is this used? Thanks. --Unicorn Tapestry {say} 14:48, 18 August 2013 (UTC)[reply]

One use is simply as a synonym for remainder. See Residue for some more mathematical meanings. RockMagnetist (talk) 20:20, 18 August 2013 (UTC)[reply]
Thanks, Rock, but that's kind of a circular definition. Where, other than Wikipedia, is 'residue' used as a synonym for 'remainder'? If we can't document, we shouldn't use it. Thanks. --Unicorn Tapestry {say} 05:27, 25 August 2013 (UTC)[reply]
A google and perusal of the first 20 entries of division and residue turns up mostly references to residue number systems, a question about 'residue', and a description of modulo arithmetic, which discusses remainder and 'residual', not residue. Unless something more definitive arises, I suggest we delete this until more evidence comes along. --Unicorn Tapestry {say} 05:27, 25 August 2013 (UTC)[reply]

Comment moved from article (re: section "For natural numbers")[edit]

above is incorrect,misleading and needs to be edited by an expert. naming the "quotient" quotient or q is incorrect,or at least the link is incorrect, because in this modulo theory the quotient should be an integer and in the link provided it does not necessarily has to be an integer.for example. 7/2=3,5 . Here 7=a , 2=d . So to make modulo work quotient wich is defined in the link is 3,5 and by modulo theory it has to be an integer, number 3 and reminder has to be number 1 — Preceding unsigned comment added by 91.124.154.226 (talkcontribs) 18:19, 25 September 2013

informal introductory definition[edit]

The starting paragraph

"In arithmetic, the remainder (or modulus) is the amount "left over" after performing the division of two integers which do not divide evenly, that is, where the result of the division cannot be expressed as an integer."

does not seem quite right since the remainder could be zero: 8/2 is an integer, 8 divided by 2 has remainder 0.

This early definition contradicts what is later explained in the page:

"If a and d are natural numbers, with d non-zero, it can be proven that there exist unique integers q and r, such that a = qd + r and 0 ≤ r < d. The number q is called the quotient, while r is called the remainder..."

and

"If a and d are integers, with d non-zero, then a remainder is an integer r such that a = qd + r for some integer q, and with |r| < |d|." — Preceding unsigned comment added by Nestor.aguilera (talkcontribs) 21:49, 7 February 2014 (UTC)[reply]

BLACK DAY 11 APRIL[edit]

🥺 2409:4042:269F:45F7:8CC8:F7B7:B350:614E (talk) 09:11, 19 April 2022 (UTC)[reply]