import java.util.Scanner;


public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	}
} 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();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int k=sc.nextInt(); k sc.nextInt() sc.nextInt sc double ans=0; ans 0 int times=0; times 0 for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		} int i=n; int i=n; i n i>0 i 0 --i --i i {
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		} {
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		} while(i*Math.pow(2, times)<k)++times; i*Math.pow(2, times)<k i*Math.pow(2, times) i Math.pow(2, times) Math.pow Math 2 times k ++times times ans=ans+(1/(double)n)*Math.pow(0.5, times) ans ans+(1/(double)n)*Math.pow(0.5, times) ans (1/(double)n)*Math.pow(0.5, times) (1/(double)n) 1 (double)n Math.pow(0.5, times) Math.pow Math 0.5 times 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=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	}
} public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;


public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int k=sc.nextInt();
		double ans=0;

		int times=0;
		for(int i=n;i>0;--i){
			while(i*Math.pow(2, times)<k)++times;
			ans=ans+(1/(double)n)*Math.pow(0.5, times);

		}
		System.out.println(ans);
	}
}