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



p=0.0

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

    m=0

#    print(k,i,m,i*2**m)

    while k>i*2**m:

#        print(k,i,m,i*2**m)

        m=m+1

#    print(m)

    p=p+(0.5)**m/n

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



ret=0

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

    now=i

    tmp=1/n

    while now<k:

        now*=2

        tmp/=2

    ret+=tmp 



print(ret)

n, k = list(map(int, input().split()))
p = 0.0
for i in range(1, n + 1):
    m = 0
    #    print(k,i,m,i*2**m)
    while k > i * 2**m:
        #        print(k,i,m,i*2**m)
        m = m + 1
    #    print(m)
    p = p + (0.5) ** m / n
print(p)

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

-p = 0.0 +ret = 0 -    m = 0 -    #    print(k,i,m,i*2**m) -    while k > i * 2**m: -        #        print(k,i,m,i*2**m) -        m = m + 1 -    #    print(m) -    p = p + (0.5) ** m / n -print(p) +    now = i +    tmp = 1 / n +    while now < k: +        now *= 2 +        tmp /= 2 +    ret += tmp +print(ret)