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

