import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	} main {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	} BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer in=new StringTokenizer(br.readLine()); in new StringTokenizer(br.readLine()) int N =Integer.parseInt(in.nextToken()); N Integer.parseInt(in.nextToken()) Integer.parseInt Integer in.nextToken() in.nextToken in int K =Integer.parseInt(in.nextToken()); K Integer.parseInt(in.nextToken()) Integer.parseInt Integer in.nextToken() in.nextToken in in = null in null br = null br null double ans = 0.0; ans 0.0 for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        } {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        } int tmp = i; tmp i double d = 1.0 / N; d 1.0 / N 1.0 N while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	} K > tmp K tmp {
        		tmp *= 2;
        		d /= 2;
        	} tmp *= 2 tmp 2 d /= 2 d 2 ans += d ans d 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) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	}

} public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        int N =Integer.parseInt(in.nextToken());
        int K =Integer.parseInt(in.nextToken());
        in = null;
        br = null;
        double ans = 0.0;

        for (int i = 1; i <= N; i++) {
        	int tmp = i;
        	double d = 1.0 / N;
        	while (K > tmp) {
        		tmp *= 2;
        		d /= 2;
        	}
        	ans += d;
        }

        System.out.println(ans);

	}

}
