import java.util.Scanner;
import java.util.Arrays;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double[] dp = new double[K + 1]; dp new double[K + 1] K + 1 K 1 Arrays.fill(dp, 0) Arrays.fill Arrays dp 0 for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N; int i = 1; int i = 1; i 1 i <= Math.min(N, K) i Math.min(N, K) Math.min Math N K ++ i ++ i i dp[i] = 1.0 / N; dp[i] = 1.0 / N dp[i] dp i 1.0 / N 1.0 N dp[K] += (double)Math.max(0, N - K) / N dp[K] dp K (double)Math.max(0, N - K) / N (double)Math.max(0, N - K) Math.max Math 0 N - K N K N for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2; int i = 1; int i = 1; i 1 i < K i K ++ i ++ i i dp[Math.min(i * 2, K)] += dp[i] / 2; dp[Math.min(i * 2, K)] += dp[i] / 2 dp[Math.min(i * 2, K)] dp Math.min(i * 2, K) Math.min Math i * 2 i 2 K dp[i] / 2 dp[i] dp i 2 System.out.println(dp[K]) System.out.println System.out System System.out dp[K] dp K String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	}
} Main
import java.util.Scanner;
import java.util.Arrays;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		double[] dp = new double[K + 1];
		Arrays.fill(dp, 0);
		for (int i = 1;i <= Math.min(N, K);++ i) dp[i] = 1.0 / N;
		dp[K] += (double)Math.max(0, N - K) / N;
		for (int i = 1;i < K;++ i) dp[Math.min(i * 2, K)] += dp[i] / 2;
		System.out.println(dp[K]);
	}
}