import java.util.*;

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

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