
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	} 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 result = 0; result 0 for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		} {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		} int times = 0; times 0 double start = i; start i while (start < k) {
				start *= 2;
				times++;
			} start < k start k {
				start *= 2;
				times++;
			} start *= 2 start 2 times++ times result += 1.0/n*Math.pow(0.5, times) result 1.0/n*Math.pow(0.5, times) 1.0/n 1.0 n Math.pow(0.5, times) Math.pow Math 0.5 times System.out.printf("%.10f\n", result) System.out.printf System.out System System.out "%.10f\n" result String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		
		
		double result = 0;
		
		for(int i = 1; i <= n; i++) {
			int times = 0;
			double start = i;
			
			while (start < k) {
				start *= 2;
				times++;
			}
//			System.out.println(times);
			
			result += 1.0/n*Math.pow(0.5, times);
		}
		
		System.out.printf("%.10f\n", result);
	}

}
