import sys

N, K = map(int, sys.stdin.readline().split())
ans = 0
for i in range(1, N+1):
    if K <= i:
        ans += 1 / N
    else:
        count = 0
        while i < K:
            count += 1
            i *= 2
        ans += (1 / N) * 0.5 ** count

print(ans) import sys sys N, K = map(int, sys.stdin.readline().split()) N map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split K ans = 0 ans 0 for i in range(1, N+1):
    if K <= i:
        ans += 1 / N
    else:
        count = 0
        while i < K:
            count += 1
            i *= 2
        ans += (1 / N) * 0.5 ** count i range(1, N+1) range 1 N+1 N 1 if K <= i:
        ans += 1 / N
    else:
        count = 0
        while i < K:
            count += 1
            i *= 2
        ans += (1 / N) * 0.5 ** count K <= i K i ans += 1 / N ans 1 / N 1 N count = 0 count 0 while i < K:
            count += 1
            i *= 2
         i < K i K count += 1 count 1 i *= 2 i 2 ans += (1 / N) * 0.5 ** count ans (1 / N) * 0.5 ** count 1 / N 1 N 0.5 ** count 0.5 count print(ans) print ans ans += 1 / N 1 / N ans ans = 0 0 ans i *= 2 2 i ans += (1 / N) * 0.5 ** count (1 / N) * 0.5 ** count ans K = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) K count += 1 1 count count = 0 0 count N, K = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) N
import sys

N, K = map(int, sys.stdin.readline().split())
ans = 0
for i in range(1, N+1):
    if K <= i:
        ans += 1 / N
    else:
        count = 0
        while i < K:
            count += 1
            i *= 2
        ans += (1 / N) * 0.5 ** count

print(ans)