import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    } main {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc sc.close() sc.close sc double winRatio = 0; winRatio 0 for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        } {
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        } int x = i; x i double m = 1; m 1 while(x < k) {
                x*=2;
                m*=2;
            } x < k x k {
                x*=2;
                m*=2;
            } x*=2 x 2 m*=2 m 2 winRatio += (1d / n) / m winRatio (1d / n) / m (1d / n) 1d n m System.out.println(winRatio) System.out.println System.out System System.out winRatio String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        int k = sc.nextInt();
        sc.close();
        
        double winRatio = 0;
        for(int i = 1; i <= n; i++){
            int x = i;
            double m = 1;
            while(x < k) {
                x*=2;
                m*=2;
            }
            winRatio += (1d / n) / m;
        }
        System.out.println(winRatio);
    }
}
