local N, K = io.read("n", "n")

local ceil = math.ceil
local log = math.log
local function getx(n)
    return ceil(log(K/n, 2))
end

local ans = 0.0

local head_win_limit = math.min(K-1, N)
for n=1, head_win_limit do
    local x = getx(n)
    --print(n, x)
    ans = ans + (1.0/N) * ((1.0/2.0) ^ x)
end

if N-K+1 > 0 then
    ans = ans + (N-K+1.0)/N
end
print(ans)