import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

if k == 1:
    print(1)
    sys.exit(0)

if k <= n:
    ans = ((n - k) + 1) / n
    upper = k - 1
else:
    ans = 0
    upper = n
for i in range(1, upper + 1):
    tmp = 1 / n
    while i < k:
        tmp *= (1 / 2)
        i *= 2
    ans += tmp
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k if k == 1:
    print(1)
    sys.exit(0) k == 1 k 1 print(1) print 1 sys.exit(0) sys.exit sys exit 0 if k <= n:
    ans = ((n - k) + 1) / n
    upper = k - 1
else:
    ans = 0
    upper = n k <= n k n ans = ((n - k) + 1) / n ans ((n - k) + 1) / n (n - k) + 1 n - k n k 1 n upper = k - 1 upper k - 1 k 1 ans = 0 ans 0 upper = n upper n for i in range(1, upper + 1):
    tmp = 1 / n
    while i < k:
        tmp *= (1 / 2)
        i *= 2
    ans += tmp i range(1, upper + 1) range 1 upper + 1 upper 1 tmp = 1 / n tmp 1 / n 1 n while i < k:
        tmp *= (1 / 2)
        i *= 2
     i < k i k tmp *= (1 / 2) tmp 1 / 2 1 2 i *= 2 i 2 ans += tmp ans tmp print(ans) print ans upper = k - 1 k - 1 upper input = sys.stdin.readline sys.stdin.readline input ans = 0 0 ans k = map(int, input().split()) map(int, input().split()) k upper = n n upper tmp = 1 / n 1 / n tmp i *= 2 2 i tmp *= (1 / 2) 1 / 2 tmp ans = ((n - k) + 1) / n ((n - k) + 1) / n ans ans += tmp tmp ans n, k = map(int, input().split()) map(int, input().split()) n
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

if k == 1:
    print(1)
    sys.exit(0)

if k <= n:
    ans = ((n - k) + 1) / n
    upper = k - 1
else:
    ans = 0
    upper = n
for i in range(1, upper + 1):
    tmp = 1 / n
    while i < k:
        tmp *= (1 / 2)
        i *= 2
    ans += tmp
print(ans)
