#ABC-126-C

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

possibility = 0



def check_double(n, K):

    count = 0

    while n < K:

        n *= 2

        count += 1

    return count



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

    possibility += (1/N) * (0.5 ** check_double(i, K))



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



ans = 0



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

    tmp = 1

    while i < K:

        tmp /= 2

        i *= 2

    ans += tmp



ans /= N

print(ans)

# ABC-126-C
N, K = list(map(int, input().split()))
possibility = 0


def check_double(n, K):
    count = 0
    while n < K:
        n *= 2
        count += 1
    return count


for i in range(1, N + 1):
    possibility += (1 / N) * (0.5 ** check_double(i, K))
print(possibility)

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

-# ABC-126-C -possibility = 0 - - -def check_double(n, K): -    count = 0 -    while n < K: -        n *= 2 -        count += 1 -    return count - - +ans = 0 -    possibility += (1 / N) * (0.5 ** check_double(i, K)) -print(possibility) +    tmp = 1 +    while i < K: +        tmp /= 2 +        i *= 2 +    ans += tmp +ans /= N +print(ans)