import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	} main {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan double ans = 0; ans 0 for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} int i = 1; int i = 1; i 1 i <= a i a i++ i++ i {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} double tmp = 1.0 / a; tmp 1.0 / a 1.0 a int now = i; now i while(now < b) {
				now *= 2;
				tmp /= 2;
			} now < b now b {
				now *= 2;
				tmp /= 2;
			} now *= 2 now 2 tmp /= 2 tmp 2 ans += tmp ans tmp System.out.println((double)ans) System.out.println System.out System System.out (double)ans String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		double ans = 0;
		for(int i = 1; i <= a; i++) {
			double tmp = 1.0 / a;
			int now = i;
			while(now < b) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println((double)ans);
	}
}