
import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n= in.nextInt();
        int k=in.nextInt();
        double res=0;
        for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        }
        System.out.println(res);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n= in.nextInt();
        int k=in.nextInt();
        double res=0;
        for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        }
        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n= in.nextInt();
        int k=in.nextInt();
        double res=0;
        for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        }
        System.out.println(res);
    } main {
        Scanner in = new Scanner(System.in);

        int n= in.nextInt();
        int k=in.nextInt();
        double res=0;
        for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        }
        System.out.println(res);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n= in.nextInt(); n in.nextInt() in.nextInt in int k=in.nextInt(); k in.nextInt() in.nextInt in double res=0; res 0 for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        } {
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        } double temp = 1.0/n; temp 1.0/n 1.0 n int now =i; now i while(now<k){
                now=now*2;
                temp=temp/2;
            } now<k now k {
                now=now*2;
                temp=temp/2;
            } now=now*2 now now*2 now 2 temp=temp/2 temp temp/2 temp 2 res+=temp res temp System.out.println(res) System.out.println System.out System System.out res String[] args args

import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n= in.nextInt();
        int k=in.nextInt();
        double res=0;
        for(int i=1;i<=n;i++){
            double temp = 1.0/n;
            int now =i;
            while(now<k){
                now=now*2;
                temp=temp/2;
            }
            res+=temp;
        }
        System.out.println(res);
    }
}
