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



ans=0

n=20

p=[1]*n

for i in range(n-1):

    p[i+1]=p[i]*2



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

    temp=0

    for j in range(n):

        if i*p[j]>=K:

            temp=j

            break

    ans+=1/N/p[temp]

    

print(ans)
import sys

input = sys.stdin.readline



def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N,K=MI()

    ans=0

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

        temp=1/N

        score=i

        while score<K:

            score*=2

            temp/=2

        ans+=temp

        

    print(ans)

    



main()

N, K = list(map(int, input().split()))
ans = 0
n = 20
p = [1] * n
for i in range(n - 1):
    p[i + 1] = p[i] * 2
for i in range(1, N + 1):
    temp = 0
    for j in range(n):
        if i * p[j] >= K:
            temp = j
            break
    ans += 1 / N / p[temp]
print(ans)

import sys

input = sys.stdin.readline


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N, K = MI()
    ans = 0
    for i in range(1, N + 1):
        temp = 1 / N
        score = i
        while score < K:
            score *= 2
            temp /= 2
        ans += temp
    print(ans)


main()

-N, K = list(map(int, input().split())) -ans = 0 -n = 20 -p = [1] * n -for i in range(n - 1): -    p[i + 1] = p[i] * 2 -for i in range(1, N + 1): -    temp = 0 -    for j in range(n): -        if i * p[j] >= K: -            temp = j -            break -    ans += 1 / N / p[temp] -print(ans) +import sys + +input = sys.stdin.readline + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N, K = MI() +    ans = 0 +    for i in range(1, N + 1): +        temp = 1 / N +        score = i +        while score < K: +            score *= 2 +            temp /= 2 +        ans += temp +    print(ans) + + +main()