import java.util.*;

class Main{
    final static long mod = 1000000007;
    //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double prob = 0;
        for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        }
        System.out.println(prob / n);
    }
    
} import java.util.*; util.* java class Main{
    final static long mod = 1000000007;
    //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double prob = 0;
        for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        }
        System.out.println(prob / n);
    }
    
} Main final static long mod = 1000000007; mod 1000000007 //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double prob = 0;
        for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        }
        System.out.println(prob / n);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double prob = 0;
        for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        }
        System.out.println(prob / n);
    } 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 prob = 0; prob 0 for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        } {
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        } int cnt = 0; cnt 0 int num = i; num i while(num < k){
                num *= 2;
                cnt++;
            } num < k num k {
                num *= 2;
                cnt++;
            } num *= 2 num 2 cnt++ cnt prob += 1.0 / Math.pow(2.0, cnt) prob 1.0 / Math.pow(2.0, cnt) 1.0 Math.pow(2.0, cnt) Math.pow Math 2.0 cnt System.out.println(prob / n) System.out.println System.out System System.out prob / n prob n String[] args args
import java.util.*;

class Main{
    final static long mod = 1000000007;
    //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double prob = 0;
        for(int i = 1; i <= n; i++){
            int cnt = 0;
            int num = i;
            while(num < k){
                num *= 2;
                cnt++;
            }
            prob += 1.0 / Math.pow(2.0, cnt);
        }
        System.out.println(prob / n);
    }
    
}