import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  }
}

 import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc double K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double tmpK = K; tmpK K double sum = 0; sum 0 for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    } double i = 1 ; double i = 1 ; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    } {
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    } int count = 0; count 0 while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      } K>i K i {
        K = K/2;
        count++;
        // System.out.println(K);    
      } K = K/2 K K/2 K 2 count++ count sum = sum  + (1 / (double)N) * Math.pow(0.5,count) sum sum  + (1 / (double)N) * Math.pow(0.5,count) sum (1 / (double)N) * Math.pow(0.5,count) (1 / (double)N) 1 (double)N Math.pow(0.5,count) Math.pow Math 0.5 count K = tmpK K tmpK count = 0 count 0 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(); 
    double K = sc.nextInt();
    double tmpK = K;
    double sum = 0;
    for(double i = 1 ; i < N + 1; i++){
      int count = 0;
      while(K>i){
        K = K/2;
        count++;
        // System.out.println(K);    
      }
      // System.out.println("count::"+count); 
      // System.out.println(Math.pow(0.5,count)); 
      sum = sum  + (1 / (double)N) * Math.pow(0.5,count);
      // System.out.println(sum); 
      K = tmpK;
      count = 0;
      
    }
    System.out.println(sum);    
  
  }
}


