import java.util.*;
import java.lang.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            double N = sc.nextDouble();
            double K = sc.nextDouble();
        sc.close();
        
        double tmp = 0.0;
        double ans = 0.0;

        for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        }
        System.out.println(ans);
    }

    static int bekijou(int a,double b,int c){
        if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        }
    }

    static int bekijou2(int a,int b){
        if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        }
    }
} import java.util.*; util.* java import java.lang.*; lang.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            double N = sc.nextDouble();
            double K = sc.nextDouble();
        sc.close();
        
        double tmp = 0.0;
        double ans = 0.0;

        for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        }
        System.out.println(ans);
    }

    static int bekijou(int a,double b,int c){
        if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        }
    }

    static int bekijou2(int a,int b){
        if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            double N = sc.nextDouble();
            double K = sc.nextDouble();
        sc.close();
        
        double tmp = 0.0;
        double ans = 0.0;

        for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
            double N = sc.nextDouble();
            double K = sc.nextDouble();
        sc.close();
        
        double tmp = 0.0;
        double ans = 0.0;

        for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        }
        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 sc.close() sc.close sc double tmp = 0.0; tmp 0.0 double ans = 0.0; ans 0.0 for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        } int i = 1 ; int i = 1 ; i 1 i <= N i N i++ i++ i {
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        } {
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        } if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            } i>=K i K {
                tmp = N;
                ans += 1/tmp;
            } tmp = N tmp N ans += 1/tmp ans 1/tmp 1 tmp {
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            } int p = bekijou(i,K,0); p bekijou(i,K,0) bekijou i K 0 tmp = N*bekijou2(2,p) tmp N*bekijou2(2,p) N bekijou2(2,p) bekijou2 2 p ans += 1/tmp ans 1/tmp 1 tmp System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int bekijou(int a,double b,int c){
        if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        }
    } bekijou {
        if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        }
    } if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        } a < b a b {
            return bekijou(a*2,b,c+1);
        } return bekijou(a*2,b,c+1); bekijou(a*2,b,c+1) bekijou a*2 a 2 b c+1 c 1 {
            return c;
        } return c; c int a a double b b int c c static int bekijou2(int a,int b){
        if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        }
    } bekijou2 {
        if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        }
    } if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        } b==1 b 1 {
            return a;
        } return a; a {
            return bekijou2(a * 2,b-1);
        } return bekijou2(a * 2,b-1); bekijou2(a * 2,b-1) bekijou2 a * 2 a 2 b-1 b 1 int a a int b b
import java.util.*;
import java.lang.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            double N = sc.nextDouble();
            double K = sc.nextDouble();
        sc.close();
        
        double tmp = 0.0;
        double ans = 0.0;

        for(int i = 1 ; i <= N ; i++){
            if(i>=K){
                tmp = N;
                ans += 1/tmp;
            }
            else{
            int p = bekijou(i,K,0);

            tmp = N*bekijou2(2,p);
            ans += 1/tmp;
            //System.out.println(bekijou2(2,p));
            //System.out.println(ans);
            }
        }
        System.out.println(ans);
    }

    static int bekijou(int a,double b,int c){
        if(a < b){
            return bekijou(a*2,b,c+1);
        }
        else{
            return c;
        }
    }

    static int bekijou2(int a,int b){
        if(b==1){
            return a;
        }
        else{
            return bekijou2(a * 2,b-1);
        }
    }
}
