import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	} main {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int K = in.nextInt(); K in.nextInt() in.nextInt in double ans = 0; ans 0 for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} double tmp = 1.0 / N; tmp 1.0 / N 1.0 N int now = i; now i while (now < K) {
				now *= 2;
				tmp /= 2;
			} now < K now K {
				now *= 2;
				tmp /= 2;
			} now *= 2 now 2 tmp /= 2 tmp 2 ans += tmp ans tmp System.out.println(String.format("%.12f", ans)) System.out.println System.out System System.out String.format("%.12f", ans) String.format String "%.12f" ans in.close() in.close in String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int K = in.nextInt();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0 / N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(String.format("%.12f", ans));
		in.close();
	}
}