import sys

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

from decimal import *



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



x = Decimal("0.5")

ans = 0

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

    p = 1

    while i < K:

        i *= 2

        p *= x

    ans += p   

ans /= N

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



ans = 0



def calc(x, goal):

    res = 0

    while x < goal:

        x *= 2

        res += 1

    return res    





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

    cnt = calc(i, K)

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



print(ans)
import sys

input = lambda: sys.stdin.readline().rstrip()
from decimal import *

N, K = list(map(int, input().split()))
x = Decimal("0.5")
ans = 0
for i in range(1, N + 1):
    p = 1
    while i < K:
        i *= 2
        p *= x
    ans += p
ans /= N
print(ans)

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


def calc(x, goal):
    res = 0
    while x < goal:
        x *= 2
        res += 1
    return res


for i in range(1, N + 1):
    cnt = calc(i, K)
    ans += 1 / N * ((1 / 2) ** cnt)
print(ans)

-import sys +N, K = list(map(int, input().split())) +ans = 0 -input = lambda: sys.stdin.readline().rstrip() -from decimal import * -N, K = list(map(int, input().split())) -x = Decimal("0.5") -ans = 0 +def calc(x, goal): +    res = 0 +    while x < goal: +        x *= 2 +        res += 1 +    return res + + -    p = 1 -    while i < K: -        i *= 2 -        p *= x -    ans += p -ans /= N +    cnt = calc(i, K) +    ans += 1 / N * ((1 / 2) ** cnt)