import math
N, K = map(int, input().split())

ans = 0
for r in range(1, min(K, N+1)):
    x = math.ceil( math.log2(K/r))
    ans += pow(0.5, x) / N
    # print(x, pow(0.5, x) / N)
if K <= N:
    ans += (N - K + 1) / N
print(ans) import math math N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans = 0 ans 0 for r in range(1, min(K, N+1)):
    x = math.ceil( math.log2(K/r))
    ans += pow(0.5, x) / N
    # print(x, pow(0.5, x) / N) r range(1, min(K, N+1)) range 1 min(K, N+1) min K N+1 N 1 x = math.ceil( math.log2(K/r)) x math.ceil( math.log2(K/r)) math.ceil math ceil math.log2(K/r) math.log2 math log2 K/r K r ans += pow(0.5, x) / N ans pow(0.5, x) / N pow(0.5, x) pow 0.5 x N if K <= N:
    ans += (N - K + 1) / N K <= N K N ans += (N - K + 1) / N ans (N - K + 1) / N N - K + 1 N - K N K 1 N print(ans) print ans ans += pow(0.5, x) / N pow(0.5, x) / N ans x = math.ceil( math.log2(K/r)) math.ceil( math.log2(K/r)) x ans += (N - K + 1) / N (N - K + 1) / N ans N, K = map(int, input().split()) map(int, input().split()) N ans = 0 0 ans K = map(int, input().split()) map(int, input().split()) K
import math
N, K = map(int, input().split())

ans = 0
for r in range(1, min(K, N+1)):
    x = math.ceil( math.log2(K/r))
    ans += pow(0.5, x) / N
    # print(x, pow(0.5, x) / N)
if K <= N:
    ans += (N - K + 1) / N
print(ans)
