import numpy as np



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

e = 0

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

    if i < k:

        if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)):

            sh = int(np.log2(k) - np.log2(i))  # 何回コインを投げるか

        else:

            sh = int(np.log2(k) - np.log2(i) + 1)

        e += (1 / n) * 0.5 ** sh

    else:

        e += (1 / n)

print(e)
import math

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



ans = 0

ma = 10**9

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

    p = math.ceil(math.log2(k) - math.log2(i))

    if p >= 1:

        ans += 1/(n*2**p)

    else:

        ans += 1/n



print(ans)
import numpy as np

n, k = list(map(int, input().split()))
e = 0
for i in range(1, n + 1):
    if i < k:
        if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)):
            sh = int(np.log2(k) - np.log2(i))  # 何回コインを投げるか
        else:
            sh = int(np.log2(k) - np.log2(i) + 1)
        e += (1 / n) * 0.5**sh
    else:
        e += 1 / n
print(e)

import math

n, k = list(map(int, input().split()))
ans = 0
ma = 10**9
for i in range(1, n + 1):
    p = math.ceil(math.log2(k) - math.log2(i))
    if p >= 1:
        ans += 1 / (n * 2**p)
    else:
        ans += 1 / n
print(ans)

-import numpy as np +import math -e = 0 +ans = 0 +ma = 10**9 -    if i < k: -        if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)): -            sh = int(np.log2(k) - np.log2(i))  # 何回コインを投げるか -        else: -            sh = int(np.log2(k) - np.log2(i) + 1) -        e += (1 / n) * 0.5**sh +    p = math.ceil(math.log2(k) - math.log2(i)) +    if p >= 1: +        ans += 1 / (n * 2**p) -        e += 1 / n -print(e) +        ans += 1 / n +print(ans)