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



result = 0

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

	d, x = 0, n

	while x < K:

		d += 1

		x *= 2

	result += (1 / N) * (1 / 2)**d

print(result)

from math import ceil



# 定数

INF = float("inf")

MOD = int(1e9 + 7)



# エントリーポイント

def main():

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

    r = 0

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

        c = 0

        while n < K:

            n *= 2

            c += 1

        r += 0.5 ** c

    print((r / N))



main()

N, K = list(map(int, input().split()))
result = 0
for n in range(1, N + 1):
    d, x = 0, n
    while x < K:
        d += 1
        x *= 2
    result += (1 / N) * (1 / 2) ** d
print(result)

from math import ceil

# 定数
INF = float("inf")
MOD = int(1e9 + 7)
# エントリーポイント
def main():
    N, K = list(map(int, input().split()))
    r = 0
    for n in range(1, N + 1):
        c = 0
        while n < K:
            n *= 2
            c += 1
        r += 0.5**c
    print((r / N))


main()

-N, K = list(map(int, input().split())) -result = 0 -for n in range(1, N + 1): -    d, x = 0, n -    while x < K: -        d += 1 -        x *= 2 -    result += (1 / N) * (1 / 2) ** d -print(result) +from math import ceil + +# 定数 +INF = float("inf") +MOD = int(1e9 + 7) +# エントリーポイント +def main(): +    N, K = list(map(int, input().split())) +    r = 0 +    for n in range(1, N + 1): +        c = 0 +        while n < K: +            n *= 2 +            c += 1 +        r += 0.5**c +    print((r / N)) + + +main()