import java.util.*;

public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	}
} Main public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	} main {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	} int i i j; j Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc sc = null sc null double nbunno1 = 1.0d / n; nbunno1 1.0d / n 1.0d n double kaku = 0.0d; kaku 0.0d int kai; kai double[] nibunnno1 = new double[18]; nibunnno1 new double[18] 18 double ni = 2.0d; ni 2.0d for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		} i = 0; i = 0 i 0 i <= 17 i 17 i++ i++ i {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		} {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		} ni /= 2.0d ni 2.0d nibunnno1[i] = ni nibunnno1[i] nibunnno1 i ni int max; max if(n >= k) {
			max = k -1;
		} else {
			max = n;
		} n >= k n k {
			max = k -1;
		} max = k -1 max k -1 k 1 {
			max = n;
		} max = n max n for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		} i = 1; i = 1 i 1 i <= max i max i++ i++ i {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		} {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		} kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2)) kai (int) Math.ceil(Math.log((double)k / i)/Math.log(2)) Math.ceil Math Math.log((double)k / i)/Math.log(2) Math.log((double)k / i) Math.log Math (double)k / i (double)k i Math.log(2) Math.log Math 2 kaku += nbunno1 * nibunnno1[kai] kaku nbunno1 * nibunnno1[kai] nbunno1 nibunnno1[kai] nibunnno1 kai if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		} n >= k n k {
			kaku += nbunno1 * (n - k + 1);
		} kaku += nbunno1 * (n - k + 1) kaku nbunno1 * (n - k + 1) nbunno1 (n - k + 1) n - k n k 1 System.out.println(kaku) System.out.println System.out System System.out kaku String[] args args public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	}
} public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();
		sc = null;
		double nbunno1 = 1.0d / n;
		double kaku = 0.0d;
		int kai;
		double[] nibunnno1 = new double[18];
		double ni = 2.0d;
		for(i = 0; i <= 17; i++) {
			ni /= 2.0d;
			nibunnno1[i] = ni;
		}
//		int aa = 0;
		int max;
		if(n >= k) {
			max = k -1;
		} else {
			max = n;
		}
		for(i = 1; i <= max; i++) {
			kai = (int) Math.ceil(Math.log((double)k / i)/Math.log(2));
//			System.out.println(kai); /*  */
//			aa +=  Math.pow(2, 17-kai); 
			kaku += nbunno1 * nibunnno1[kai]; 
		}
//		System.out.println(kaku);
//		System.out.println((double)aa/n/131072);
		if(n >= k) {
			kaku += nbunno1 * (n - k + 1);
		}
//		System.out.println(nbunno1 * (n - k));
//		System.out.println(((double)aa/131072+(double)(n-k))/n);
		System.out.println(kaku);
	}
}
