import math



def main():

  pos=0

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

  nmen=1/n



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

    ajs=(-(-math.log2(k/i)//1))

    if ajs<=0: ajs=0

    pos+=nmen*0.5**ajs

  #  print(ajs)

  print(pos)

  

if __name__ == "__main__":

  main()

    

import math

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

p=0

for i in range(n):

    g=k/(i+1)

    if i>=k:

        p+=1/n

        continue

    x=-(-math.log2(g)//1)

    p+=1/n*((0.5)**x)

print(p)
import math


def main():
    pos = 0
    n, k = list(map(int, input().split()))
    nmen = 1 / n
    for i in range(1, n + 1):
        ajs = -(-math.log2(k / i) // 1)
        if ajs <= 0:
            ajs = 0
        pos += nmen * 0.5**ajs
    #  print(ajs)
    print(pos)


if __name__ == "__main__":
    main()

import math

n, k = list(map(int, input().split()))
p = 0
for i in range(n):
    g = k / (i + 1)
    if i >= k:
        p += 1 / n
        continue
    x = -(-math.log2(g) // 1)
    p += 1 / n * ((0.5) ** x)
print(p)

- -def main(): -    pos = 0 -    n, k = list(map(int, input().split())) -    nmen = 1 / n -    for i in range(1, n + 1): -        ajs = -(-math.log2(k / i) // 1) -        if ajs <= 0: -            ajs = 0 -        pos += nmen * 0.5**ajs -    #  print(ajs) -    print(pos) - - -if __name__ == "__main__": -    main() +n, k = list(map(int, input().split())) +p = 0 +for i in range(n): +    g = k / (i + 1) +    if i >= k: +        p += 1 / n +        continue +    x = -(-math.log2(g) // 1) +    p += 1 / n * ((0.5) ** x) +print(p)