import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc double ans = 0.0; ans 0.0 for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		} {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		} int cnt = 0; cnt 0 double p = i; p i while (p < K) {
				cnt++;
				p *= 2.0;
			} p < K p K {
				cnt++;
				p *= 2.0;
			} cnt++ cnt p *= 2.0 p 2.0 ans += 1.0 / N * Math.pow(0.5, cnt) ans 1.0 / N * Math.pow(0.5, cnt) 1.0 / N 1.0 N Math.pow(0.5, cnt) Math.pow Math 0.5 cnt 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) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			int cnt = 0;
			double p = i;
			while (p < K) {
				cnt++;
				p *= 2.0;
			}
			ans += 1.0 / N * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
}