import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        double n=sc.nextDouble();
        double k=sc.nextDouble();
  		double kaku=1/n;
  		double ans=0;
  		int d=0;
		
  		
		for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	}
    
    	System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        double n=sc.nextDouble();
        double k=sc.nextDouble();
  		double kaku=1/n;
  		double ans=0;
  		int d=0;
		
  		
		for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	}
    
    	System.out.println(ans);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        double n=sc.nextDouble();
        double k=sc.nextDouble();
  		double kaku=1/n;
  		double ans=0;
  		int d=0;
		
  		
		for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	}
    
    	System.out.println(ans);
    } main {
	Scanner sc=new Scanner(System.in);
        double n=sc.nextDouble();
        double k=sc.nextDouble();
  		double kaku=1/n;
  		double ans=0;
  		int d=0;
		
  		
		for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	}
    
    	System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) double n=sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc double k=sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc double kaku=1/n; kaku 1/n 1 n double ans=0; ans 0 int d=0; d 0 for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	} int c=1; int c=1; c 1 c<=n c n c++ c++ c {
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	} {
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	} d=c d c while(d<k){
             kaku*=0.5;
             d*=2;
            } d<k d k {
             kaku*=0.5;
             d*=2;
            } kaku*=0.5 kaku 0.5 d*=2 d 2 ans+=kaku ans kaku kaku=1/n kaku 1/n 1 n System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        double n=sc.nextDouble();
        double k=sc.nextDouble();
  		double kaku=1/n;
  		double ans=0;
  		int d=0;
		
  		
		for(int c=1;c<=n;c++){
          	d=c;
    		while(d<k){
             kaku*=0.5;
             d*=2;
            }
          ans+=kaku;
          
          kaku=1/n;
    	}
    
    	System.out.println(ans);
    }
}