n, k = gets.split.map(&:to_i)
n = n.to_f
result = 0.0
if n >= k
  result = (n-k+1) / n
end

k = k.to_f
old_k = k
coin = 1
while k >= 1
  k = k/2
  if k < n
    old_k = n+1 if old_k > n
    count = old_k.ceil - k.ceil
    result += count / n / 2**coin
  end
  coin += 1
  old_k = k
end

puts result
