anonymous / bestof5.rb
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View bestof5.rb
1 2 3 4 5 6 7 8 9 10 11 12
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.