Skip to content
Create a gist now

Instantly share code, notes, and snippets.

anonymous /bestof5.rb

max = 100
iterations = 10**6
total = 0
iterations.times {
rolls = []
5.times { rolls.push rand(max) }
total += rolls.max
puts total.to_f/iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.