import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	}
} Main public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	} main {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	} int n n k; k double win = 0; win 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc k = sc.nextInt() k sc.nextInt() sc.nextInt sc for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		} {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		} int p = i; p i int j = 0; j 0 while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			} p<k p k {
				j++;
				p = i*(int)Math.pow(2, j);
				
			} j++ j p = i*(int)Math.pow(2, j) p i*(int)Math.pow(2, j) i (int)Math.pow(2, j) Math.pow Math 2 j win += (1.0/(double)n)*Math.pow(0.5, j) win (1.0/(double)n)*Math.pow(0.5, j) (1.0/(double)n) 1.0 (double)n Math.pow(0.5, j) Math.pow Math 0.5 j System.out.println(win) System.out.println System.out System System.out win String[] args args public class Main {

	public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	}
} public class Main {

	public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n,k;
		double win = 0;

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		for(int i=1;i<=n;i++) {
			int p = i;
			int j = 0;
			while(p<k) {
				j++;
				p = i*(int)Math.pow(2, j);
				
			}
			win += (1.0/(double)n)*Math.pow(0.5, j);

		}
//		String str = String.valueOf(String.format("%.13f", win));
		System.out.println(win);
	}
}
