##templete
include Math
n, k = gets.chomp.split(" ").map { |e| e.to_f }

res = 0

for i in 1..n do
    temp = 1.0 / n
    if i <= k-1
      hoge = (Math.log(k / i.to_f) / Math.log(2)).ceil
      temp1 = (1 / 2.0) ** hoge
      temp *= temp1
    end
    res += temp
end

puts res
