n,k=io.read("*n","*n")
p=0
for i=1,n do
    if i<k then
        x=1
        while i*2^x<k do
            x=x+1
        end
        p=p+(1/n)*(1/2)^x
    else
        p=p+(1/n)
    end
end
print(string.format("%.12f",p))