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



ans = 0

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

    p = 1 / n

    while i < k:

        p /= 2

        i *= 2

    ans += p

print(ans)

def main():

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



    np = 0

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

        p = 1

        while x < K:

            p *= 1 / 2

            x *= 2

        np += p



    ans = np / N



    print(ans)





if __name__ == '__main__':

    main()



# import sys

# input = sys.stdin.readline

# 

# sys.setrecursionlimit(10 ** 7)

# 

# (int(x)-1 for x in input().split())

# rstrip()

#

# def binary_search(*, ok, ng, func):

#     while abs(ok - ng) > 1:

#         mid = (ok + ng) // 2

#         if func(mid):

#             ok = mid

#         else:

#             ng = mid

#     return ok

n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    p = 1 / n
    while i < k:
        p /= 2
        i *= 2
    ans += p
print(ans)

def main():
    N, K = list(map(int, input().split()))
    np = 0
    for x in range(1, N + 1):
        p = 1
        while x < K:
            p *= 1 / 2
            x *= 2
        np += p
    ans = np / N
    print(ans)


if __name__ == "__main__":
    main()
# import sys
# input = sys.stdin.readline
#
# sys.setrecursionlimit(10 ** 7)
#
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

-n, k = list(map(int, input().split())) -ans = 0 -for i in range(1, n + 1): -    p = 1 / n -    while i < k: -        p /= 2 -        i *= 2 -    ans += p -print(ans) +def main(): +    N, K = list(map(int, input().split())) +    np = 0 +    for x in range(1, N + 1): +        p = 1 +        while x < K: +            p *= 1 / 2 +            x *= 2 +        np += p +    ans = np / N +    print(ans) + + +if __name__ == "__main__": +    main() +# import sys +# input = sys.stdin.readline +# +# sys.setrecursionlimit(10 ** 7) +# +# (int(x)-1 for x in input().split()) +# rstrip() +# +# def binary_search(*, ok, ng, func): +#     while abs(ok - ng) > 1: +#         mid = (ok + ng) // 2 +#         if func(mid): +#             ok = mid +#         else: +#             ng = mid +#     return ok