Skip to content

Instantly share code, notes, and snippets.

@mattyoho
Created August 25, 2009 19:11
Show Gist options
  • Save mattyoho/174942 to your computer and use it in GitHub Desktop.
Save mattyoho/174942 to your computer and use it in GitHub Desktop.
trials = []
10000.times{ trials << rand(6) }
trials.uniq.map do |u|
trials.select { |t| t.equal? u }.size
end.collect do |c|
c.to_f / trials.size
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment