import 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();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      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();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      System.out.println(ans);
    } main {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      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 int t=0; t 0 double ans = 0; ans 0 for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        } int i=n ; int i=n ; i n i>0 i 0 i-- i-- i {
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        } {
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        } while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          } (double)k > Math.pow(2,t)*(double)i (double)k Math.pow(2,t)*(double)i Math.pow(2,t) Math.pow Math 2 t (double)i {
          t++;
          } t++ t ans += 1.0/((double)n*Math.pow(2,t)) ans 1.0/((double)n*Math.pow(2,t)) 1.0 ((double)n*Math.pow(2,t)) (double)n Math.pow(2,t) Math.pow Math 2 t 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();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      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();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      System.out.println(ans);
    }
} Main
import 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();
        int t=0;
        double ans = 0;
        for(int i=n ; i>0 ; i--){
          while((double)k > Math.pow(2,t)*(double)i ){
          t++;
          }
          //System.out.println(i+" "+t);
          ans += 1.0/((double)n*Math.pow(2,t));
        }
      System.out.println(ans);
    }
}