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();
		double answer = 0;

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

	}
} 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();
		double answer = 0;

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

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

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double answer = 0;

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

	} 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 answer = 0; answer 0 for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		} {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		} int sum = i; sum i int count = 0; count 0 while (sum <= K - 1) {
				sum *= 2;
				count++;
			} sum <= K - 1 sum K - 1 K 1 {
				sum *= 2;
				count++;
			} sum *= 2 sum 2 count++ count answer += (double)1/N * Math.pow((double)1/2, count) answer (double)1/N * Math.pow((double)1/2, count) (double)1/N (double)1 N Math.pow((double)1/2, count) Math.pow Math (double)1/2 (double)1 2 count System.out.println(answer) System.out.println System.out System System.out answer 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 answer = 0;

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

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

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

	}
} 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();
		double answer = 0;

		for (int i = 1; i <= N; i++) {
			int sum = i;
			int count = 0;
			while (sum <= K - 1) {
				sum *= 2;
				count++;
			}

			answer += (double)1/N * Math.pow((double)1/2, count);

		}

		System.out.println(answer);

	}
}
