from collections import defaultdict, deque, Counter

def inpl(): return list(map(int, input().split()))



N, K = inpl()

ans = 0

X = 17



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

    while X and i * 2**(X-1) >= K:

        X -= 1

    ans += .5 ** X



print((ans/N))
def inpl(): return list(map(int, input().split()))

N, K = inpl()

X = [0] + [1/N if i <= N else 0 for i in range(1, K)]

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



for i in range(K):

    if (i*2 >= K):

        w += X[i]/2

    else:

        X[i*2] += X[i]/2

print(w)
from collections import defaultdict, deque, Counter


def inpl():
    return list(map(int, input().split()))


N, K = inpl()
ans = 0
X = 17
for i in range(1, N + 1):
    while X and i * 2 ** (X - 1) >= K:
        X -= 1
    ans += 0.5**X
print((ans / N))

def inpl():
    return list(map(int, input().split()))


N, K = inpl()
X = [0] + [1 / N if i <= N else 0 for i in range(1, K)]
w = max(0, N - K + 1) / N
for i in range(K):
    if i * 2 >= K:
        w += X[i] / 2
    else:
        X[i * 2] += X[i] / 2
print(w)

-from collections import defaultdict, deque, Counter - - -ans = 0 -X = 17 -for i in range(1, N + 1): -    while X and i * 2 ** (X - 1) >= K: -        X -= 1 -    ans += 0.5**X -print((ans / N)) +X = [0] + [1 / N if i <= N else 0 for i in range(1, K)] +w = max(0, N - K + 1) / N +for i in range(K): +    if i * 2 >= K: +        w += X[i] / 2 +    else: +        X[i * 2] += X[i] / 2 +print(w)