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





def calc(x):

    cnt = 1

    while x < K:

        cnt += 1

        x *= 2

    return cnt - 1





ans = 0

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

    ans += (1 / N) * (1 / (2 ** calc(i)))



print(ans)
from math import log2, ceil

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



ans = 0

j = 1.0

for x in range(N, 0, -1):

    if x >= K:

        ans += 1.0 * (1 / N)

    else:

        while x * j < K:

            j *= 2.0

        ans += (1.0 / j) * (1 / N)

print(ans)

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


def calc(x):
    cnt = 1
    while x < K:
        cnt += 1
        x *= 2
    return cnt - 1


ans = 0
for i in range(1, N + 1):
    ans += (1 / N) * (1 / (2 ** calc(i)))
print(ans)

from math import log2, ceil

N, K = list(map(int, input().split()))
ans = 0
j = 1.0
for x in range(N, 0, -1):
    if x >= K:
        ans += 1.0 * (1 / N)
    else:
        while x * j < K:
            j *= 2.0
        ans += (1.0 / j) * (1 / N)
print(ans)

+from math import log2, ceil + - - -def calc(x): -    cnt = 1 -    while x < K: -        cnt += 1 -        x *= 2 -    return cnt - 1 - - -for i in range(1, N + 1): -    ans += (1 / N) * (1 / (2 ** calc(i))) +j = 1.0 +for x in range(N, 0, -1): +    if x >= K: +        ans += 1.0 * (1 / N) +    else: +        while x * j < K: +            j *= 2.0 +        ans += (1.0 / j) * (1 / N)