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

i = 0
sum = 0.0
pre = n + 1
while pre != 1
    x = k.fdiv(2 ** i).ceil
    if pre >= x
        sum += (pre - x).fdiv(2 ** i)
        pre = x
    end
    i += 1
end

puts sum / n