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

import math



def get_p(nums,k):

    p=1/(2**math.ceil(max(math.log(k/nums,2),0)))

    return p



ans=0

for nums in range(n):

    ans+=get_p(nums+1,k)

    

print(("{0:.20f}".format(ans/n)))
import math



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

ans=0

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

    cnt=0

    now=i

    while now<k:

        now*=2

        cnt+=1

    ans+=1/pow(2,cnt)



print((ans/n))

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


def get_p(nums, k):
    p = 1 / (2 ** math.ceil(max(math.log(k / nums, 2), 0)))
    return p


ans = 0
for nums in range(n):
    ans += get_p(nums + 1, k)
print(("{0:.20f}".format(ans / n)))

import math

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

-n, k = list(map(int, input().split())) - -def get_p(nums, k): -    p = 1 / (2 ** math.ceil(max(math.log(k / nums, 2), 0))) -    return p - - +n, k = list(map(int, input().split())) -for nums in range(n): -    ans += get_p(nums + 1, k) -print(("{0:.20f}".format(ans / n))) +for i in range(1, n + 1): +    cnt = 0 +    now = i +    while now < k: +        now *= 2 +        cnt += 1 +    ans += 1 / pow(2, cnt) +print((ans / n))