from math import ceil,pow,log2



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



ans = 0



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

    coin = 0;

    if i < k:

        coin = ceil(log2(k/i))

    else:

        ans += 1.0 / n

        continue

    ans += 1.0 / n / pow(2.0,coin)



print(ans)
import math



def main():

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



    ans = 0.0



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

        p = 1 / n

        while i < k:

            i *= 2

            p /= 2

        ans += p

    print(("{:.10f}".format(ans)))



if __name__ == "__main__":

    main()

from math import ceil, pow, log2

n, k = list(map(int, (input().split())))
ans = 0
for i in range(1, n + 1):
    coin = 0
    if i < k:
        coin = ceil(log2(k / i))
    else:
        ans += 1.0 / n
        continue
    ans += 1.0 / n / pow(2.0, coin)
print(ans)

import math


def main():
    n, k = list(map(int, input().split()))
    ans = 0.0
    for i in range(1, n + 1):
        p = 1 / n
        while i < k:
            i *= 2
            p /= 2
        ans += p
    print(("{:.10f}".format(ans)))


if __name__ == "__main__":
    main()

-from math import ceil, pow, log2 +import math -n, k = list(map(int, (input().split()))) -ans = 0 -for i in range(1, n + 1): -    coin = 0 -    if i < k: -        coin = ceil(log2(k / i)) -    else: -        ans += 1.0 / n -        continue -    ans += 1.0 / n / pow(2.0, coin) -print(ans) + +def main(): +    n, k = list(map(int, input().split())) +    ans = 0.0 +    for i in range(1, n + 1): +        p = 1 / n +        while i < k: +            i *= 2 +            p /= 2 +        ans += p +    print(("{:.10f}".format(ans))) + + +if __name__ == "__main__": +    main()