import java.util.Scanner;

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    }

    static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

        return result;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    }

    static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    } 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 System.out.println(solve(N, K)) System.out.println System.out System System.out solve(N, K) solve N K sc.close() sc.close sc String[] args args static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

        return result;
    } solve {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

        return result;
    } double result = 0; result 0 for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        } int i = 1; int i = 1; i 1 i <= N i N ++i ++i i {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        } {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        } double p = 1.0 / N; p 1.0 / N 1.0 N int score = i; score i while (score < K) {
                p /= 2;
                score *= 2;
            } score < K score K {
                p /= 2;
                score *= 2;
            } p /= 2 p 2 score *= 2 score 2 result += p result p return result; result int N N int K K public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    }

    static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    }

    static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

        return result;
    }
} Main
import java.util.Scanner;

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));

        sc.close();
    }

    static double solve(int N, int K) {
        double result = 0;
        for (int i = 1; i <= N; ++i) {
            double p = 1.0 / N;
            int score = i;
            while (score < K) {
                p /= 2;
                score *= 2;
            }

            result += p;
        }

        return result;
    }
}