import java.util.Scanner;

public class Main {
	static double N;
	static int K;
	static double ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	}

	private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	static double N;
	static int K;
	static double ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	}

	private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	}

} Main static double N; N static int K; K static double ans; ans public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc K = sc.nextInt() K sc.nextInt() sc.nextInt sc double prob = 1 / N; prob 1 / N 1 N for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		} int point = 1; int point = 1; point 1 point <= N point N point++ point++ point {
			dfs(point, 1/N);
		} {
			dfs(point, 1/N);
		} dfs(point, 1/N) dfs point 1/N 1 N System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	} dfs {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	} if (point >= K) {
			ans += prob;
			return;
		} point >= K point K {
			ans += prob;
			return;
		} ans += prob ans prob return; dfs(point * 2, prob * 1/2) dfs point * 2 point 2 prob * 1/2 prob * 1 prob 1 2 int point point double prob prob public class Main {
	static double N;
	static int K;
	static double ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	}

	private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	}

} public class Main {
	static double N;
	static int K;
	static double ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	}

	private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	}

} Main
import java.util.Scanner;

public class Main {
	static double N;
	static int K;
	static double ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		N = sc.nextInt();
		K = sc.nextInt();

		double prob = 1 / N;

		for (int point = 1; point <= N; point++) {
			dfs(point, 1/N);
		}

		System.out.println(ans);
	}

	private static void dfs(int point, double prob) {
		if (point >= K) {
			ans += prob;
			return;
		}

		dfs(point * 2, prob * 1/2);
	}

}