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();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    }
} 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();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    }
} Main public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    } main {
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    } 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 n0 = (double) 1/n; n0 (double) 1/n (double) 1 n double count = 0; count 0 int point = 0; point 0 double per = 0; per 0 for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      } {
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      } point = i point i while(point < k){
        	count++;
            point = point*2;
        } point < k point k {
        	count++;
            point = point*2;
        } count++ count point = point*2 point point*2 point 2 per += n0*Math.pow(0.5,count) per n0*Math.pow(0.5,count) n0 Math.pow(0.5,count) Math.pow Math 0.5 count count = 0 count 0 System.out.println(per) System.out.println System.out System System.out per 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 n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    }
} 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();
      double n0 = (double) 1/n;
      double count = 0;
      int point = 0;
      double per = 0;
      for(int i = 1;i <= n;i++){
        point = i;
      	while(point < k){
        	count++;
            point = point*2;
        }
        per += n0*Math.pow(0.5,count);
        count = 0;
      }
      System.out.println(per);
    }
}