import java.util.Scanner;

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

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		double N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc double ans = 0; ans 0 for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		} {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		} int a = 0; a 0 int b = i; b i while (b < K) {
				a++;
				b = b * 2;
			} b < K b K {
				a++;
				b = b * 2;
			} a++ a b = b * 2 b b * 2 b 2 ans += (1 / N) * Math.pow(0.5, a) ans (1 / N) * Math.pow(0.5, a) (1 / N) 1 N Math.pow(0.5, a) Math.pow Math 0.5 a System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

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

		double ans = 0;
		for (int i = 1; i <= N; i++) {
			int a = 0;
			int b = i;
			while (b < K) {
				a++;
				b = b * 2;
			}
			ans += (1 / N) * Math.pow(0.5, a);
		}
		System.out.println(ans);
	}
}
