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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
} 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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
} 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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        double p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    } 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 p = Math.pow(n, -1); p Math.pow(n, -1) Math.pow Math n -1 1 double ans = 0; ans 0 for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        } {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        } if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            } i + 1 > k i + 1 i 1 k {
                ans += 1;
            } ans += 1 ans 1 {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            } double pow = Math.log(k / (i + 1.0)) / Math.log(2); pow Math.log(k / (i + 1.0)) / Math.log(2) Math.log(k / (i + 1.0)) Math.log Math k / (i + 1.0) k (i + 1.0) i 1.0 Math.log(2) Math.log Math 2 ans += Math.pow(0.5, Math.ceil(pow)) ans Math.pow(0.5, Math.ceil(pow)) Math.pow Math 0.5 Math.ceil(pow) Math.ceil Math pow System.out.println(ans * p) System.out.println System.out System System.out ans * p ans p 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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
} 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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
} 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 p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
}