import java.util.Scanner;

public class Main {

    private static final double LOG_OF_2 = Math.log(2);
    private static final double PROBABILITY_HEAD = 0.5;

    public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    private static final double LOG_OF_2 = Math.log(2);
    private static final double PROBABILITY_HEAD = 0.5;

    public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} Main private static final double LOG_OF_2 = Math.log(2); LOG_OF_2 Math.log(2) Math.log Math 2 private static final double PROBABILITY_HEAD = 0.5; PROBABILITY_HEAD 0.5 public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    } process {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    } double sum = 0; sum 0 for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        } int i = 1; int i = 1; i 1 i <= Math.min(N, K) i Math.min(N, K) Math.min Math N K ++i ++i i {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        } {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        } double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2); numTimesNeeded Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2) Math.ceil Math Math.log((double) K / (double) i) / LOG_OF_2 Math.log((double) K / (double) i) Math.log Math (double) K / (double) i (double) K (double) i LOG_OF_2 sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N sum Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N Math.pow(PROBABILITY_HEAD, numTimesNeeded) Math.pow Math PROBABILITY_HEAD numTimesNeeded (double) N sum += (double) Math.max(0, N - K) / (double) (N) sum (double) Math.max(0, N - K) / (double) (N) (double) Math.max(0, N - K) Math.max Math 0 N - K N K (double) (N) return String.valueOf(sum); String.valueOf(sum) String.valueOf String sum int N N int K K public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    } 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 final String result = process(N, K); result process(N, K) process N K output(result) output result String[] args args private static void output(String result) {
        System.out.println(result);
    } output {
        System.out.println(result);
    } System.out.println(result) System.out.println System.out System System.out result String result result public class Main {

    private static final double LOG_OF_2 = Math.log(2);
    private static final double PROBABILITY_HEAD = 0.5;

    public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} public class Main {

    private static final double LOG_OF_2 = Math.log(2);
    private static final double PROBABILITY_HEAD = 0.5;

    public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {

    private static final double LOG_OF_2 = Math.log(2);
    private static final double PROBABILITY_HEAD = 0.5;

    public static String process(int N, int K) {
        double sum = 0;
        for (int i = 1; i <= Math.min(N, K); ++i) {
            double numTimesNeeded = Math.ceil(Math.log((double) K / (double) i) / LOG_OF_2);
            sum += Math.pow(PROBABILITY_HEAD, numTimesNeeded) / (double) N;
        }
        sum += (double) Math.max(0, N - K) / (double) (N);
        return String.valueOf(sum);
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();

        final String result = process(N, K);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
}
