#import math
#import itertools
#from collections import deque

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n,k=INTM()
    ans=0
    for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
    print(ans)


if __name__=='__main__':
    do() INT = lambda: int(input()) INT lambda: int(input()) int(input()) int input() input INTM = lambda: map(int,input().split()) INTM lambda: map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split STRM = lambda: map(str,input().split()) STRM lambda: map(str,input().split()) map(str,input().split()) map str input().split() ().split () input split STR = lambda: str(input()) STR lambda: str(input()) str(input()) str input() input LIST = lambda: list(map(int,input().split())) LIST lambda: list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split LISTS = lambda: list(map(str,input().split())) LISTS lambda: list(map(str,input().split())) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split def do():
    n,k=INTM()
    ans=0
    for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
    print(ans) do n,k=INTM() n INTM() INTM k ans=0 ans 0 for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
     i range(1,n+1) range 1 n+1 n 1 temp=i temp i ct=0 ct 0 while temp<k:
            ct+=1
            temp*=2
         temp<k temp k ct+=1 ct 1 temp*=2 temp 2 ans+=(1/(n*(2**ct))) ans 1/(n*(2**ct)) 1 n*(2**ct) n 2**ct 2 ct print(ans) print ans if __name__=='__main__':
    do() __name__=='__main__' __name__ '__main__' do() do STRM = lambda: map(str,input().split()) lambda: map(str,input().split()) STRM LISTS = lambda: list(map(str,input().split())) lambda: list(map(str,input().split())) LISTS INT = lambda: int(input()) lambda: int(input()) INT def do():
    n,k=INTM()
    ans=0
    for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
    print(ans) def do():
    n,k=INTM()
    ans=0
    for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
    print(ans) do LIST = lambda: list(map(int,input().split())) lambda: list(map(int,input().split())) LIST INTM = lambda: map(int,input().split()) lambda: map(int,input().split()) INTM STR = lambda: str(input()) lambda: str(input()) STR
#import math
#import itertools
#from collections import deque

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n,k=INTM()
    ans=0
    for i in range(1,n+1):
        temp=i
        ct=0
        while temp<k:
            ct+=1
            temp*=2
        ans+=(1/(n*(2**ct)))
    
    print(ans)


if __name__=='__main__':
    do()