import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        } solve {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        } long n = Integer.parseInt(in.next()); n Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in long k = Integer.parseInt(in.next()); k Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in double ans = 0.0; ans 0.0 for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            } long i = 1; long i = 1; i 1 i <= n i n i++ i++ i {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            } {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            } double tmp = 1.0; tmp 1.0 long nn = i; nn i while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                } nn < k nn k {
                    nn *= 2;
                    tmp /= 2.0;
                } nn *= 2 nn 2 tmp /= 2.0 tmp 2.0 ans += tmp ans tmp ans /= n ans n out.printf("%.12f\n", ans) out.printf out "%.12f\n" ans int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long n = Integer.parseInt(in.next());
            long k = Integer.parseInt(in.next());
            double ans = 0.0;

            for (long i = 1; i <= n; i++) {
                double tmp = 1.0;
                long nn = i;
                while (nn < k) {
                    nn *= 2;
                    tmp /= 2.0;
                }
                ans += tmp;
            }
            ans /= n;

            // 出力
            out.printf("%.12f\n", ans);

        }

    }
}

