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



ans = 0

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

    r = s

    i = 0

    while r < k:

        r = r*2

        i = i+1

    ans += (0.5**i)/n

print(ans)
def main():

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

    ans = 0

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

        c = 0

        while i<k:

            i = i*2

            c += 1

        ans += 1/n * (1/2)**c

    print(ans)



if __name__ == "__main__":

    main()

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

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


if __name__ == "__main__":
    main()

-n, k = list(map(int, input().split())) -ans = 0 -for s in range(1, n + 1): -    r = s -    i = 0 -    while r < k: -        r = r * 2 -        i = i + 1 -    ans += (0.5**i) / n -print(ans) +def main(): +    n, k = list(map(int, input().split())) +    ans = 0 +    for i in range(1, n + 1): +        c = 0 +        while i < k: +            i = i * 2 +            c += 1 +        ans += 1 / n * (1 / 2) ** c +    print(ans) + + +if __name__ == "__main__": +    main()