import math

n, k  = map(int, input().split())
if k<=n:
    ans = 0
    for i in range(1, k):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    ans += (n-k+1)/n
    print(ans)
else:
    ans = 0
    for i in range(1, n+1):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    print(ans) import math math n, k  = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k if k<=n:
    ans = 0
    for i in range(1, k):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    ans += (n-k+1)/n
    print(ans)
else:
    ans = 0
    for i in range(1, n+1):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    print(ans) k<=n k n ans = 0 ans 0 for i in range(1, k):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
     i range(1, k) range 1 k m = math.ceil(math.log2(k/i)) m math.ceil(math.log2(k/i)) math.ceil math ceil math.log2(k/i) math.log2 math log2 k/i k i ans+=1/pow(2, m) ans 1/pow(2, m) 1 pow(2, m) pow 2 m ans/=n ans n ans += (n-k+1)/n ans (n-k+1)/n n-k+1 n-k n k 1 n print(ans) print ans ans = 0 ans 0 for i in range(1, n+1):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
     i range(1, n+1) range 1 n+1 n 1 m = math.ceil(math.log2(k/i)) m math.ceil(math.log2(k/i)) math.ceil math ceil math.log2(k/i) math.log2 math log2 k/i k i ans+=1/pow(2, m) ans 1/pow(2, m) 1 pow(2, m) pow 2 m ans/=n ans n print(ans) print ans ans = 0 0 ans m = math.ceil(math.log2(k/i)) math.ceil(math.log2(k/i)) m ans+=1/pow(2, m) 1/pow(2, m) ans ans += (n-k+1)/n (n-k+1)/n ans ans = 0 0 ans k  = map(int, input().split()) map(int, input().split()) k ans+=1/pow(2, m) 1/pow(2, m) ans n, k  = map(int, input().split()) map(int, input().split()) n ans/=n n ans m = math.ceil(math.log2(k/i)) math.ceil(math.log2(k/i)) m ans/=n n ans
import math

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