import java.util.Scanner;

public class Main {
	public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		new Main().run();
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		new Main().run();
	}

} Main public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	} run {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan double ans = 0; ans 0 for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		} {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		} int tmp = i; tmp i int j = 0; j 0 for (j = 0; tmp < k; j++)
				tmp *= 2; j = 0; j = 0 j 0 tmp < k tmp k j++ j++ j tmp *= 2; tmp *= 2 tmp 2 if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n); j == 0 j 0 ans += 1 / (double) n ans 1 / (double) n 1 (double) n ans += Math.pow((double)1 / 2, j) * (1 / (double) n) ans Math.pow((double)1 / 2, j) * (1 / (double) n) Math.pow((double)1 / 2, j) Math.pow Math (double)1 / 2 (double)1 2 j (1 / (double) n) 1 (double) n System.out.println(ans) System.out.println System.out System System.out ans public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		new Main().run();
	}

} public class Main {
	public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		new Main().run();
	}

} Main
import java.util.Scanner;

public class Main {
	public void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		double ans = 0;
		for (int i = 1; i <= n; i++) {
			int tmp = i;
			int j = 0;
			for (j = 0; tmp < k; j++)
				tmp *= 2;
			if (j == 0)
				ans += 1 / (double) n;
			else
				ans += Math.pow((double)1 / 2, j) * (1 / (double) n);
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		new Main().run();
	}

}
