import math



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



count = 0

now = K



while now > N :

    count += 1

    now = now / 2.



prob = 0



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

    if i < now :

        for k in range(N) :

            if i * 2**k >= now :

                break

        prob += 2**(-(count + k )) / N

    else :

        prob += 2**(-count) / N



print(prob)

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



ans = 0

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

    if i >= K:

        ans += 1

    else:

        cnt = 0

        while i < K:

            i *= 2

            cnt += 1

        ans += pow(2, -cnt)

print((ans / N))

import math

N, K = list(map(int, input().split()))
count = 0
now = K
while now > N:
    count += 1
    now = now / 2.0
prob = 0
for i in range(1, N + 1):
    if i < now:
        for k in range(N):
            if i * 2**k >= now:
                break
        prob += 2 ** (-(count + k)) / N
    else:
        prob += 2 ** (-count) / N
print(prob)

N, K = list(map(int, input().split()))
ans = 0
for i in range(1, N + 1):
    if i >= K:
        ans += 1
    else:
        cnt = 0
        while i < K:
            i *= 2
            cnt += 1
        ans += pow(2, -cnt)
print((ans / N))

-import math - -count = 0 -now = K -while now > N: -    count += 1 -    now = now / 2.0 -prob = 0 +ans = 0 -    if i < now: -        for k in range(N): -            if i * 2**k >= now: -                break -        prob += 2 ** (-(count + k)) / N +    if i >= K: +        ans += 1 -        prob += 2 ** (-count) / N -print(prob) +        cnt = 0 +        while i < K: +            i *= 2 +            cnt += 1 +        ans += pow(2, -cnt) +print((ans / N))