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 str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 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 public class Main {

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

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		}

		System.out.println(ans);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		}

		System.out.println(ans);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		}

		System.out.println(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int k = Integer.parseInt(str[1]); k Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 double ans = 0.0; ans 0.0 for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		} {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		} double d = (double) 1 / n; d (double) 1 / n (double) 1 n int point = i; point i while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			} point < k point k {
				d *= (double) 1 / 2;
				point *= 2;
			} d *= (double) 1 / 2 d (double) 1 / 2 (double) 1 2 point *= 2 point 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));

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 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));

		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		}

		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 str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		double ans = 0.0;
		for (int i = 1; i <= n; i++) {
			double d = (double) 1 / n;
			int point = i;
			while (point < k) {
				d *= (double) 1 / 2;
				point *= 2;
			}
			ans += d;
		}

		System.out.println(ans);
	}
}