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

cnt=0

kaku=0



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

    total=i

    while(total < K):

        cnt+=1

        total*=2

    

    kaku+=1/N * (1/2)**cnt

    cnt=0



print(kaku)
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()
N, K = list(map(int, input().split(" ")))
cnt = 0
kaku = 0
for i in range(1, N + 1):
    total = i
    while total < K:
        cnt += 1
        total *= 2
    kaku += 1 / N * (1 / 2) ** cnt
    cnt = 0
print(kaku)

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()

-N, K = list(map(int, input().split(" "))) -cnt = 0 -kaku = 0 -for i in range(1, N + 1): -    total = i -    while total < K: -        cnt += 1 -        total *= 2 -    kaku += 1 / N * (1 / 2) ** cnt -    cnt = 0 -print(kaku) +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()