The Limits of Probability

Submitted By:
david

Difficulty:
Elementary

Tags:
arithmetic, probability, rand

Instructions:
Try to guess the average sum of two random values.

Code:
random_values = (0..1000000).inject(0.0) do |sum, _| 
  sum += rand(14) + rand(14)
end

assert_equal (random_values/1000000.0).round, ___

Your Solution

Ruby 1.9.3

Back to Problems