import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	} main {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double sum = Math.max(n - k + 1, 0); sum Math.max(n - k + 1, 0) Math.max Math n - k + 1 n - k n k 1 0 for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		} int i = 1; int i = 1; i 1 i <= n && i < k i <= n i n i < k i k i++ i++ i {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		} {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		} int score = i; score i double cnt = 0; cnt 0 while (score < k) {
				score *= 2;
				cnt++;
			} score < k score k {
				score *= 2;
				cnt++;
			} score *= 2 score 2 cnt++ cnt sum += 1.0 / Math.pow(2, cnt) sum 1.0 / Math.pow(2, cnt) 1.0 Math.pow(2, cnt) Math.pow Math 2 cnt double ans = sum / n; ans sum / n sum n System.out.printf("%.10f\n", ans) System.out.printf System.out System System.out "%.10f\n" ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		int k = sc.nextInt();
		
		double sum = Math.max(n - k + 1, 0);
		for (int i = 1; i <= n && i < k; i++) {
			int score = i;
			double cnt = 0;
			while (score < k) {
				score *= 2;
				cnt++;
			}
			sum += 1.0 / Math.pow(2, cnt);
		}
		
		double ans = sum / n;
		System.out.printf("%.10f\n", ans);

	}
}
