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

import math

ans = 0

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

    if i<k:

        p = math.ceil(math.log(k/i)/math.log(2))

        ans += (1/2)**p

    else:

        ans += 1

print((ans/n))

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

import math

ans = 0

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

    if i>=k:

        ans += n-i+1

        break

    x = math.ceil(math.log(k/i,2))

    ans += (1/2)**x

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

ans = 0
for i in range(1, n + 1):
    if i < k:
        p = math.ceil(math.log(k / i) / math.log(2))
        ans += (1 / 2) ** p
    else:
        ans += 1
print((ans / n))

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

ans = 0
for i in range(1, n + 1):
    if i >= k:
        ans += n - i + 1
        break
    x = math.ceil(math.log(k / i, 2))
    ans += (1 / 2) ** x
print((ans / n))

-    if i < k: -        p = math.ceil(math.log(k / i) / math.log(2)) -        ans += (1 / 2) ** p -    else: -        ans += 1 +    if i >= k: +        ans += n - i + 1 +        break +    x = math.ceil(math.log(k / i, 2)) +    ans += (1 / 2) ** x