envelopes.rb
def single_trial(cutoff)
  lower_value = rand() * PRIOR_LOWER_MAX
  higher_value = 2 * lower_value
  if rand() < 0.5 then
  	return (if lower_value >= cutoff then lower_value else higher_value end)
  else
  	return (if higher_value >= cutoff then higher_value else lower_value end)
  end
end
# Runs a single trial where an envelope is chosen.  If the chosen envelope has
# a value < cutoff, the function will switch envelopes, otherwise it will keep
# the envelope it has chosen. Returns the value of the envelope it ultimately 
# selects.
Runs a single trial where an envelope is chosen.  If the chosen envelope has
a value < cutoff, the function will switch envelopes, otherwise it will keep
the envelope it has chosen. Returns the value of the envelope it ultimately
selects.
Runs a single trial where an envelope is chosen . If the chosen envelope has a value < cutoff the function will switch envelopes otherwise it will keep the envelope it has chosen . Returns the value of the envelope it ultimately selects .
def single_trial(cutoff)
  lower_value = rand() * PRIOR_LOWER_MAX
  higher_value = 2 * lower_value
  if rand() < 0.5 then
  	return (if lower_value >= cutoff then lower_value else higher_value end)
  else
  	return (if higher_value >= cutoff then higher_value else lower_value end)
  end
end
def single_trial ( cutoff ) lower_value = rand ( ) * PRIOR_LOWER_MAX higher_value = 2 * lower_value if rand ( ) < 0.5 then return ( if lower_value >= cutoff then lower_value else higher_value end ) else return ( if higher_value >= cutoff then higher_value else lower_value end ) end end
Runs a single trial where an envelope is chosen.
Runs a single trial where an envelope is chosen .
cutoff