import java.util.*;

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());
        sc.close();
        double sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        }
        sum /= n;
        System.out.println(sum);
    }
} import java.util.*; util.* java 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());
        sc.close();
        double sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        }
        sum /= n;
        System.out.println(sum);
    }
} 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());
        sc.close();
        double sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        }
        sum /= n;
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();
        double sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        }
        sum /= n;
        System.out.println(sum);
    } 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 sc.close() sc.close sc double sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        } {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        } if (i >= k) {
                sum += 1;
                continue;
            } i >= k i k {
                sum += 1;
                continue;
            } sum += 1 sum 1 continue; int cnt = 1; cnt 1 while (k > i * Math.pow(2, cnt)) {
                cnt++;
            } k > i * Math.pow(2, cnt) k i * Math.pow(2, cnt) i Math.pow(2, cnt) Math.pow Math 2 cnt {
                cnt++;
            } cnt++ cnt sum += Math.pow(0.5, cnt) sum Math.pow(0.5, cnt) Math.pow Math 0.5 cnt sum /= n sum n System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;

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());
        sc.close();
        double sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                sum += 1;
                continue;
            }
            int cnt = 1;
            while (k > i * Math.pow(2, cnt)) {
                cnt++;
            }
            sum += Math.pow(0.5, cnt);
        }
        sum /= n;
        System.out.println(sum);
    }
}