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

ans = 0

if K <= N:

    ans += (1/N)*(N-K+1)

    dp = [0] + [1/N] * K

else:

    dp = [0] + [1/N] * N + [0] * (K-N)

for i in range(1,K):

    if i % 2 == 0:

        dp[i] += dp[i//2] * (1/2)

if K % 2 == 0:

    ans += sum(dp[K//2:K])*(1/2)

else:

    ans += sum(dp[K//2+1:K])*(1/2)

print(ans)

import math

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

ans = 0



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

    if i >= K:

        ans += (1/N)

        continue

    X = int(math.log((K/i), 2))

    if (K/i) % 2**X == 0:

        pass

    else:

        X += 1

    ans += (1/N) * (1/2) ** X

print(ans)

N, K = list(map(int, input().split()))
ans = 0
if K <= N:
    ans += (1 / N) * (N - K + 1)
    dp = [0] + [1 / N] * K
else:
    dp = [0] + [1 / N] * N + [0] * (K - N)
for i in range(1, K):
    if i % 2 == 0:
        dp[i] += dp[i // 2] * (1 / 2)
if K % 2 == 0:
    ans += sum(dp[K // 2 : K]) * (1 / 2)
else:
    ans += sum(dp[K // 2 + 1 : K]) * (1 / 2)
print(ans)

import math

N, K = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    if i >= K:
        ans += 1 / N
        continue
    X = int(math.log((K / i), 2))
    if (K / i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1 / N) * (1 / 2) ** X
print(ans)

+import math + -if K <= N: -    ans += (1 / N) * (N - K + 1) -    dp = [0] + [1 / N] * K -else: -    dp = [0] + [1 / N] * N + [0] * (K - N) -for i in range(1, K): -    if i % 2 == 0: -        dp[i] += dp[i // 2] * (1 / 2) -if K % 2 == 0: -    ans += sum(dp[K // 2 : K]) * (1 / 2) -else: -    ans += sum(dp[K // 2 + 1 : K]) * (1 / 2) +for i in range(1, N + 1): +    if i >= K: +        ans += 1 / N +        continue +    X = int(math.log((K / i), 2)) +    if (K / i) % 2**X == 0: +        pass +    else: +        X += 1 +    ans += (1 / N) * (1 / 2) ** X