import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n = in.nextInt(); n in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in System.out.println(solve(n, k)) System.out.println System.out System System.out solve(n, k) solve n k in.close() in.close in String[] args args private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	} solve {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	} double r = 0; r 0 for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		} {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		} int p = i; p i double x = 1; x 1 x /= n x n while (p < k) {
				p *= 2;
				x /= 2;
			} p < k p k {
				p *= 2;
				x /= 2;
			} p *= 2 p 2 x /= 2 x 2 r += x r x return r; r int n n int k k public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	}
} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int k = in.nextInt();
		System.out.println(solve(n, k));
		in.close();
	}

	private static double solve(int n, int k) {
		double r = 0;
		for (int i = 1; i <= n; i++) {
			int p = i;
			double x = 1;
			x /= n;
			while (p < k) {
				p *= 2;
				x /= 2;
			}
			r += x;
		}
		return r;
	}
}