import java.util.Scanner;

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

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