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

result = 0



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

    prob = 1

    x = i

    for j in range(i, K):

        if K <= x:

            break

        prob *= 0.5

        x *= 2

    result += prob/N



print(('{0:.12f}'.format(result)))
N, K = list(map(int, input().split()))

result = 0



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

    prob = 1

    while x < K:

        prob *= 0.5

        x *= 2

    result += prob/N



print(('{0:.9f}'.format(result)))
N, K = list(map(int, input().split()))
result = 0
for i in range(1, N + 1):
    prob = 1
    x = i
    for j in range(i, K):
        if K <= x:
            break
        prob *= 0.5
        x *= 2
    result += prob / N
print(("{0:.12f}".format(result)))

N, K = list(map(int, input().split()))
result = 0
for x in range(1, N + 1):
    prob = 1
    while x < K:
        prob *= 0.5
        x *= 2
    result += prob / N
print(("{0:.9f}".format(result)))

-for i in range(1, N + 1): +for x in range(1, N + 1): -    x = i -    for j in range(i, K): -        if K <= x: -            break +    while x < K: -print(("{0:.12f}".format(result))) +print(("{0:.9f}".format(result)))