n, k = gets.split.map(&:to_i)

ans = 0
1.upto(n) do |i|
  if i >= k
    ans += Rational(1,n)
  else
    j = 0
    tmp = i
    while tmp < k do
      tmp *= 2
      j += 1
    end
    ans += Rational(1,n*(2**j))
  end
end

puts ans.to_f
