What do you think of adding odd elements and substract even ones? [1 2] = 1 - 2 = -1 [2 1] = 2 - 1 = 1
On 10/23/2013 02:30 PM, Andy Fingerhut wrote: > If you can think of a different hash function for vectors that doesn't > lead to these types of collisions, I'm all ears. The issue is that > the hash function for sets adds up the hash values of its elements. > Those sums of vector hash values are what are colliding, not the > individual vector hash values themselves. > > Andy > > > On Wed, Oct 23, 2013 at 10:28 AM, Paul Butcher <p...@paulbutcher.com > <mailto:p...@paulbutcher.com>> wrote: > > On 23 Oct 2013, at 18:15, Andy Fingerhut <andy.finger...@gmail.com > <mailto:andy.finger...@gmail.com>> wrote: > >> If we had a 'universal comparator', i.e. a comparison function >> that provided a total order on any pair of values that anyone >> would ever want to put into a set or use as a map key, then >> instead of having linked lists for values that collide, we could >> have trees like those in the implementations of sorted-maps and >> sorted-sets today. > > Wouldn't it be better to improve the way that hashes are > calculated for vectors? A good hash function should make it > unlikely that similar values have the same hash. The current > algorithm seems to make that more likely than it should? > > -- > paul.butcher->msgCount++ > > Snetterton, Castle Combe, Cadwell Park... > Who says I have a one track mind? > > http://www.paulbutcher.com <http://www.paulbutcher.com/>/ > LinkedIn: http://www.linkedin.com/in/paulbutcher > MSN: p...@paulbutcher.com <mailto:p...@paulbutcher.com> > AIM: paulrabutcher > Skype: paulrabutcher > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > <mailto:clojure@googlegroups.com> > Note that posts from new members are moderated - please be patient > with your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > <mailto:clojure%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to clojure+unsubscr...@googlegroups.com > <mailto:clojure%2bunsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient > with your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.