from math import log2, ceil



N,K = list(map(int,input().split()))



ans = 0



def cal(n):

    l = ceil(log2(K/n))

    if n >= K:

        return 1/N

    return pow(2,-l)/N



for i in range(1,N+1):

    ans += cal(i)



print(ans)
N,K = list(map(int,input().split()))



ans = 0



for i in range(1,N+1):

    l = 0

    while i < K:

        i *= 2

        l += 1

    ans += (1/N)*pow(2,-l)



print(ans)
from math import log2, ceil

N, K = list(map(int, input().split()))
ans = 0


def cal(n):
    l = ceil(log2(K / n))
    if n >= K:
        return 1 / N
    return pow(2, -l) / N


for i in range(1, N + 1):
    ans += cal(i)
print(ans)

N, K = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    l = 0
    while i < K:
        i *= 2
        l += 1
    ans += (1 / N) * pow(2, -l)
print(ans)

-from math import log2, ceil - - - -def cal(n): -    l = ceil(log2(K / n)) -    if n >= K: -        return 1 / N -    return pow(2, -l) / N - - -    ans += cal(i) +    l = 0 +    while i < K: +        i *= 2 +        l += 1 +    ans += (1 / N) * pow(2, -l)