import java.util.*;
//import java.io.*;
//import java.util.stream.IntStream;

public class Main{
    static int minR = Integer.MAX_VALUE;
    static int maxL = 0;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    }
} import java.util.*; util.* java public class Main{
    static int minR = Integer.MAX_VALUE;
    static int maxL = 0;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    }
} Main static int minR = Integer.MAX_VALUE; minR Integer.MAX_VALUE Integer Integer.MAX_VALUE static int maxL = 0; maxL 0 public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    } main {
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    } 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 ans = 0; ans 0 for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        } double i=1; double i=1; i 1 i<=n i n i++ i++ i {
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        } {
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        } if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            } k/i>=1 k/i k i 1 {
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            } int need = (int)Math.ceil(Math.log(k/i)/Math.log(2)); need (int)Math.ceil(Math.log(k/i)/Math.log(2)) Math.ceil Math 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 ans += 1.0/n * Math.pow(0.5, need) ans 1.0/n * Math.pow(0.5, need) 1.0/n 1.0 n Math.pow(0.5, need) Math.pow Math 0.5 need {
                ans += 1.0/n;
            } ans += 1.0/n ans 1.0/n 1.0 n System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main{
    static int minR = Integer.MAX_VALUE;
    static int maxL = 0;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    }
} public class Main{
    static int minR = Integer.MAX_VALUE;
    static int maxL = 0;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    }
} Main
import java.util.*;
//import java.io.*;
//import java.util.stream.IntStream;

public class Main{
    static int minR = Integer.MAX_VALUE;
    static int maxL = 0;
    public static void main (String args[]){
        //初期処理
        Scanner sc=new Scanner(System.in);
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // try{
            // int n = Integer.parseInt(br.readLine());
        
        int n = sc.nextInt();
        int k = sc.nextInt();
        double ans = 0;
        
        for(double i=1;i<=n;i++){
            if(k/i>=1){
                int need = (int)Math.ceil(Math.log(k/i)/Math.log(2));
                ans += 1.0/n * Math.pow(0.5, need);
            }else{
                ans += 1.0/n;
            }
        }

        System.out.println(ans);

    }
}