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();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    }
} 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();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    } 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 double answer = 0; answer 0 for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        } {
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        } long instance = i; instance i int count = 0; count 0 while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            } true {
                if (instance>=k) break;
                instance *= 2;
                count++;
            } if (instance>=k) break; instance>=k instance k break; instance *= 2 instance 2 count++ count answer += Math.pow(0.5,count)/n answer Math.pow(0.5,count)/n Math.pow(0.5,count) Math.pow Math 0.5 count 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 scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    }
} 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();
        double answer = 0;
        for (int i=1;i<=n;i++){
            long instance = i;
            int count = 0;
            while (true){
                if (instance>=k) break;
                instance *= 2;
                count++;
            }
            answer += Math.pow(0.5,count)/n;
        }
        System.out.println(answer);
    }
}
