import java.util.*;

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

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        Integer n = sc.nextInt();
        Integer k = sc.nextInt();
        double ans = 0;
        for (int i =1;i<=n;i++) {
            int tmp = i;
            int p = 0;
            while (tmp < k) {
                tmp *= 2;
                p++;
            }
            double sum = Math.pow(0.5, p) / n ;
            ans += sum;
        }
        System.out.println(ans);
    }
}