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

ans=0

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

    tmp=1/n

    if i<k:

        now=i

        while now<k:

            now*=2

            tmp/=2

    ans+=tmp

print(ans)
import math

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

ans=0

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

    if i<k:

        ans+=(0.5**math.ceil(math.log2(k/i)))/n

    else:

        ans+=1/n

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

import math

n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    if i < k:
        ans += (0.5 ** math.ceil(math.log2(k / i))) / n
    else:
        ans += 1 / n
print(ans)

+import math + -    tmp = 1 / n -        now = i -        while now < k: -            now *= 2 -            tmp /= 2 -    ans += tmp +        ans += (0.5 ** math.ceil(math.log2(k / i))) / n +    else: +        ans += 1 / n