import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    } main {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    } Scanner std = new Scanner(System.in); std new Scanner(System.in) int n = std.nextInt(); n std.nextInt() std.nextInt std int k = std.nextInt(); k std.nextInt() std.nextInt std double ans = 0; ans 0 for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        } {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        } int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0); count (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0) Math.max Math Math.ceil(Math.log10((double) k / i) / Math.log10(2)) Math.ceil Math Math.log10((double) k / i) / Math.log10(2) Math.log10((double) k / i) Math.log10 Math (double) k / i (double) k i Math.log10(2) Math.log10 Math 2 0 double val = Math.pow(0.5, count) / n; val Math.pow(0.5, count) / n Math.pow(0.5, count) Math.pow Math 0.5 count n ans += val ans val 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 std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int k = std.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int count = (int) Math.max(Math.ceil(Math.log10((double) k / i) / Math.log10(2)), 0);
            double val = Math.pow(0.5, count) / n;
            ans += val;
        }
        
        System.out.println(ans);
    }
}
