def f(n):

    x = 1

    while n*2**x<K:

        x += 1

    return x

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

ans = 0

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

    if i<K:

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

    else:

        ans += 1/N

print(ans)
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)
def f(n):
    x = 1
    while n * 2**x < K:
        x += 1
    return x


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

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)

-    x = 1 -    while n * 2**x < K: -        x += 1 -    return x +    k = 0 +    while n * 2**k < K: +        k += 1 +    return k -ans = 0 -for i in range(1, N + 1): -    if i < K: -        ans += 2 ** (-f(i)) / N -    else: -        ans += 1 / N -print(ans) +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)