
import java.util.Scanner;

public class Main {


		public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		}
} 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();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		}
} Main public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		} main {
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan int k=scan.nextInt(); k scan.nextInt() scan.nextInt scan double ans=0; ans 0 for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			} {
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			} int t=i; t i double l=1.0/n; l 1.0/n 1.0 n while(t<k)
			{
				t*=2;
				l/=2;
			} t<k t k {
				t*=2;
				l/=2;
			} t*=2 t 2 l/=2 l 2 ans+=l ans l System.out.printf("%.15f",ans) System.out.printf System.out System System.out "%.15f" ans String args[] args public class Main {


		public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		}
} public class Main {


		public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		}
} Main

import java.util.Scanner;

public class Main {


		public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			int n=scan.nextInt();
			int k=scan.nextInt();
			double ans=0;
			for(int i=1;i<=n;i++)
			{
			int t=i;
			double l=1.0/n;
			while(t<k)
			{
				t*=2;
				l/=2;
			}
			ans+=l;
				
			}
			System.out.printf("%.15f",ans);
			
		}
}
