import java.util.*;
public class Main {
    
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    }
} Main public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int K = scanner.nextInt(); K scanner.nextInt() scanner.nextInt scanner int[] log2 = new int[K+1]; log2 new int[K+1] K+1 K 1 log2[0] = 0 log2[0] log2 0 0 log2[1] = 1 log2[1] log2 1 1 int pow2 = 2; pow2 2 for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        } int i = 2; int i = 2; i 2 i <=K i K i++ i++ i {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        } {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        } if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            } i <= pow2 i pow2 log2[i] = log2[i-1] log2[i] log2 i log2[i-1] log2 i-1 i 1 if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            } pow2 < i pow2 i {
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            } log2[i] = log2[i-1] + 1 log2[i] log2 i log2[i-1] + 1 log2[i-1] log2 i-1 i 1 1 pow2 *= 2 pow2 2 double ans = 0; ans 0 for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        } {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        } double prob = 1.0/N; prob 1.0/N 1.0 N int score = i; score i while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            } score<K score K {
                score = score * 2;
                prob = prob * 0.5;
            } score = score * 2 score score * 2 score 2 prob = prob * 0.5 prob prob * 0.5 prob 0.5 ans += prob ans prob System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main {
    
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    }
} public class Main {
    
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main {
    
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] log2 = new int[K+1];
        log2[0] = 0;
        log2[1] = 1;
        int pow2 = 2;
        for (int i = 2; i <=K; i++) {
            if(i <= pow2) log2[i] = log2[i-1];
            else if(pow2 < i){
                log2[i] = log2[i-1] + 1;
                pow2 *= 2;
            }
        }
        // for (int i = 0; i < K+1; i++) {
        //     System.out.println(log2[i]);
        // }
        double ans = 0;
        for (int i = 1; i <= N; i++) {
            double prob = 1.0/N;
            int score = i;
            while(score<K){
                score = score * 2;
                prob = prob * 0.5;
            }
            ans += prob;
        }
        System.out.println(ans);
    }
}