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 prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    }


    static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    }

} 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 prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    }


    static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    } 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 prob=0; prob 0 for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        } {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        } if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            } i < K i K {
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            } int times = log((double)K/i,2 ); times log((double)K/i,2 ) log (double)K/i (double)K i 2 prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) prob (double) 1/N * Math.pow((double) 0.5 ,times ) (double) 1/N (double) 1 N Math.pow((double) 0.5 ,times ) Math.pow Math (double) 0.5 times {
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            } prob+= (double) 1/(double)N prob (double) 1/(double)N (double) 1 (double)N System.out.println(prob) System.out.println System.out System System.out prob String[] args args static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    } log {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    } return (int) Math.ceil (Math.log(x) / Math.log(base)); (int) Math.ceil (Math.log(x) / Math.log(base)) Math.ceil Math Math.log(x) / Math.log(base) Math.log(x) Math.log Math x Math.log(base) Math.log Math base double x x int base base public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    }


    static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    }


    static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    }

} 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 prob=0;
//        for (int i = 1; i <= Math.min(K,N); i++) {1
        for (int i = 1; i <= N; i++) {
            if(i < K ){
                int times = log((double)K/i,2 );
//                System.out.println(i+" "+ log(K/i,2 ) +" "+ Math.max(log((double) K/i,2 ),0) +" "+ times);
                prob+= (double) 1/N * Math.pow((double) 0.5 ,times ) ;
            }else{
  //              System.out.println(i+" "+ 0 );
                prob+= (double) 1/(double)N;
            }
        }
        System.out.println(prob);
    }


    static int log(double x, int base)
    {
        return (int) Math.ceil (Math.log(x) / Math.log(base));
    }

}