Xref: utzoo comp.theory:373 comp.misc:8289 comp.lang.misc:4222 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!snorkelwacker!spdcc!merk!alliant!linus!bs From: bs@linus.UUCP (Robert D. Silverman) Newsgroups: comp.theory,comp.misc,comp.lang.misc Subject: Re: Modulus (Re: hashing function for strings) Message-ID: <98717@linus.UUCP> Date: 23 Feb 90 12:38:56 GMT References: <12099@goofy.megatest.UUCP> <98399@linus.UUCP> Reply-To: bs@linus.UUCP (Robert D. Silverman) Organization: The MITRE Corporation, Bedford MA Lines: 33 In article flee@shire.cs.psu.edu (Felix Lee) writes: >Bob Silverman wrote: >>The mapping 5 div 3 -- > 1 is a function. It is the floor function >>of the quotient. Why on earth SHOULD one expect that for some function f >>abs(f(a,b)) = abs(f(-a,b))????? >>It would be the same as expecting f(a,b) = -f(-a,b). This simply is not >>true of all functions. > >I find this statement a little strange. Consider: > The mapping 2 plus 3 -> 5 is a function. Why on earth SHOULD one > expect that for some function f, f(a,b) = f(b,a)?? Huh? This statement has absolutely nothing to do with what I said. Oh, for blanks sake. When are you CS weenies going to learn some math? I said for *some* function f. Not for *all* functions f, and this clown then picks out an example of a linear function for which f(a,b) = f(b,a), which has absolutely nothing to do with the issue at hand. It works for this particular function, but won't work for all. Will everyone PLEASE go look up the difference between a ring and a field? The integers are not a field and division is not well defined for every pair of integers. Choosing a,b \in Z --> a/b = floor[a/b] is the best, mathematically consistent way to handle integer division. This means -5/3 = -2. This is absolutely necessary. The integers form a Euclidean domain. We therefore MUST have 3*(-5/3) + (-5 mod 3) = -5. -- Bob Silverman #include Internet: bs@linus.mitre.org; UUCP: {decvax,philabs}!linus!bs Mitre Corporation, Bedford, MA 01730