def myAnswer(N:int,K:int) -> int:

   ans = 0

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

      sub = K - n

      counter = 0

      total = n

      if(total >= K):

         ans += 1/N

         continue

      while True:

         total *= 2

         counter += 1

         if(total >= K):

            break

      ans += 1/N * (1/2)**counter

   return ans



def modelAnswer():

   return

def main():

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

   print((myAnswer(N,K)))

if __name__ == '__main__':

   main()
def myAnswer(N:int,K:int) -> int:

   ans = 0

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

      total = n

      if(total >= K):

         ans += 1/N

      else:

         counter = 0

         while True:

            total *= 2

            counter += 1

            if(total >= K):

               break

         ans += 1/N * (1/2)**counter

   return ans



def modelAnswer():

   return

def main():

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

   print((myAnswer(N,K)))

if __name__ == '__main__':

   main()
def myAnswer(N: int, K: int) -> int:
    ans = 0
    for n in range(1, N + 1):
        sub = K - n
        counter = 0
        total = n
        if total >= K:
            ans += 1 / N
            continue
        while True:
            total *= 2
            counter += 1
            if total >= K:
                break
        ans += 1 / N * (1 / 2) ** counter
    return ans


def modelAnswer():
    return


def main():
    N, K = list(map(int, input().split()))
    print((myAnswer(N, K)))


if __name__ == "__main__":
    main()

def myAnswer(N: int, K: int) -> int:
    ans = 0
    for n in range(1, N + 1):
        total = n
        if total >= K:
            ans += 1 / N
        else:
            counter = 0
            while True:
                total *= 2
                counter += 1
                if total >= K:
                    break
            ans += 1 / N * (1 / 2) ** counter
    return ans


def modelAnswer():
    return


def main():
    N, K = list(map(int, input().split()))
    print((myAnswer(N, K)))


if __name__ == "__main__":
    main()

-        sub = K - n -        counter = 0 -            continue -        while True: -            total *= 2 -            counter += 1 -            if total >= K: -                break -        ans += 1 / N * (1 / 2) ** counter +        else: +            counter = 0 +            while True: +                total *= 2 +                counter += 1 +                if total >= K: +                    break +            ans += 1 / N * (1 / 2) ** counter