import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double N = sc.nextInt();
        double K = sc.nextInt();
        double tmp = 0.0;
        double kakuritu = 0.0;

        for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        }
        System.out.println(kakuritu);
}
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double N = sc.nextInt();
        double K = sc.nextInt();
        double tmp = 0.0;
        double kakuritu = 0.0;

        for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        }
        System.out.println(kakuritu);
}
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double N = sc.nextInt();
        double K = sc.nextInt();
        double tmp = 0.0;
        double kakuritu = 0.0;

        for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        }
        System.out.println(kakuritu);
} main {
        Scanner sc = new Scanner(System.in);
        double N = sc.nextInt();
        double K = sc.nextInt();
        double tmp = 0.0;
        double kakuritu = 0.0;

        for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        }
        System.out.println(kakuritu);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double N = sc.nextInt(); N sc.nextInt() sc.nextInt sc double K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double tmp = 0.0; tmp 0.0 double kakuritu = 0.0; kakuritu 0.0 for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        } {
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        } for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          } int j = 0; int j = 0; j 0 j < 1000000 j 1000000 j++ j++ j {
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          } {
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          } if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            } ((i+1) * Math.pow(2.0,j)) >= K ((i+1) * Math.pow(2.0,j)) (i+1) i 1 Math.pow(2.0,j) Math.pow Math 2.0 j K {
              tmp = Math.pow(0.5,j) / N;
              break;
            } tmp = Math.pow(0.5,j) / N tmp Math.pow(0.5,j) / N Math.pow(0.5,j) Math.pow Math 0.5 j N break; kakuritu += tmp kakuritu tmp System.out.println(kakuritu) System.out.println System.out System System.out kakuritu String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double N = sc.nextInt();
        double K = sc.nextInt();
        double tmp = 0.0;
        double kakuritu = 0.0;

        for(int i = 0; i < N; i++){
          for(int j = 0; j < 1000000 ; j++ ){
            if (((i+1) * Math.pow(2.0,j)) >= K){
              tmp = Math.pow(0.5,j) / N;
              break;
            }

          }
          kakuritu += tmp;
          //kakuritu = kakuritu / N;
        }
        System.out.println(kakuritu);
}
}
