n,k = gets.chomp.split(' ').map(&:to_i)
ans = [n-k+1,0].max.to_f/n
i = 1
if n >= k
  range = k
else
  range = n+1
end

while i < range
  count = 0
  while true
    if i*(2**count) >= k
      break
    end
    count += 1
  end
  ans += 1.0/((2**count)*n)
  i += 1
end
puts ans