import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double win = 0; win 0 for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		} {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		} int m=i; m i int j; j for(j=1;m<k;j++) {
				m = m*2;
			} j=1; j=1 j 1 m<k m k j++ j++ j {
				m = m*2;
			} {
				m = m*2;
			} m = m*2 m m*2 m 2 win = win + Math.pow(0.5, j-1) win win + Math.pow(0.5, j-1) win Math.pow(0.5, j-1) Math.pow Math 0.5 j-1 j 1 win = win/n win win/n win n 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) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		double win = 0;
		for(int i=1;i<=n;i++) {
			int m=i;
			int j;
			for(j=1;m<k;j++) {
				m = m*2;
			}
			win = win + Math.pow(0.5, j-1);
		}
		win = win/n;

		System.out.println(win);
	}
}
