This is an outcome of an industrial problem that's been solved with somebrute force computer work, this posting is just a result of my curiosity.

We had the task of checking an array of integers for duplicates, due to thehardware involved the traditional approaches weren't suitable. One of ourpeople came up with an algo that works for the cases that we encounter inthe field, I'm wondering whether the result holds for all n.

There is an array of n integers between 1 and n, with no repeated members,in any order. Let P be the product of all the entries, and S be the sum.

The postulate is that no other set of n integers, all between 1 and n(obviously containing repeats) will have the same values for both P and S.

Post by Bruce VarleyThis is an outcome of an industrial problem that's been solved with somebrute force computer work, this posting is just a result of my curiosity.We had the task of checking an array of integers for duplicates, due to thehardware involved the traditional approaches weren't suitable. One of ourpeople came up with an algo that works for the cases that we encounter inthe field, I'm wondering whether the result holds for all n.There is an array of n integers between 1 and n, with no repeated members,in any order. Let P be the product of all the entries, and S be the sum.The postulate is that no other set of n integers, all between 1 and n(obviously containing repeats) will have the same values for both P and S.

Post by Bruce VarleyThis is an outcome of an industrial problem that's been solved with somebrute force computer work, this posting is just a result of my curiosity.We had the task of checking an array of integers for duplicates, due to thehardware involved the traditional approaches weren't suitable. One of ourpeople came up with an algo that works for the cases that we encounter inthe field, I'm wondering whether the result holds for all n.There is an array of n integers between 1 and n, with no repeated members,in any order. Let P be the product of all the entries, and S be the sum.The postulate is that no other set of n integers, all between 1 and n(obviously containing repeats) will have the same values for both P and S.

Post by k***@kymhorsell.com[...]What you may be looking for is a "perfect hashing" scheme.While Don Knuth wrote in his book such schemes might be very dificultto find, quite a few are now known.Give it a Google.There is also a UNIX/Linux/GNU tool called "gperf" that creates perfecthash tables for strings (normally used for reserved word or keyword lookup)that might either do what you want or be adapted.--"Denialism"? Is that a word?-- Mickey Langan, Sun 2 Jan 2011 4:50 pm

Thanks, I'll follow that up. This function has to run on a specialisedindustrial platform with minimal capabilities (yes, amazingly they do stillexist), classical algos such as hashing are likely to be OTT. I have acouple of workarounds up my sleeve. Cheers

Post by Bruce VarleyThanks, I'll follow that up. This function has to run on a specialisedindustrial platform with minimal capabilities (yes, amazingly they do stillexist), classical algos such as hashing are likely to be OTT. I have acouple of workarounds up my sleeve. Cheers

Generalisations of Pearson hashing only require XOR and indexinginto a table.

---Why have you posted binaries to a text-only newsgroup, fuck wit?Would you like to see how it appears in a compliant newsreader, whichall of the usenet with IQs beyond single digits use? It appears asabove in the quoted text - NO IMAGES AT ALL! ROTFL[Seems like "fuckwit" has never seen HTML before].-- Gillard Lies <***@gmail.com>, 18 Feb 2011 22:57 -0800 (PST)