import java.util.*;
import static java.lang.Math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    }
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    } main {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextInt(); n sc.nextInt() sc.nextInt sc double k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double ans[] = new double[(int)n+1]; ans new double[(int)n+1] (int)n+1 (int)n 1 for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        } int i=1; int i=1; i 1 i<=(int)n i (int)n i++ i++ i {
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        } {
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        } double temp = (double)i; temp (double)i int memo = 0; memo 0 while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            } true {
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            } if(temp > k-1){
                    break;
                } temp > k-1 temp k-1 k 1 {
                    break;
                } break; temp*=2 temp 2 memo++ memo ans[i] = 1/n * pow(0.5, memo) ans[i] ans i 1/n * pow(0.5, memo) 1/n 1 n pow(0.5, memo) pow 0.5 memo double res = 0; res 0 for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        } int i =1; int i =1; i 1 i<=(int)n i (int)n i++ i++ i {
            res += ans[i]; 
        } {
            res += ans[i]; 
        } res += ans[i] res ans[i] ans i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    }
} Main
import java.util.*;
import static java.lang.Math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();
        double ans[] = new double[(int)n+1];
        for(int i=1; i<=(int)n; i++){
            double temp = (double)i;
            int memo = 0;
            while(true){
                
                if(temp > k-1){
                    break;
                }
                temp*=2;
                memo++;
            }
            ans[i] = 1/n * pow(0.5, memo);
        }
        double res = 0;
        for(int i =1; i<=(int)n; i++){
            res += ans[i]; 
        }
        System.out.println(res);

    }
}