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

b = 1.0 / n

ret = 0

while n > 0:

    t = max(n - k + 1, 0)

    ret += b * t

    n -= t

    k -= k // 2

    b *= 0.5

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

ret = 0.0

p = 1.0

r = n + 1

while True:

    num = r - min(r, k)

    ret += num * p

    r   -= num

    if k == 1:

        break

    k = (k + 1) // 2

    p = p * 0.5

print((ret / n))

n, k = list(map(int, input().split()))
b = 1.0 / n
ret = 0
while n > 0:
    t = max(n - k + 1, 0)
    ret += b * t
    n -= t
    k -= k // 2
    b *= 0.5
print(ret)

n, k = list(map(int, input().split()))
ret = 0.0
p = 1.0
r = n + 1
while True:
    num = r - min(r, k)
    ret += num * p
    r -= num
    if k == 1:
        break
    k = (k + 1) // 2
    p = p * 0.5
print((ret / n))

-b = 1.0 / n -ret = 0 -while n > 0: -    t = max(n - k + 1, 0) -    ret += b * t -    n -= t -    k -= k // 2 -    b *= 0.5 -print(ret) +ret = 0.0 +p = 1.0 +r = n + 1 +while True: +    num = r - min(r, k) +    ret += num * p +    r -= num +    if k == 1: +        break +    k = (k + 1) // 2 +    p = p * 0.5 +print((ret / n))