#ABC126C-DiceAndCoin.py



from sys import stdin

import random



N,K = list(map(int, stdin.readline().split()))



result = 0



for n in range(N):

    n = n + 1

    x = 0

    while True:

        if 2 ** x * n >= K:

            break

        x += 1

    result += 1/N * 0.5 ** x



print(result)

#ABC126C-DiceAndCoin.py



from sys import stdin

import random



N,K = list(map(int, stdin.readline().split()))



result = 0

i,j = 0, N

X = []



while True:

    if j >= K/(2**i):

        k = int(j-(K/(2**i)-1))

        X.append(k)

        j -= k

    else:

        X.append(0)

    if K/(2**i) < 1:

        break

    i += 1



for i in range(len(X)):

    result += 0.5 ** i * X[i]

result = result * 1/N



print(result)

# ABC126C-DiceAndCoin.py
from sys import stdin
import random

N, K = list(map(int, stdin.readline().split()))
result = 0
for n in range(N):
    n = n + 1
    x = 0
    while True:
        if 2**x * n >= K:
            break
        x += 1
    result += 1 / N * 0.5**x
print(result)

# ABC126C-DiceAndCoin.py
from sys import stdin
import random

N, K = list(map(int, stdin.readline().split()))
result = 0
i, j = 0, N
X = []
while True:
    if j >= K / (2**i):
        k = int(j - (K / (2**i) - 1))
        X.append(k)
        j -= k
    else:
        X.append(0)
    if K / (2**i) < 1:
        break
    i += 1
for i in range(len(X)):
    result += 0.5**i * X[i]
result = result * 1 / N
print(result)

-for n in range(N): -    n = n + 1 -    x = 0 -    while True: -        if 2**x * n >= K: -            break -        x += 1 -    result += 1 / N * 0.5**x +i, j = 0, N +X = [] +while True: +    if j >= K / (2**i): +        k = int(j - (K / (2**i) - 1)) +        X.append(k) +        j -= k +    else: +        X.append(0) +    if K / (2**i) < 1: +        break +    i += 1 +for i in range(len(X)): +    result += 0.5**i * X[i] +result = result * 1 / N