import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return 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() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def I(): return int(input()) I def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) LI 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 mod=10**9+7 mod 10**9+7 10**9 10 9 7 N,K=MI() N MI() MI K ans=0 ans 0 for i in range(1,N+1):
        temp=1/N
        score=i
        while score<K:
            score*=2
            temp/=2
        ans+=temp
        
     i range(1,N+1) range 1 N+1 N 1 temp=1/N temp 1/N 1 N score=i score i while score<K:
            score*=2
            temp/=2
         score<K score K score*=2 score 2 temp/=2 temp 2 ans+=temp ans temp print(ans) print ans main() main 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)
     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 def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def I(): return int(input()) def I(): return int(input()) I input = sys.stdin.readline sys.stdin.readline input
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return 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()
