import math                                                                                                                                                         
                                                                                                                                                                    
def ci(n,k):                                                                                                                                                        
    #p ci>k                                                                                                                                                         
    a = n-k+1                                                                                                                                                       
    if(a<0):                                                                                                                                                        
        return 0                                                                                                                                                    
    else:                                                                                                                                                           
        return float(a/n)                                                                                                                                           
                                                                                                                                                                    
def coin(n,k):                                                                                                                                                      
    a = k/n                                                                                                                                                         
    if(a<1):                                                                                                                                                        
        return 0                                                                                                                                                    
    else:                                                                                                                                                           
        m = math.log(a)/math.log(2)                                                                                                                                 
        #print(m)                                                                                                                                                   
        #print(int(m)+1)                                                                                                                                            
        return(int(math.ceil(m)))                                                                                                                                   
                                                                                                                                                                    
def p_coin(n):                                                                                                                                                      
    return math.pow(0.5, n)                                                                                                                                         
                                                                                                                                                                    
def sumP3(n,k):                                                                                                                                                     
    a = 0                                                                                                                                                           
    for i in range(1, k):                                                                                                                                           
        if i>n :                                                                                                                                                    
            break                                                                                                                                                   
        #print(i,k)                                                                                                                                                 
        #print(p_coin(coin(i,k)))                                                                                                                                   
        a = a + (1/N[0])*p_coin(coin(i,k))                                                                                                                          
    return a                                                                                                                                                        
                                                                                                                                                                    
N = input().split()                                                                                                                                                 
N = [int(i) for i in N]                                                                                                                                             
#print(N)                                                                                                                                                           
#print(ci(N[0], N[1]))                                                                                                                                              
p1 = ci(N[0], N[1])                                                                                                                                                 
p2 = 1-p1                                                                                                                                                           
p3 = sumP3(N[0], N[1])                                                                                                                                              
print('{:.10g}'.format(p1+p3))     

Measured memory_bytes: 3064