Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- counts, n = [], 100000
- n.times do
- count = 0
- 3.times do
- count2, toss = 0, 0
- while toss != 7
- count2 +=1
- toss = rand 20
- end
- count += count2
- end
- counts += [count]
- end
- p counts.min, counts.max, counts.inject(:+)/counts.size.to_f
- your_case = 0
- counts.each { |i| if i > 165 then your_case += 1 end }
- p your_case/(n/100.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement