def f(n):

    k = 0

    while n*2**k<K:

        k += 1

    return k

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

if K<=N:

    P = (N-K+1)/N

    for i in range(1,K):

        P += 2**(-f(i))/N

else:

    P = 0

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

        P += 2**(-f(i))/N

print(P)
import math

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

P = max((N-K+1)/N,0)

cnt = 0

for k in range(1,min(N,K-1)+1):

    cnt += 2**(-math.ceil(math.log2(K/k)))

cnt = cnt/N

P += cnt

print(P)
def f(n):
    k = 0
    while n * 2**k < K:
        k += 1
    return k


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

import math

N, K = list(map(int, input().split()))
P = max((N - K + 1) / N, 0)
cnt = 0
for k in range(1, min(N, K - 1) + 1):
    cnt += 2 ** (-math.ceil(math.log2(K / k)))
cnt = cnt / N
P += cnt
print(P)

-def f(n): -    k = 0 -    while n * 2**k < K: -        k += 1 -    return k - +import math -if K <= N: -    P = (N - K + 1) / N -    for i in range(1, K): -        P += 2 ** (-f(i)) / N -else: -    P = 0 -    for i in range(1, N + 1): -        P += 2 ** (-f(i)) / N +P = max((N - K + 1) / N, 0) +cnt = 0 +for k in range(1, min(N, K - 1) + 1): +    cnt += 2 ** (-math.ceil(math.log2(K / k))) +cnt = cnt / N +P += cnt