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 p = 0;

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

	}
} 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 p = 0;

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

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

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

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

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		} int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
			int cnt = 0;
			int pt = i;
			while (pt <= K - 1) {
				pt *= 2;
				cnt++;
			}

			p += (double) 1 / N * Math.pow(0.5, cnt);
		} {
			int cnt = 0;
			int pt = i;
			while (pt <= K - 1) {
				pt *= 2;
				cnt++;
			}

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

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

	}
} public class Main {

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

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

	}
} 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 p = 0;

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

			p += (double) 1 / N * Math.pow(0.5, cnt);
		}

		System.out.println(p);

	}
}
