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 A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	}

} 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 A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	} 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 A = 0; A 0 double B = 0; B 0 A = Math.max(0, n-k+1) A Math.max(0, n-k+1) Math.max Math 0 n-k+1 n-k n k 1 for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		} int L = 1; int L = 1; L 1 L <= Math.min(n, k-1) L Math.min(n, k-1) Math.min Math n k-1 k 1 L++ L++ L {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		} {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		} int l = L; l L int i = 0; i 0 while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			} true {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			} if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				} l >= k l k {
					break;
				} break; {
					i++;
					l = L * (int)Math.pow(2,i);
				} i++ i l = L * (int)Math.pow(2,i) l L * (int)Math.pow(2,i) L (int)Math.pow(2,i) Math.pow Math 2 i B += Math.pow(0.5, i) B Math.pow(0.5, i) Math.pow Math 0.5 i System.out.println((A+B)/n) System.out.println System.out System System.out (A+B)/n (A+B) A B n sc.close() sc.close sc 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 A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	}

} 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 A = 0; double B = 0;
		A = Math.max(0, n-k+1);
		for(int L = 1; L <= Math.min(n, k-1); L++) {
			int l = L;
			int i = 0;
			while(true) {
				if(l >= k) {
					break;
				}else {
					i++;
					l = L * (int)Math.pow(2,i);
				}
			}
			B += Math.pow(0.5, i);
		}
		System.out.println((A+B)/n);
		sc.close();

	}

}