import numpy as np

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

ans = 0

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

    j = i

    idx = 0

    while j < K:

        j *= 2

        idx += 1

    ans += 1 / N * np.power(1 / 2 , idx)

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

ans = 0

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

    cnt = 0

    while x < K:

        cnt += 1

        x *= 2

    ans += (1 / N) * (1 / 2) ** cnt

print(ans)

import numpy as np

N, K = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    j = i
    idx = 0
    while j < K:
        j *= 2
        idx += 1
    ans += 1 / N * np.power(1 / 2, idx)
print(ans)

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

-import numpy as np - -for i in range(1, N + 1): -    j = i -    idx = 0 -    while j < K: -        j *= 2 -        idx += 1 -    ans += 1 / N * np.power(1 / 2, idx) +for x in range(1, N + 1): +    cnt = 0 +    while x < K: +        cnt += 1 +        x *= 2 +    ans += (1 / N) * (1 / 2) ** cnt