import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    } 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 ans = 0; ans 0 for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        } {
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        } long tmp = (long)n; tmp (long)n if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            } i >= k i k {
                ans += 1d/(double)tmp;
                continue;
            } ans += 1d/(double)tmp ans 1d/(double)tmp 1d (double)tmp continue; int now = i; now i while(now < k){
                now *= 2;
                tmp *= 2;
            } now < k now k {
                now *= 2;
                tmp *= 2;
            } now *= 2 now 2 tmp *= 2 tmp 2 ans += 1d/(double)tmp ans 1d/(double)tmp 1d (double)tmp System.out.println(String.format("%.12f", ans)) System.out.println System.out System System.out String.format("%.12f", ans) String.format String "%.12f" ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        for(int i = 1; i <= n; i++){
            long tmp = (long)n;
            if(i >= k){
                ans += 1d/(double)tmp;
                continue;
            }
            int now = i;
            while(now < k){
                now *= 2;
                tmp *= 2;
            }
            ans += 1d/(double)tmp;
        }
        System.out.println(String.format("%.12f", ans));
    }
}
