import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        double result = 0.0000000000;
        int j = 1;
        for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        }
        System.out.println(String.format("%.11f", result));
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        double result = 0.0000000000;
        int j = 1;
        for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        }
        System.out.println(String.format("%.11f", result));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        double result = 0.0000000000;
        int j = 1;
        for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        }
        System.out.println(String.format("%.11f", result));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        double result = 0.0000000000;
        int j = 1;
        for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        }
        System.out.println(String.format("%.11f", result));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc double result = 0.0000000000; result 0.0000000000 int j = 1; j 1 for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        } int i = n; int i = n; i n i > 0 i 0 i-- i-- i {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        } {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        } int point = (int) (i * Math.pow(2, j - 1)); point (int) (i * Math.pow(2, j - 1)) i Math.pow(2, j - 1) Math.pow Math 2 j - 1 j 1 while (point < k) {
                point *= 2;
                j++;
            } point < k point k {
                point *= 2;
                j++;
            } point *= 2 point 2 j++ j result += Math.pow(0.5, j - 1) / n result Math.pow(0.5, j - 1) / n Math.pow(0.5, j - 1) Math.pow Math 0.5 j - 1 j 1 n System.out.println(String.format("%.11f", result)) System.out.println System.out System System.out String.format("%.11f", result) String.format String "%.11f" result String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        double result = 0.0000000000;
        int j = 1;
        for (int i = n; i > 0; i--) {
            int point = (int) (i * Math.pow(2, j - 1));
            while (point < k) {
                point *= 2;
                j++;
            }
            result += Math.pow(0.5, j - 1) / n;
        }
        System.out.println(String.format("%.11f", result));
    }
}