import java.util.Scanner;
 
public class Main{
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

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

		double p0 = 0.0;
		for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		}
		System.out.println(p0);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

		double p0 = 0.0;
		for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		}
		System.out.println(p0);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

		double p0 = 0.0;
		for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		}
		System.out.println(p0);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double p0 = 0.0; p0 0.0 for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		} {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		} int x = i; x i int pow = 0; pow 0 while(x < k) {
				x *= 2;
				pow++;
			} x < k x k {
				x *= 2;
				pow++;
			} x *= 2 x 2 pow++ pow p0 += (1.0/Math.pow(2.0, pow))/n p0 (1.0/Math.pow(2.0, pow))/n (1.0/Math.pow(2.0, pow)) 1.0 Math.pow(2.0, pow) Math.pow Math 2.0 pow n System.out.println(p0) System.out.println System.out System System.out p0 String[] args args public class Main{
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

		double p0 = 0.0;
		for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		}
		System.out.println(p0);
	}
} public class Main{
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

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

		double p0 = 0.0;
		for(int i = 1; i <= n; i++) {
			int x = i;
			int pow = 0;
			while(x < k) {
				x *= 2;
				pow++;
			}
			p0 += (1.0/Math.pow(2.0, pow))/n;
		}
		System.out.println(p0);
	}
}