from math import ceil, log2
n, k = map(int, input().split())
p = 1 / n
res = max(0, p*(n-k+1))
for i in range(1, min(n+1, k)):
    res += p*(0.5**ceil(log2(k/i)))
print(res) from math import ceil, log2 n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k p = 1 / n p 1 / n 1 n res = max(0, p*(n-k+1)) res max(0, p*(n-k+1)) max 0 p*(n-k+1) p n-k+1 n-k n k 1 for i in range(1, min(n+1, k)):
    res += p*(0.5**ceil(log2(k/i))) i range(1, min(n+1, k)) range 1 min(n+1, k) min n+1 n 1 k res += p*(0.5**ceil(log2(k/i))) res p*(0.5**ceil(log2(k/i))) p 0.5**ceil(log2(k/i)) 0.5 ceil(log2(k/i)) ceil log2(k/i) log2 k/i k i print(res) print res res += p*(0.5**ceil(log2(k/i))) p*(0.5**ceil(log2(k/i))) res k = map(int, input().split()) map(int, input().split()) k p = 1 / n 1 / n p n, k = map(int, input().split()) map(int, input().split()) n res = max(0, p*(n-k+1)) max(0, p*(n-k+1)) res
from math import ceil, log2
n, k = map(int, input().split())
p = 1 / n
res = max(0, p*(n-k+1))
for i in range(1, min(n+1, k)):
    res += p*(0.5**ceil(log2(k/i)))
print(res)