import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    private static long n;

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    }

    private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    }
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    private static long n;

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    }

    private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    }
} Main private static long n; n public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    } main {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    } try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        } {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        } BufferedInputStream in = new BufferedInputStream(System.in) BufferedInputStream in = new BufferedInputStream(System.in) new BufferedInputStream(System.in) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) new PrintWriter(new BufferedOutputStream(System.out)) Scanner sc = new Scanner(in); sc new Scanner(in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double prob = 0.0; prob 0.0 for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
                prob += chance(i, k) / ((double) n);
            } {
                prob += chance(i, k) / ((double) n);
            } prob += chance(i, k) / ((double) n) prob chance(i, k) / ((double) n) chance(i, k) chance i k ((double) n) out.println(prob) out.println out prob String[] args args private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    } chance {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    } double p = 1.0; p 1.0 while (v < k) {
            v *= 2;
            p *= 0.5;
        } v < k v k {
            v *= 2;
            p *= 0.5;
        } v *= 2 v 2 p *= 0.5 p 0.5 return p; p int v v int k k public class Main {

    private static long n;

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    }

    private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    }
} public class Main {

    private static long n;

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    }

    private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    }
} Main
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    private static long n;

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:25-

            int n = sc.nextInt();
            int k = sc.nextInt();

            double prob = 0.0;
            for (int i = 1; i <= n; i++) {
                prob += chance(i, k) / ((double) n);
            }

            out.println(prob);
        }
    }

    private static double chance(int v, int k) {
        double p = 1.0;
        while (v < k) {
            v *= 2;
            p *= 0.5;
        }
        return p;
    }
}
