from math import fsum

from functools import lru_cache

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



@lru_cache(maxsize=None)

def f(x):

    return f(x * 2) * 0.5 if x < K else 1



ans = fsum(f(i + 1) for i in range(N)) / N

print(ans)
import math

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

p = [0] * N

for i in range(N):

    n = i + 1

    x = 1 / N

    while n < K:

        x *= 0.5

        n *= 2

    p[i] = x

ans = math.fsum(p)

print(ans)
from math import fsum
from functools import lru_cache

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


@lru_cache(maxsize=None)
def f(x):
    return f(x * 2) * 0.5 if x < K else 1


ans = fsum(f(i + 1) for i in range(N)) / N
print(ans)

import math

N, K = list(map(int, input().split()))
p = [0] * N
for i in range(N):
    n = i + 1
    x = 1 / N
    while n < K:
        x *= 0.5
        n *= 2
    p[i] = x
ans = math.fsum(p)
print(ans)

-from math import fsum -from functools import lru_cache +import math - - -@lru_cache(maxsize=None) -def f(x): -    return f(x * 2) * 0.5 if x < K else 1 - - -ans = fsum(f(i + 1) for i in range(N)) / N +p = [0] * N +for i in range(N): +    n = i + 1 +    x = 1 / N +    while n < K: +        x *= 0.5 +        n *= 2 +    p[i] = x +ans = math.fsum(p)