import math as m





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

P = 0



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

    if i >= K:

        P += (N-i+1) / N

        break

    else:

        if m.log2(K/i).is_integer():

            P += 1 / (N*2**(m.log10(K/i)/m.log10(2)))

        else:

            P += 1 / (N*2**int(m.log10(K/i)/m.log10(2) + 1))



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

P = 0



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

    if i >= K:

        P += (N-i+1) / N

        break



    else:

        n = 1

        while i*n < K:

            n *= 2

        P += 1 / (N*n)





print(P)
import math as m

N, K = list(map(int, input().split()))
P = 0
for i in range(1, N + 1):
    if i >= K:
        P += (N - i + 1) / N
        break
    else:
        if m.log2(K / i).is_integer():
            P += 1 / (N * 2 ** (m.log10(K / i) / m.log10(2)))
        else:
            P += 1 / (N * 2 ** int(m.log10(K / i) / m.log10(2) + 1))
print(P)

N, K = list(map(int, input().split()))
P = 0
for i in range(1, N + 1):
    if i >= K:
        P += (N - i + 1) / N
        break
    else:
        n = 1
        while i * n < K:
            n *= 2
        P += 1 / (N * n)
print(P)

-import math as m - -        if m.log2(K / i).is_integer(): -            P += 1 / (N * 2 ** (m.log10(K / i) / m.log10(2))) -        else: -            P += 1 / (N * 2 ** int(m.log10(K / i) / m.log10(2) + 1)) +        n = 1 +        while i * n < K: +            n *= 2 +        P += 1 / (N * n)