import java.util.*;

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

