import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        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 = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        System.out.println(ans);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double ans = 0; ans 0 int point; point int a; a for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        } {
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        } point = i point i if(point >= k){
                ans += n-(point-1);
                break;
            } point >= k point k {
                ans += n-(point-1);
                break;
            } ans += n-(point-1) ans n-(point-1) n (point-1) point 1 break; a = 0 a 0 while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            } true {
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            } point = point << 1 point point << 1 point 1 if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                } point >= k point k {
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                } ans += 1 / Double.valueOf(2 << a) ans 1 / Double.valueOf(2 << a) 1 Double.valueOf(2 << a) Double.valueOf Double 2 << a 2 a break; a++ a ans /= n ans 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 = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        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 = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        double ans = 0;
        int point;
        int a;
        for(int i = 1; i <= n; i++){
            point = i;
            if(point >= k){
                ans += n-(point-1);
                break;
            }
            a = 0;
            while(true){
                point = point << 1;
                if(point >= k){
                    ans += 1 / Double.valueOf(2 << a);
                    break;
                }
                a++;
            }
        }
        ans /= n;
        
        System.out.println(ans);
    }
}