envelopes.rb
def multi_trial(cutoff)
  total = 0
  for i in 0..NUM_TRIALS
    total += single_trial(cutoff)
  end
  return Float(total) / NUM_TRIALS
end
# Runs many trials at a given cutoff to approximate the expected value.
Runs many trials at a given cutoff to approximate the expected value.
Runs many trials at a given cutoff to approximate the expected value .
def multi_trial(cutoff)
  total = 0
  for i in 0..NUM_TRIALS
    total += single_trial(cutoff)
  end
  return Float(total) / NUM_TRIALS
end
def multi_trial ( cutoff ) total = 0 for i in 0 .. NUM_TRIALS total += single_trial ( cutoff ) end return Float ( total ) / NUM_TRIALS end
Runs many trials at a given cutoff to approximate the expected value.
Runs many trials at a given cutoff to approximate the expected value .
cutoff