def main():
    N,K = map(int,input().split())
    ans = 0
    dict = {}
    cnt = 0
    tmp = 1/N
    for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
    return ans

print(main()) def main():
    N,K = map(int,input().split())
    ans = 0
    dict = {}
    cnt = 0
    tmp = 1/N
    for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
    return ans main N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K ans = 0 ans 0 dict = {} dict {} cnt = 0 cnt 0 tmp = 1/N tmp 1/N 1 N for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
     i range(N,0,-1) range N 0 -1 i = float(i) i float(i) float i if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
     K <= i K i ans += tmp*(0.5**cnt) ans tmp*(0.5**cnt) tmp 0.5**cnt 0.5 cnt while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
             True K = K/2 K K/2 K 2 cnt += 1 cnt 1 if K <= i:
                    break
             K <= i K i break ans += tmp*(0.5**cnt) ans tmp*(0.5**cnt) tmp 0.5**cnt 0.5 cnt return ans ans print(main()) print main() main def main():
    N,K = map(int,input().split())
    ans = 0
    dict = {}
    cnt = 0
    tmp = 1/N
    for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
    return ans def main():
    N,K = map(int,input().split())
    ans = 0
    dict = {}
    cnt = 0
    tmp = 1/N
    for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
    return ans main
def main():
    N,K = map(int,input().split())
    ans = 0
    dict = {}
    cnt = 0
    tmp = 1/N
    for i in range(N,0,-1):
        i = float(i)
        if K <= i:
            ans += tmp*(0.5**cnt)
        else:
            while True:
                K = K/2
                cnt += 1
                if K <= i:
                    break
            ans += tmp*(0.5**cnt)
    return ans

print(main())
