import java.util.*;

class Main{
    public static void main(String[] args) {       
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        double ans = 0;
        for(int i = 1; i <= n ; i++){
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        }
        System.out.println(ans);
   }
} import java.util.*; util.* java class Main{
    public static void main(String[] args) {       
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        double ans = 0;
        for(int i = 1; i <= n ; i++){
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        }
        System.out.println(ans);
   }
} Main public static void main(String[] args) {       
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        double ans = 0;
        for(int i = 1; i <= n ; i++){
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        }
        System.out.println(ans);
   } main {       
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        double ans = 0;
        for(int i = 1; i <= n ; i++){
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        }
        System.out.println(ans);
   } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn double ans = 0; ans 0 for(int i = 1; i <= n ; i++){
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        } {
            double p = 1;
            int x = i;
            while(x < k){
                p /= 2;
                x *= 2;
            }
            ans += p/n;
        } double p = 1; p 1 int x = i; x i while(x < k){
                p /= 2;
                x *= 2;
            } x < k x k {
                p /= 2;
                x *= 2;
            } p /= 2 p 2 x *= 2 x 2 ans += p/n ans p/n p n System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

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