import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	}
}

 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc long count = 0; count 0 double  sum = 0; sum 0 for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		} int i=1; int i=1; i 1 i<=Math.min(n,k) i Math.min(n,k) Math.min Math n k i++ i++ i {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		} {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		} for(int j=i;j<k;j*=2) {
				count++;
			} int j=i; int j=i; j i j<k j k j*=2 j*=2 j 2 {
				count++;
			} {
				count++;
			} count++ count sum+=1.0/n * 1.0/Math.pow(2, count) sum 1.0/n * 1.0/Math.pow(2, count) 1.0/n * 1.0 1.0/n 1.0 n 1.0 Math.pow(2, count) Math.pow Math 2 count count=0 count 0 for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		} int i=0; int i=0; i 0 i<n-k i n-k n k i++ i++ i {
			sum+=1.0/n;
		} {
			sum+=1.0/n;
		} sum+=1.0/n sum 1.0/n 1.0 n System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		long count = 0;
		double  sum = 0;


		for(int i=1;i<=Math.min(n,k);i++) {
			for(int j=i;j<k;j*=2) {
				count++;
			}
			sum+=1.0/n * 1.0/Math.pow(2, count);
			count=0;
		}
		for(int i=0;i<n-k;i++) {
			sum+=1.0/n;
		}
		System.out.println(sum);
	}
}


