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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		} {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		} int j = i; j i int c = 1; c 1 while (j < k) {
				j = j << 1;
				c = c << 1;
			} j < k j k {
				j = j << 1;
				c = c << 1;
			} j = j << 1 j j << 1 j 1 c = c << 1 c c << 1 c 1 p += (1.0 / n) * (1.0 / c) p (1.0 / n) * (1.0 / c) (1.0 / n) 1.0 n (1.0 / c) 1.0 c 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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		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; i++) {
			int j = i;
			int c = 1;
			while (j < k) {
				j = j << 1;
				c = c << 1;
			}
			p += (1.0 / n) * (1.0 / c);
		}

		System.out.println(p);
	}
}
