import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	}

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

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	}

} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	} 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 double K = (double) k; K (double) k double p = 0; p 0 double ans = 0; ans 0 double tmp = 0; tmp 0 for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		} {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		} p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0)) p (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0)) Math.ceil Math Math.log(K / (double)i) / Math.log(2.0) Math.log(K / (double)i) Math.log Math K / (double)i K (double)i Math.log(2.0) Math.log Math 2.0 if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			} p > 0 p 0 {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} tmp = Math.pow(0.5, p) tmp Math.pow(0.5, p) Math.pow Math 0.5 p ans += tmp ans tmp {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			} ans += (n-k+1) ans (n-k+1) n-k n k 1 break; BigDecimal Ans = BigDecimal.valueOf(ans/n); Ans BigDecimal.valueOf(ans/n) BigDecimal.valueOf BigDecimal ans/n ans n System.out.println(Ans) System.out.println System.out System System.out Ans String args[] args public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	}

} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	}

} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

		double K = (double) k;

		//   double[] wariai = new double[n];

		double p = 0;
		double ans = 0;
		double tmp = 0;

		for (int i = 1; i <= n; i++) {
			p = (int) Math.ceil(Math.log(K / (double)i) / Math.log(2.0));
			//    	wariai[i]= Math.pow(0.5, p);
			if (p > 0) {
				tmp = Math.pow(0.5, p);
				ans += tmp;
			} else {
				//ans += (1 / n)*(n-i+1);
				ans += (n-k+1);
				break;
			}
		}
		BigDecimal Ans = BigDecimal.valueOf(ans/n);

		System.out.println(Ans);

	}

}