import java.util.*;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double N = Integer.parseInt(sc.next());
        double K = Double.parseDouble(sc.next());
        double sum = 0;
        if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        }
        
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double N = Integer.parseInt(sc.next());
        double K = Double.parseDouble(sc.next());
        double sum = 0;
        if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        }
        
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double N = Integer.parseInt(sc.next());
        double K = Double.parseDouble(sc.next());
        double sum = 0;
        if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        double N = Integer.parseInt(sc.next());
        double K = Double.parseDouble(sc.next());
        double sum = 0;
        if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double K = Double.parseDouble(sc.next()); K Double.parseDouble(sc.next()) Double.parseDouble Double sc.next() sc.next sc double sum = 0; sum 0 if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        } N < K N K {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        } for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            } {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            } int kijun = 0; kijun 0 if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                } Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) / Math.log(2) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                } kijun = (int)(Math.log(K / i) / Math.log(2)) kijun (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                } kijun = (int)(Math.log(K / i) / Math.log(2)) + 1 kijun (int)(Math.log(K / i) / Math.log(2)) + 1 (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 1 sum += 1 / (double)N * Math.pow(0.5, kijun) sum 1 / (double)N * Math.pow(0.5, kijun) 1 / (double)N 1 (double)N Math.pow(0.5, kijun) Math.pow Math 0.5 kijun System.out.println(sum) System.out.println System.out System System.out sum {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        } for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            } double i = 1; double i = 1; i 1 i < K i K i++ i++ i {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            } {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            } int kijun = 0; kijun 0 if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                } Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) / Math.log(2) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                } kijun = (int)(Math.log(K / i) / Math.log(2)) kijun (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                } kijun = (int)(Math.log(K / i) / Math.log(2)) + 1 kijun (int)(Math.log(K / i) / Math.log(2)) + 1 (int)(Math.log(K / i) / Math.log(2)) Math.log(K / i) Math.log Math K / i K i Math.log(2) Math.log Math 2 1 sum += (1 / N) * Math.pow(0.5, kijun) sum (1 / N) * Math.pow(0.5, kijun) (1 / N) 1 N Math.pow(0.5, kijun) Math.pow Math 0.5 kijun sum += (1 / N) * (N - K + 1) sum (1 / N) * (N - K + 1) (1 / N) 1 N (N - K + 1) N - K N K 1 System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double N = Integer.parseInt(sc.next());
        double K = Double.parseDouble(sc.next());
        double sum = 0;
        if(N < K) {
            for(int i = 1; i <= N; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += 1 / (double)N * Math.pow(0.5, kijun);
            }
            System.out.println(sum);
        }else {
            
            for(double i = 1; i < K; i++) {
                int kijun = 0;
                if(Math.log(K / i) / Math.log(2) == (int)(Math.log(K / i) / Math.log(2))) {
                    kijun = (int)(Math.log(K / i) / Math.log(2));
                }else {
                    kijun = (int)(Math.log(K / i) / Math.log(2)) + 1;
                }
                sum += (1 / N) * Math.pow(0.5, kijun);
            }
            
            sum += (1 / N) * (N - K + 1);
            System.out.println(sum);
        }
        
    }
}