import 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;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java 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;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		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;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		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; ans 0 for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		} {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		} int cnt; cnt int d; d if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			} i < K i K {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2)) cnt (int) Math.ceil(Math.log((double) K / i) / Math.log(2)) Math.ceil Math Math.log((double) K / i) / Math.log(2) Math.log((double) K / i) Math.log Math (double) K / i (double) K i Math.log(2) Math.log Math 2 d = N * (int) Math.pow(2, cnt) d N * (int) Math.pow(2, cnt) N (int) Math.pow(2, cnt) Math.pow Math 2 cnt {
				d = N;
			} d = N d N ans += 1.0 / d ans 1.0 / d 1.0 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) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		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;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		System.out.println(ans);
	}
} Main
import 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;
		for (int i = 1; i <= N; i++) {
			int cnt;
			int d;
			if (i < K) {
				cnt = (int) Math.ceil(Math.log((double) K / i) / Math.log(2));
				d = N * (int) Math.pow(2, cnt);
			} else {
				d = N;
			}
			ans += 1.0 / d;
		}
		System.out.println(ans);
	}
}
