import 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 sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    } 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 sc.close() sc.close sc for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        } int i = 1 ; int i = 1 ; i 1 i <= n i n i++ i++ i {
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        } {
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        } int a = i; a i double yono = 1; yono 1 while(k > a){
                yono /= 2.0;
                a *= 2;
            } k > a k a {
                yono /= 2.0;
                a *= 2;
            } yono /= 2.0 yono 2.0 a *= 2 a 2 sum += yono sum yono System.out.println(sum / n) System.out.println System.out System System.out sum / n sum n 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 sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    }
} Main
import 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 sum = 0;
        sc.close();
        for(int i = 1 ; i <= n ; i++){
            int a = i;
            double yono = 1;
            while(k > a){
                yono /= 2.0;
                a *= 2;
            }
            sum += yono;
        }
        System.out.println(sum / n);
    }
}
