import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

        System.out.println(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 = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

        System.out.println(result);
    }
} Main public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

        System.out.println(result);
    } main {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double result = 0; result 0 if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        } n < k n k {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } int count = 0; count 0 int num = i; num i while (num < k) {
                    num *= 2;
                    count++;
                } num < k num k {
                    num *= 2;
                    count++;
                } num *= 2 num 2 count++ count result += 1.0 / (Math.pow(2, count)) result 1.0 / (Math.pow(2, count)) 1.0 (Math.pow(2, count)) Math.pow Math 2 count result /= n result n {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        } for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } int i = 1; int i = 1; i 1 i < k i k i++ i++ i {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            } int count = 0; count 0 int num = i; num i while (num < k) {
                    num *= 2;
                    count++;
                } num < k num k {
                    num *= 2;
                    count++;
                } num *= 2 num 2 count++ count result += 1.0 / (Math.pow(2, count)) result 1.0 / (Math.pow(2, count)) 1.0 (Math.pow(2, count)) Math.pow Math 2 count result /= n result n int win = n - k + 1; win n - k + 1 n - k n k 1 result += 1.0 * win / n result 1.0 * win / n 1.0 * win 1.0 win n System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

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

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

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

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());

        double result = 0;
        if (n < k) {
            for (int i = 1; i <= n; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
        } else {
            for (int i = 1; i < k; i++) {
                int count = 0;
                int num = i;
                while (num < k) {
                    num *= 2;
                    count++;
                }
                result += 1.0 / (Math.pow(2, count));
            }
            result /= n;
            int win = n - k + 1;
            result += 1.0 * win / n;
        }

        System.out.println(result);
    }
}