import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    } main {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc double sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        } {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        } long num = i; num i if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            } num < k num k {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } int cnt = 0; cnt 0 do {
                    num *= 2;
                    cnt++;
                } while (num < k); num < k num k {
                    num *= 2;
                    cnt++;
                } num *= 2 num 2 cnt++ cnt sum += 1 / (double) n * Math.pow(0.5, cnt) sum 1 / (double) n * Math.pow(0.5, cnt) 1 / (double) n 1 (double) n Math.pow(0.5, cnt) Math.pow Math 0.5 cnt {
                sum += 1 / (double) n;
            } sum += 1 / (double) n sum 1 / (double) n 1 (double) n sc.close() sc.close sc System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    }
} public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long k = sc.nextLong();

        double sum = 0;

        for (int i = 1; i <= n; i++) {
            long num = i;
            if (num < k) {
                int cnt = 0;
                do {
                    num *= 2;
                    cnt++;
                } while (num < k);
                sum += 1 / (double) n * Math.pow(0.5, cnt);
            } else {
                sum += 1 / (double) n;
            }
        }

        sc.close();

        System.out.println(sum);

    }
}