import java.util.Scanner;

class Main{
	public static void main(String[]$){

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double s = 0;
		for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		}

		System.out.println(s);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[]$){

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double s = 0;
		for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		}

		System.out.println(s);
	}
} Main public static void main(String[]$){

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double s = 0;
		for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		}

		System.out.println(s);
	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double s = 0;
		for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		}

		System.out.println(s);
	} 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 s = 0; s 0 for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		} {

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		} int c = 0; c 0 if(i<k)
				for(int t = i; t < k; t *= 2)
					c++; i<k i k for(int t = i; t < k; t *= 2)
					c++; int t = i; int t = i; t i t < k t k t *= 2 t *= 2 t 2 c++; c++ c s += (1.0000000000/n) * Math.pow(0.5000000000, c) s (1.0000000000/n) * Math.pow(0.5000000000, c) (1.0000000000/n) 1.0000000000 n Math.pow(0.5000000000, c) Math.pow Math 0.5000000000 c System.out.println(s) System.out.println System.out System System.out s String[]$ $
import java.util.Scanner;

class Main{
	public static void main(String[]$){

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double s = 0;
		for(int i = 1; i <= n; i++){

			int c = 0;
			if(i<k)
				for(int t = i; t < k; t *= 2)
					c++;

			s += (1.0000000000/n) * Math.pow(0.5000000000, c);
		}

		System.out.println(s);
	}
}
