

def bisect(bi, x, target, left, right):

    if left + 1 == right:

        return right

    half = (right + left) // 2

    if bi[half] * x < target:

        half = bisect(bi, x, target, half, right)

    else:

        half = bisect(bi, x, target, left, half)

    return half

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

bi = []

i = 1

while i <= 10**5:

    bi.append(i)

    i *= 2

bi.append(i)



ans = 0

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

    if i >= K:

        ans += 1

    else:

        j = bisect(bi, i, K, 0, len(bi))

        ans += 0.5**j

print(('{:.10f}'.format(ans / N)))
N,K = list(map(int, input().split()))

bi = []

i = 1

j = 0

while i < K:

    bi.append(i)

    i *= 2

    j += 1

bi.append(i)

ans = max(0,N-K+1)

ite = min(N+1,K)



for i in range(1,ite):

    # print(i,j, bi[j-1] * i)

    if j > 0 and bi[j-1] * i >= K:

        j -= 1

    #print(i, j, i*bi[j])

    ans += 0.5**j

print(('{:.10f}'.format(ans / N)))
def bisect(bi, x, target, left, right):
    if left + 1 == right:
        return right
    half = (right + left) // 2
    if bi[half] * x < target:
        half = bisect(bi, x, target, half, right)
    else:
        half = bisect(bi, x, target, left, half)
    return half


N, K = list(map(int, input().split()))
bi = []
i = 1
while i <= 10**5:
    bi.append(i)
    i *= 2
bi.append(i)
ans = 0
for i in range(1, N + 1):
    if i >= K:
        ans += 1
    else:
        j = bisect(bi, i, K, 0, len(bi))
        ans += 0.5**j
print(("{:.10f}".format(ans / N)))

N, K = list(map(int, input().split()))
bi = []
i = 1
j = 0
while i < K:
    bi.append(i)
    i *= 2
    j += 1
bi.append(i)
ans = max(0, N - K + 1)
ite = min(N + 1, K)
for i in range(1, ite):
    # print(i,j, bi[j-1] * i)
    if j > 0 and bi[j - 1] * i >= K:
        j -= 1
    # print(i, j, i*bi[j])
    ans += 0.5**j
print(("{:.10f}".format(ans / N)))

-def bisect(bi, x, target, left, right): -    if left + 1 == right: -        return right -    half = (right + left) // 2 -    if bi[half] * x < target: -        half = bisect(bi, x, target, half, right) -    else: -        half = bisect(bi, x, target, left, half) -    return half - - -while i <= 10**5: +j = 0 +while i < K: +    j += 1 -ans = 0 -for i in range(1, N + 1): -    if i >= K: -        ans += 1 -    else: -        j = bisect(bi, i, K, 0, len(bi)) -        ans += 0.5**j +ans = max(0, N - K + 1) +ite = min(N + 1, K) +for i in range(1, ite): +    # print(i,j, bi[j-1] * i) +    if j > 0 and bi[j - 1] * i >= K: +        j -= 1 +    # print(i, j, i*bi[j]) +    ans += 0.5**j