import sys

sys.setrecursionlimit(20000000)

#input = sys.stdin.readline

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

ans = 0

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

    a = i + 0

    b = 1

    while a < k:

        b /= 2

        a*=2

    ans += (1/n)*b

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

ans = 0

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

    tmp = i+0

    x = 1/n

    while i<k:

        i*=2

        x/=2

    ans+=x

print(ans)
import sys

sys.setrecursionlimit(20000000)
# input = sys.stdin.readline
n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    a = i + 0
    b = 1
    while a < k:
        b /= 2
        a *= 2
    ans += (1 / n) * b
print(ans)

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

-import sys - -sys.setrecursionlimit(20000000) -# input = sys.stdin.readline -    a = i + 0 -    b = 1 -    while a < k: -        b /= 2 -        a *= 2 -    ans += (1 / n) * b +    tmp = i + 0 +    x = 1 / n +    while i < k: +        i *= 2 +        x /= 2 +    ans += x