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

m = n

l = n

res = 0

cnt = 0

tmp = m

while m < k:

    m *= 2

    cnt += 1

res += (1/n)*(0.5)**cnt

for i in range(1,n):

    cnt = 0

    l = n

    l -= i

    cnt = 0

    while l < k:

        l *= 2

        cnt += 1

    res += (1/n)*(0.5)**cnt

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

res = 0

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

    prob = 1/N

    while i < K:

        i *= 2

        prob *= 0.5

    res += prob

print(res)



n, k = list(map(int, input().split()))
m = n
l = n
res = 0
cnt = 0
tmp = m
while m < k:
    m *= 2
    cnt += 1
res += (1 / n) * (0.5) ** cnt
for i in range(1, n):
    cnt = 0
    l = n
    l -= i
    cnt = 0
    while l < k:
        l *= 2
        cnt += 1
    res += (1 / n) * (0.5) ** cnt
print(res)

N, K = list(map(int, input().split()))
res = 0
for i in range(1, N + 1):
    prob = 1 / N
    while i < K:
        i *= 2
        prob *= 0.5
    res += prob
print(res)

-n, k = list(map(int, input().split())) -m = n -l = n +N, K = list(map(int, input().split())) -cnt = 0 -tmp = m -while m < k: -    m *= 2 -    cnt += 1 -res += (1 / n) * (0.5) ** cnt -for i in range(1, n): -    cnt = 0 -    l = n -    l -= i -    cnt = 0 -    while l < k: -        l *= 2 -        cnt += 1 -    res += (1 / n) * (0.5) ** cnt +for i in range(1, N + 1): +    prob = 1 / N +    while i < K: +        i *= 2 +        prob *= 0.5 +    res += prob