Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2017 November 15

From Wikipedia, the free encyclopedia
Mathematics desk
< November 14 << Oct | November | Dec >> November 16 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


November 15

[edit]

remainder vs. modulus

[edit]

If I divide -17 by 5, I either get -3 with a remainder of -2, or -4 with a modulus of 3. (I'm reasonably sure that "remainder" and "modulus" are the correct terms here, but if not, please let me know.) So the question is, are there different terms for these two different quotients -3 and -4, or for these two different division operations? —Steve Summit (talk) 02:31, 15 November 2017 (UTC)[reply]

P.S. There's a bunch of information on this topic in our articles Euclidean division and Modulo operation, but I'm not seeing specific answers to my questions there (in part because, perhaps, once you start getting creative there are more than just the two kinds of "division" I described).
No I've never seen a particular term for it. It is not often used and doesn't seem useful. Dmcq (talk) 18:58, 15 November 2017 (UTC)[reply]
Depends how you want to generalise the primary-school idea of a remainder: you could argue that those are always positive, or you could argue that the negatives should proceed to count the other way. But in general I am inclined to agree with Dmcq that this idea isn't really all that useful.
(If you try doing long division in a balanced base, like balanced ternary for example, you do need to use negative remainders for positive dividends and divisors, because to continue the algorithm you need to look for the nearest multiple of the divisor, not the greatest one you can use. But that's another story and is also not much more than a curiosity.) Double sharp (talk) 23:43, 15 November 2017 (UTC)[reply]
Miscellaneous responses:
  • "Modulus" is actually the term for the divisor, that is thing you divide by, not the remainder.
  • Taking the remainder always to be nonnegative is in my opinion much more natural. In particular, it means that the remainder gives you a complete invariant for the equivalence relation of being equal modulo the divisor.
  • However, programming languages often make a different choice. If I understand correctly, for a long time the C++ standard (maybe the C standard too?) allowed either choice. The only thing the standard required was that if q==a/n and r==a%n, then a==q*n+r.
    Notwithstanding this formal freedom, almost every actual implementation was set up to round the quotient towards zero, rather than downwards; that is, (-9)/4==-2 and (-9)%4==-1. I think that's the wrong choice, but that's the one that was made.
    Finally in, not sure, maybe C++14, the standard was finally uniformized, and of course given that there was already a de facto standard, naturally they were forced to choose that one, in spite of its inferiority. See standard is better than better.
But as to what these choices are called, which I guess was your actual question, I'm afraid I just don't know. --Trovatore (talk) 10:52, 16 November 2017 (UTC)[reply]
Thanks for the replies.
Yes, the question was mostly about what to call them. The difference is significant, but having to say "the kind of division where the remainder has the same sign as the dividend" and "the kind of division where the remainder is always positive" is just way too much of a mouthful.
According to our Euclidean division article, the kind where the remainder is always positive is called "Euclidean division". I thought I'd heard the term "FORTRAN division" somewhere, as if maybe that was a way people used to distinguish, but Google isn't backing me up.
I can't remember for sure which way the old-C implementations I used went. I thought Ritchie's compiler for the PDP-11 always gave a positive remainder, but I could be wrong. (I agree it's often much more useful, and I was annoyed that C99 made the choice it did.)
I was certainly wrong in imagining that the possibly-negative remainder was called the "remainder" and the never-negative remainder was called the "modulus": our Euclidean division article explicitly calls the never-negative one "remainder", too. —Steve Summit (talk) 15:47, 17 November 2017 (UTC)[reply]
Well, "modulus" definitely means divisor, not remainder. For the rest of it I don't seem to be much help. I do see some flaws in the articles you pointed to (for example, one of them has a table with some entries that say "always positive" when it almost certainly means "always nonnegative"; zero is not positive in English, though it confusingly is positif in French). I may get around to addressing them, or maybe not. --Trovatore (talk) 20:44, 17 November 2017 (UTC)[reply]

how do i improved my Math solving ability

[edit]

i am ten school student. i am very weak in math. please give me some suggestion how to i improved my math logic? www.dpe.gov.bd primary result — Preceding unsigned comment added by 103.51.2.62 (talk) 08:34, 15 November 2017 (UTC)[reply]

Practice, practice and even more practice. Ruslik_Zero 20:31, 15 November 2017 (UTC)[reply]
Agreed. Find a textbook at your level and do all the exercises. And really work them out - do the write-up, not just the thinking, unless you are already very good. --Stephan Schulz (talk) 11:20, 16 November 2017 (UTC)[reply]
And practice the right things. The best way to test if you have a strong understanding of the material is to try to teach it to someone else. This helps identify what you need to work on.--Jasper Deng (talk) 08:51, 17 November 2017 (UTC)[reply]