import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in double prob = 0; prob 0 for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        } {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        } int score = i; score i int numFlips = 0; numFlips 0 while (score < k) {
                score *= 2;
                numFlips++;
            } score < k score k {
                score *= 2;
                numFlips++;
            } score *= 2 score 2 numFlips++ numFlips prob += Math.pow(0.5, numFlips) / n prob Math.pow(0.5, numFlips) / n Math.pow(0.5, numFlips) Math.pow Math 0.5 numFlips n System.out.println(prob) System.out.println System.out System System.out prob String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double prob = 0;
        for (int i = 1; i <= n; i++) {
            int score = i;
            int numFlips = 0;
            while (score < k) {
                score *= 2;
                numFlips++;
            }
            prob += Math.pow(0.5, numFlips) / n;
        }

        System.out.println(prob);
    }
}
