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();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    }
} 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();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        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 double ret = 0; ret 0 for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += 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;
            }
            ret += tmp;
        } {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += 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 ret += tmp ret tmp System.out.println(ret) System.out.println System.out System System.out ret sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    }
} 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();
        double ret = 0;
        for (int i = 1; i <= n; i++) {
            double tmp = 1.0 / n;
            int now = i;
            while (now < k) {
                now *= 2;
                tmp /= 2;
            }
            ret += tmp;
        }
        System.out.println(ret);
        sc.close();
    }
}