n, k = gets.chomp.split.map(&:to_f)
res = 0.0
cur = n
i = k
coin = 1.0
while cur > 0
  if i <= cur
    d = cur + 1 - i
    cur -= d
    res += d * coin
  end
  i = (i / 2.0).ceil
  coin /= 2.0
end
puts "%.11f" % [res / n]