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



ans = 0

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

    tmp = 1 / N

    cnt = 0

    while i < K:

        i *= 2

        cnt += 1

    tmp *= (0.5) ** cnt

    ans += tmp

    

print(ans)
n, k = list(map(int,  input().split()))



ans = 0

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

    cnt = 0

    while i * (2 ** cnt) < k:

        cnt += 1

    tmp = (1 / n) * (0.5 ** cnt)

    ans += tmp

    

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

n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    cnt = 0
    while i * (2**cnt) < k:
        cnt += 1
    tmp = (1 / n) * (0.5**cnt)
    ans += tmp
print(ans)

-N, K = list(map(int, input().split())) +n, k = list(map(int, input().split())) -for i in range(1, N + 1): -    tmp = 1 / N +for i in range(1, n + 1): -    while i < K: -        i *= 2 +    while i * (2**cnt) < k: -    tmp *= (0.5) ** cnt +    tmp = (1 / n) * (0.5**cnt)