Skip to content

Instantly share code, notes, and snippets.

@kenn
Last active December 25, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenn/7061067 to your computer and use it in GitHub Desktop.
Save kenn/7061067 to your computer and use it in GitHub Desktop.
Validating MinHash's errors
require 'digest'
a = (0..100000).map{|i| Digest::SHA1.hexdigest(i.to_s).hex }
a.map.with_index{|i,idx| i > a[idx-1] }.group_by{|i| i }.map{|k,v| [k,v.size] }
# => [[true, 499235], [false, 500766]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment