import sys

input = sys.stdin.readline



n, k = [int(x) for x in input().split()]



ans = 0



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

    score = i

    cnt = 0

    while score < k:

        cnt += 1

        score *= 2

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



print(ans)
import sys

input = lambda : sys.stdin.readline().rstrip()



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



p = 0



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

    cnt = 0

    while 1 <= i <= k - 1:

        cnt += 1

        i *= 2

    p += 0.5**cnt



print((p / n))
import sys

input = sys.stdin.readline
n, k = [int(x) for x in input().split()]
ans = 0
for i in range(1, n + 1):
    score = i
    cnt = 0
    while score < k:
        cnt += 1
        score *= 2
    ans += (1 / n) * (1 / 2) ** cnt
print(ans)

import sys

input = lambda: sys.stdin.readline().rstrip()
n, k = list(map(int, input().split()))
p = 0
for i in range(1, n + 1):
    cnt = 0
    while 1 <= i <= k - 1:
        cnt += 1
        i *= 2
    p += 0.5**cnt
print((p / n))

-input = sys.stdin.readline -n, k = [int(x) for x in input().split()] -ans = 0 +input = lambda: sys.stdin.readline().rstrip() +n, k = list(map(int, input().split())) +p = 0 -    score = i -    while score < k: +    while 1 <= i <= k - 1: -        score *= 2 -    ans += (1 / n) * (1 / 2) ** cnt -print(ans) +        i *= 2 +    p += 0.5**cnt +print((p / n))