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

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	}
} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan BigDecimal aa = new BigDecimal(n); aa new BigDecimal(n) int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan BigDecimal ab = new BigDecimal(k); ab new BigDecimal(k) BigDecimal a1 = new BigDecimal(1); a1 new BigDecimal(1) int a =2; a 2 double result = 0; result 0 for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		} {
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		} a=2 a 2 if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			} i<=k-1 i k-1 k 1 {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			} while(a*i<k) {
					a= a*2;


				} a*i<k a*i a i k {
					a= a*2;


				} a= a*2 a a*2 a 2 double b2 = (double)1/n/a; b2 (double)1/n/a (double)1/n/a (double)1 n a result += b2 result b2 {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			} double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue(); b1 a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue() a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP) a1.divide a1 aa 15 BigDecimal.ROUND_HALF_UP BigDecimal BigDecimal.ROUND_HALF_UP result += b1 result b1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	}
} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		 BigDecimal aa = new BigDecimal(n);
		int k = scan.nextInt();
		BigDecimal ab = new BigDecimal(k);
		BigDecimal a1 = new BigDecimal(1);
		int a =2;

		double result = 0;

		for(int i=1; i<=n; i++){
			a=2;

			if(i<=k-1) {
				while(a*i<k) {
					a= a*2;


				}
//				BigDecimal aaa = new BigDecimal(a);
//				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				BigDecimal ab1 = new BigDecimal(b1);
//				double b2 = ab1.divide(aaa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
//				//System.out.println(b2);
				double b2 = (double)1/n/a;
				result += b2;
			}else {
				double b1 = a1.divide(aa, 15, BigDecimal.ROUND_HALF_UP).doubleValue();
				result += b1;
			}
			// System.out.println(result); 
		}
		System.out.println(result); 
	}
}