import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

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

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

		int i,j;
		long cnt;
		double ans = 0.0;
		for(i = 1; i <= n; i++) {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		}
		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int i,j;
		long cnt;
		double ans = 0.0;
		for(i = 1; i <= n; i++) {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int i i j; j long cnt; cnt double ans = 0.0; ans 0.0 for(i = 1; i <= n; i++) {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		} {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		} cnt = 0 cnt 0 double temp = i; temp i while(temp < k) {
				cnt++;
				temp *= 2;
			} temp < k temp k {
				cnt++;
				temp *= 2;
			} cnt++ cnt temp *= 2 temp 2 ans += (1 / (Math.pow(2, cnt) * n)) ans (1 / (Math.pow(2, cnt) * n)) 1 (Math.pow(2, cnt) * n) Math.pow(2, cnt) Math.pow Math 2 cnt 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 scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

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

		int i,j;
		long cnt;
		double ans = 0.0;
		for(i = 1; i <= n; i++) {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int i,j;
		long cnt;
		double ans = 0.0;
		for(i = 1; i <= n; i++) {
			cnt = 0;
			double temp = i;
			while(temp < k) {
				cnt++;
				temp *= 2;
			}
			ans += (1 / (Math.pow(2, cnt) * n));
		}
		System.out.println(ans);
	}
}
