import 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 ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    } 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 ans = 0; ans 0 for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        } {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        } int x = i; x i int count = 0; count 0 while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            } true {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            } if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                } x < k x k {
                    x = x << 1;
                    count++;
                } x = x << 1 x x << 1 x 1 count++ count {
                    break;
                } break; ans += Math.pow(0.5, count) / n ans Math.pow(0.5, count) / n Math.pow(0.5, count) Math.pow Math 0.5 count n System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    }
} Main
import 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 ans = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int count = 0;
            while (true) {
                if (x < k) {
                    x = x << 1;
                    count++;
                } else {
                    break;
                }
            }
            ans += Math.pow(0.5, count) / n;
        }
        System.out.println(ans);
    }
}
