import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	}
	
	public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	}
} 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(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	}
	
	public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double sum = 0; sum 0 if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		} n < k n k {
			sum = get(n, k);
		} sum = get(n, k) sum get(n, k) get n k {
			sum = (n - k + 1) + get(k - 1, k);
		} sum = (n - k + 1) + get(k - 1, k) sum (n - k + 1) + get(k - 1, k) (n - k + 1) n - k n k 1 get(k - 1, k) get k - 1 k 1 k sum *= (1.0 / (n * 1.0)) sum (1.0 / (n * 1.0)) 1.0 (n * 1.0) n 1.0 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	} get {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	} double sum = 0; sum 0 for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		} {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		} int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2)); p (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2)) Math.ceil Math Math.log10((k * 1.0) / i) / Math.log10(2) Math.log10((k * 1.0) / i) Math.log10 Math (k * 1.0) / i (k * 1.0) k 1.0 i Math.log10(2) Math.log10 Math 2 sum += Math.pow(0.5, (p * 1.0)) sum Math.pow(0.5, (p * 1.0)) Math.pow Math 0.5 (p * 1.0) p 1.0 return sum; sum int n n int k k public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	}
	
	public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	}
	
	public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), k = sc.nextInt();
		
		double sum = 0;
		if(n < k) {
			sum = get(n, k);
		} else {
			sum = (n - k + 1) + get(k - 1, k);
		}
		
		sum *= (1.0 / (n * 1.0));
		System.out.println(sum);
	}
	
	public static double get(int n, int k) {
		double sum = 0;
		for(int i = 1; i <= n; i++) {
			int p = (int)Math.ceil(Math.log10((k * 1.0) / i) / Math.log10(2));
			sum += Math.pow(0.5, (p * 1.0));
		}
		return sum;
	}
}
