import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double total = 0; total 0 int cnt cnt tmp; tmp for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		} {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		} cnt = 0 cnt 0 tmp = i tmp i while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			} tmp <= k - 1 tmp k - 1 k 1 {
				tmp = tmp * 2;
				cnt++;
			} tmp = tmp * 2 tmp tmp * 2 tmp 2 cnt++ cnt total += 1.0 / n * Math.pow(0.5, cnt) total 1.0 / n * Math.pow(0.5, cnt) 1.0 / n 1.0 n Math.pow(0.5, cnt) Math.pow Math 0.5 cnt System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		int cnt, tmp;
		for (int i = 1; i <= n; i++) {
			cnt = 0;
			tmp = i;
			while (tmp <= k - 1) {
				tmp = tmp * 2;
				cnt++;
			}
			total += 1.0 / n * Math.pow(0.5, cnt);
		}
		System.out.println(total);
	}
}
