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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		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 public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] tmp = br.readLine().split(" "); tmp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int N = Integer.parseInt(tmp[0]); N Integer.parseInt(tmp[0]) Integer.parseInt Integer tmp[0] tmp 0 int K = Integer.parseInt(tmp[1]); K Integer.parseInt(tmp[1]) Integer.parseInt Integer tmp[1] tmp 1 double ans = 0; ans 0 for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		} long  i = 1; long  i = 1; i 1 i <= N i N i++ i++ i {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		} {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		} if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			} i >= K i K {
				ans += 1.0/N;
			} ans += 1.0/N ans 1.0/N 1.0 N {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			} int rp = 1; rp 1 long point = i * 2; point i * 2 i 2 while (K > point) {
					rp++;
					point *= 2;
				} K > point K point {
					rp++;
					point *= 2;
				} rp++ rp point *= 2 point 2 ans += 1.0 / (Math.pow(2, rp) * N) ans 1.0 / (Math.pow(2, rp) * N) 1.0 (Math.pow(2, rp) * N) Math.pow(2, rp) Math.pow Math 2 rp 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) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");

		int N = Integer.parseInt(tmp[0]);
		int K = Integer.parseInt(tmp[1]);

		double ans = 0;

		for (long  i = 1; i <= N; i++) {
			// iはさいころの目

			if (i >= K) {
				ans += 1.0/N;
			} else {
				int rp = 1;
				long point = i * 2;
				while (K > point) {
					rp++;
					point *= 2;
				}

				ans += 1.0 / (Math.pow(2, rp) * N);
			}
		}

		System.out.println(ans);
	}

}