import math

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

a=0

k=math.log2(k)

for i in range(n):

    a+=2**-max(math.ceil(k-math.log2(i+1)),0)/n

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

a=0

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

    j=0

    while i<k:

        i*=2

        j+=1

    a+=0.5**j

print((a/n))
import math

n, k = list(map(int, input().split()))
a = 0
k = math.log2(k)
for i in range(n):
    a += 2 ** -max(math.ceil(k - math.log2(i + 1)), 0) / n
print(a)

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

-import math - -k = math.log2(k) -for i in range(n): -    a += 2 ** -max(math.ceil(k - math.log2(i + 1)), 0) / n -print(a) +for i in range(1, n + 1): +    j = 0 +    while i < k: +        i *= 2 +        j += 1 +    a += 0.5**j +print((a / n))