import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			ans += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			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();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			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();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			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 double ans = 0; ans 0 for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			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 tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			ans += 1.0 / n * Math.pow(0.5, cnt);
		} {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			ans += 1.0 / n * Math.pow(0.5, cnt);
		} int tmp = i; tmp i int cnt = 0; cnt 0 while (tmp < k) {
				tmp *= 2;
				cnt++;
			} tmp < k tmp k {
				tmp *= 2;
				cnt++;
			} tmp *= 2 tmp 2 cnt++ cnt 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();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			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();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int cnt = 0;
			while (tmp < k) {
				tmp *= 2;
				cnt++;
			}
			ans += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.lang.*;

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