import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double sum = 0.0;
        for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        }

        System.out.println(sum);

        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double sum = 0.0;
        for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        }

        System.out.println(sum);

        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double sum = 0.0;
        for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        }

        System.out.println(sum);

        return;
    } run {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double sum = 0.0;
        for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        }

        System.out.println(sum);

        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double sum = 0.0; sum 0.0 for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        } {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        } if (i >= K) {
                sum += 1.0 / N;
                continue;
            } i >= K i K {
                sum += 1.0 / N;
                continue;
            } sum += 1.0 / N sum 1.0 / N 1.0 N continue; int score = i; score i int ntos = 0; ntos 0 double p = 1.0 / N; p 1.0 / N 1.0 N while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            } score < K score K {
                score *= 2;
                ntos++;
                p /= 2;
            } score *= 2 score 2 ntos++ ntos p /= 2 p 2 sum += p sum p System.out.println(sum) System.out.println System.out System System.out sum return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        double sum = 0.0;
        for (int i = 1; i <= N; i++) {
            if (i >= K) {
                sum += 1.0 / N;
                continue;
            }
            int score = i;
            int ntos = 0;
            double p = 1.0 / N;
            while (score < K) {
                score *= 2;
                ntos++;
                p /= 2;
            }
            sum += p;
        }

        System.out.println(sum);

        return;
    }

}