import java.util.Scanner;

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

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