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

X = [0]*(n+1)

import math as ma

ans = 0

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

    temp = ma.ceil(ma.log2(k/i)) if k >  i else 0 

    ans += (1/n)*(0.5**temp)

print(ans)
from math import log2,ceil



def main():

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

    ans = 0

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

        digit = ceil(log2(K) - log2(i)) if K > i else 0

        ans += (1/N)*(0.5**digit) 

    print(ans)

    return



if __name__ == "__main__":

    main()
n, k = list(map(int, input().split()))
X = [0] * (n + 1)
import math as ma

ans = 0
for i in range(1, n + 1):
    temp = ma.ceil(ma.log2(k / i)) if k > i else 0
    ans += (1 / n) * (0.5**temp)
print(ans)

from math import log2, ceil


def main():
    N, K = list(map(int, input().split()))
    ans = 0
    for i in range(1, N + 1):
        digit = ceil(log2(K) - log2(i)) if K > i else 0
        ans += (1 / N) * (0.5**digit)
    print(ans)
    return


if __name__ == "__main__":
    main()

-n, k = list(map(int, input().split())) -X = [0] * (n + 1) -import math as ma +from math import log2, ceil -ans = 0 -for i in range(1, n + 1): -    temp = ma.ceil(ma.log2(k / i)) if k > i else 0 -    ans += (1 / n) * (0.5**temp) -print(ans) + +def main(): +    N, K = list(map(int, input().split())) +    ans = 0 +    for i in range(1, N + 1): +        digit = ceil(log2(K) - log2(i)) if K > i else 0 +        ans += (1 / N) * (0.5**digit) +    print(ans) +    return + + +if __name__ == "__main__": +    main()