//package atcoder;
import java.util.*;
import java.lang.Math.*;
class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double sum=0;
		for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		}
		System.out.printf("%.12f",sum);
	}

} import java.util.*; util.* java import java.lang.Math.*; Math.* java.lang class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double sum=0;
		for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		}
		System.out.printf("%.12f",sum);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double sum=0;
		for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		}
		System.out.printf("%.12f",sum);
	} main {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double sum=0;
		for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		}
		System.out.printf("%.12f",sum);
	} 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 sum=0; sum 0 for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		} {
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		} int j=i; j i int x=0; x 0 while(j<k)
			{
				j=j*2;
				x++;
			} j<k j k {
				j=j*2;
				x++;
			} j=j*2 j j*2 j 2 x++ x sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x))) sum sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x))) sum (double)((1/(double)n)*(Math.pow((1/(double)2),x))) (1/(double)n) 1 (double)n (Math.pow((1/(double)2),x)) Math.pow Math (1/(double)2) 1 (double)2 x System.out.printf("%.12f",sum) System.out.printf System.out System System.out "%.12f" sum String[] args args
//package atcoder;
import java.util.*;
import java.lang.Math.*;
class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double sum=0;
		for(int i=1;i<=n;i++)
		{
			int j=i;
			int x=0;
			while(j<k)
			{
				j=j*2;
				x++;
			}
			sum=sum +(double)((1/(double)n)*(Math.pow((1/(double)2),x)));
		}
		System.out.printf("%.12f",sum);
	}

}
