import java.math.BigDecimal;
import java.util.*;

class Main{
    public static void main(String argv[]) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.close();
        double result = 0.0;
        for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        }
        System.out.println(String.format("%.10f", result));
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java class Main{
    public static void main(String argv[]) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.close();
        double result = 0.0;
        for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        }
        System.out.println(String.format("%.10f", result));
    }
} Main public static void main(String argv[]) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.close();
        double result = 0.0;
        for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        }
        System.out.println(String.format("%.10f", result));
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.close();
        double result = 0.0;
        for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        }
        System.out.println(String.format("%.10f", result));
    } 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 sc.close() sc.close sc double result = 0.0; result 0.0 for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        } {
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        } double tmp = 1.0/(double)N; tmp 1.0/(double)N 1.0 (double)N int now = i; now i while(now < K){
                tmp *= 0.5;
                now *= 2;
            } now < K now K {
                tmp *= 0.5;
                now *= 2;
            } tmp *= 0.5 tmp 0.5 now *= 2 now 2 result += tmp result tmp System.out.println(String.format("%.10f", result)) System.out.println System.out System System.out String.format("%.10f", result) String.format String "%.10f" result String argv[] argv
import java.math.BigDecimal;
import java.util.*;

class Main{
    public static void main(String argv[]) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.close();
        double result = 0.0;
        for(int i=1;i<=N;i++){
            double tmp = 1.0/(double)N;
            int now = i;
            while(now < K){
                tmp *= 0.5;
                now *= 2;
            }
            result += tmp;
        }
        System.out.println(String.format("%.10f", result));
    }
}