import math
N,K=map(int,input().split())
pro=0
if N==1 and K==1:
    print(1)
elif N>=K:
    pro+=(N-K+1)/N
    for k in range(1, K):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro)

else:
    for k in range(1, N+1):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro)
 import math math N,K=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K pro=0 pro 0 if N==1 and K==1:
    print(1)
elif N>=K:
    pro+=(N-K+1)/N
    for k in range(1, K):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro)

else:
    for k in range(1, N+1):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro) N==1 and K==1 N==1 N 1 K==1 K 1 print(1) print 1 elif N>=K:
    pro+=(N-K+1)/N
    for k in range(1, K):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro) N>=K N K pro+=(N-K+1)/N pro (N-K+1)/N N-K+1 N-K N K 1 N for k in range(1, K):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
     k range(1, K) range 1 K r = math.ceil(math.log(K / k,2)) r math.ceil(math.log(K / k,2)) math.ceil math ceil math.log(K / k,2) math.log math log K / k K k 2 pro += 0.5**r / N pro 0.5**r / N 0.5**r 0.5 r N print(pro) print pro for k in range(1, N+1):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
     k range(1, N+1) range 1 N+1 N 1 r = math.ceil(math.log(K / k,2)) r math.ceil(math.log(K / k,2)) math.ceil math ceil math.log(K / k,2) math.log math log K / k K k 2 pro += 0.5**r / N pro 0.5**r / N 0.5**r 0.5 r N print(pro) print pro r = math.ceil(math.log(K / k,2)) math.ceil(math.log(K / k,2)) r K=map(int,input().split()) map(int,input().split()) K pro+=(N-K+1)/N (N-K+1)/N pro r = math.ceil(math.log(K / k,2)) math.ceil(math.log(K / k,2)) r N,K=map(int,input().split()) map(int,input().split()) N pro=0 0 pro pro += 0.5**r / N 0.5**r / N pro pro += 0.5**r / N 0.5**r / N pro
import math
N,K=map(int,input().split())
pro=0
if N==1 and K==1:
    print(1)
elif N>=K:
    pro+=(N-K+1)/N
    for k in range(1, K):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro)

else:
    for k in range(1, N+1):
        r = math.ceil(math.log(K / k,2))
        pro += 0.5**r / N
    print(pro)

