import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    }
}
 import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double psum =0; psum 0 for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        } int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        } {
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        } double p_i = 1; p_i 1 int point = i+1; point i+1 i 1 while(point < K){
                point *= 2;
                p_i *= 0.5;
            } point < K point K {
                point *= 2;
                p_i *= 0.5;
            } point *= 2 point 2 p_i *= 0.5 p_i 0.5 psum += p_i psum p_i psum /= N psum N System.out.println(psum) System.out.println System.out System System.out psum String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double psum =0;
        for(int i = 0; i< N; i++){
            double p_i = 1;
            int point = i+1;
            while(point < K){
                point *= 2;
                p_i *= 0.5;
            }
            psum += p_i;
        }
        psum /= N;
        System.out.println(psum);
    }
}

