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

    }

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

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0.0;
        int b = 1;
        int r = 0;
        while(b < k) {
            b *= 2;
            r++;
        }
        for (int i = 1; i <= n; i++) {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        }
        System.out.println(ans);
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0.0;
        int b = 1;
        int r = 0;
        while(b < k) {
            b *= 2;
            r++;
        }
        for (int i = 1; i <= n; i++) {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        }
        System.out.println(ans);
        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 ans = 0.0; ans 0.0 int b = 1; b 1 int r = 0; r 0 while(b < k) {
            b *= 2;
            r++;
        } b < k b k {
            b *= 2;
            r++;
        } b *= 2 b 2 r++ r for (int i = 1; i <= n; i++) {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        } {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        } if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            } 1 < b && k <= (b / 2) * i 1 < b 1 b k <= (b / 2) * i k (b / 2) * i (b / 2) b 2 i {
                b /= 2;
                r--;
            } b /= 2 b 2 r-- r ans += (Math.pow(0.5, r)) / n ans (Math.pow(0.5, r)) / n (Math.pow(0.5, r)) Math.pow Math 0.5 r n System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0.0;
        int b = 1;
        int r = 0;
        while(b < k) {
            b *= 2;
            r++;
        }
        for (int i = 1; i <= n; i++) {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        }
        System.out.println(ans);
        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 ans = 0.0;
        int b = 1;
        int r = 0;
        while(b < k) {
            b *= 2;
            r++;
        }
        for (int i = 1; i <= n; i++) {
            if(1 < b && k <= (b / 2) * i){
                b /= 2;
                r--;
            }
            ans += (Math.pow(0.5, r)) / n;
        }
        System.out.println(ans);
        sc.close();

    }

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

    }

}
