n,k = list(map(int,input().split()))



ans = 0

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

  count = 0

  while i < k:

    i *= 2

    count += 1

  

  ans += (1/n) * (1/2**count)

print(ans)
n,k = list(map(int, input().split()))



ans = 0

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

  t = 0

  while i < k:

    i = i*2

    t += 1

  ans += (0.5**t)/n

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

n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    t = 0
    while i < k:
        i = i * 2
        t += 1
    ans += (0.5**t) / n
print(ans)

-    count = 0 +    t = 0 -        i *= 2 -        count += 1 -    ans += (1 / n) * (1 / 2**count) +        i = i * 2 +        t += 1 +    ans += (0.5**t) / n