import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 }
} import java.util.Scanner; Scanner java.util public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 }
} Main public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 } main {
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double ans =0.0; ans 0.0 for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     } int i =1; int i =1; i 1 i<=N i N i++ i++ i {
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     } {
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     } if(i>=K){
         ans +=  1/(double)N;
       } i>=K i K {
         ans +=  1/(double)N;
       } ans +=  1/(double)N ans 1/(double)N 1 (double)N if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       } i<K i K {
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       } double j=1.0; j 1.0 int num = i; num i while(num<K){
           j /=2;
           num = 2*num;
         } num<K num K {
           j /=2;
           num = 2*num;
         } j /=2 j 2 num = 2*num num 2*num 2 num ans += (1/(double)N)*j ans (1/(double)N)*j (1/(double)N) 1 (double)N j System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 }
} public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 }
} Main
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int K = sc.nextInt();
   double ans =0.0;
     for(int i =1;i<=N;i++){
       if(i>=K){
         ans +=  1/(double)N;
       }
       if(i<K){
         double j=1.0;
         int num = i;
         while(num<K){
           j /=2;
           num = 2*num;
         }
   	  ans += (1/(double)N)*j;
       }
     }
     System.out.println(ans);
 }
}