import java.util.*;

public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    }

} import java.util.*; util.* java public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    }

} Main public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    } main {

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    } 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 answer = 0.0; answer 0.0 for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        } int i = 1; int i = 1; i 1 i < n + 1 i n + 1 n 1 i++ i++ i {
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        } {
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        } if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            } i < k i k {
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            } answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2)))) answer 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2)))) 1.0 / n 1.0 n Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2)))) Math.pow Math 1.0 / 2.0 1.0 2.0 (Math.ceil(Math.log(((double)k / i)) / Math.log(2))) Math.ceil Math Math.log(((double)k / i)) / Math.log(2) Math.log(((double)k / i)) Math.log Math ((double)k / i) (double)k i Math.log(2) Math.log Math 2 {
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            } answer += 1.0 / n answer 1.0 / n 1.0 n System.out.println(answer) System.out.println System.out System System.out answer String args[] args public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    }

} public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    }

} Main
import java.util.*;

public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();
        double answer = 0.0;
        for(int i = 1; i < n + 1; i++){
            if(i < k){
                answer += 1.0 / n * Math.pow(1.0 / 2.0, (Math.ceil(Math.log(((double)k / i)) / Math.log(2))));
                //System.out.println(Math.ceil(Math.log(k / i) / Math.log(2)) + " " + ((double)k / i));
            }else{
                answer += 1.0 / n;
                //System.out.println(answer);
                //answer += 1.0 / n * (n - k);
                //break;
            }
        }

        // 出力
        System.out.println(answer);

    }

}