import java.util.Scanner;

public class Main {

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

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    } main {
        final Scanner sc = new Scanner(System.in);

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final double N = sc.nextDouble(); N sc.nextDouble() sc.nextDouble sc final double K = sc.nextDouble(); K sc.nextDouble() sc.nextDouble sc double ans = 0; ans 0 for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        } {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        } double tmp = 1.0 / N; tmp 1.0 / N 1.0 N int now = i; now i while (now < K) {
                now *= 2;
                tmp /= 2;
            } now < K now K {
                now *= 2;
                tmp /= 2;
            } now *= 2 now 2 tmp /= 2 tmp 2 ans += tmp ans tmp 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) {
        final Scanner sc = new Scanner(System.in);

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    }
} public class Main {

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

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

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

        final double N = sc.nextDouble();
        final double K = sc.nextDouble();

        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double tmp = 1.0 / N;
            int now = i;
            while (now < K) {
                now *= 2;
                tmp /= 2;
            }
            ans += tmp;
        }

        System.out.println(ans);
    }
}
