from math import log2,ceil

N,K = list(map(int,input().split()))



r = [0.5]

for i in range(50):

    r.append(r[-1] / 2)



ans = 0

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

    if n > K-1:

        ans += 1

        continue

    c = ceil(log2(K/n))

    ans += r[c-1]

print((ans/N))
N,K = list(map(int,input().split()))

ans = 0

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

    if n >= K:

        ans += 1

        continue

    k = 0

    m = n

    while m < K:

        m *= 2

        k += 1

    ans += 2**-k

print((ans/N))
from math import log2, ceil

N, K = list(map(int, input().split()))
r = [0.5]
for i in range(50):
    r.append(r[-1] / 2)
ans = 0
for n in range(1, N + 1):
    if n > K - 1:
        ans += 1
        continue
    c = ceil(log2(K / n))
    ans += r[c - 1]
print((ans / N))

N, K = list(map(int, input().split()))
ans = 0
for n in range(1, N + 1):
    if n >= K:
        ans += 1
        continue
    k = 0
    m = n
    while m < K:
        m *= 2
        k += 1
    ans += 2**-k
print((ans / N))

-from math import log2, ceil - -r = [0.5] -for i in range(50): -    r.append(r[-1] / 2) -    if n > K - 1: +    if n >= K: -    c = ceil(log2(K / n)) -    ans += r[c - 1] +    k = 0 +    m = n +    while m < K: +        m *= 2 +        k += 1 +    ans += 2**-k