import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
} import java.util.*; util.* java import java.io.*; io.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
} Main static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    } main {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    } int n=sc.nextInt() n sc.nextInt() sc.nextInt sc k=sc.nextInt(); k sc.nextInt() sc.nextInt sc double ans=0; ans 0 for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        } {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        } int t=(i-1+k)/i; t (i-1+k)/i (i-1+k) i-1 i 1 k i int l=Integer.toString(t,2).length(); l Integer.toString(t,2).length() Integer.toString(t,2).length Integer.toString(t,2) Integer.toString Integer t 2 int tail=Integer.numberOfTrailingZeros(t); tail Integer.numberOfTrailingZeros(t) Integer.numberOfTrailingZeros Integer t int c=tail==l-1?tail:l; c tail==l-1?tail:l tail==l-1 tail l-1 l 1 tail l ans+=pow(0.5,c) ans pow(0.5,c) pow 0.5 c out.println(ans/n) out.println out ans/n ans n out.close() out.close out String[] $ $ static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    } sc static Scanner s = new Scanner(System.in); s new Scanner(System.in) static String next() {
            return s.next();
        } next {
            return s.next();
        } return s.next(); s.next() s.next s static String nextLine() {
            return s.nextLine();
        } nextLine {
            return s.nextLine();
        } return s.nextLine(); s.nextLine() s.nextLine s static int nextInt() {
            return Integer.parseInt(s.next());
        } nextInt {
            return Integer.parseInt(s.next());
        } return Integer.parseInt(s.next()); Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s static long nextLong() {
            return Long.parseLong(s.next());
        } nextLong {
            return Long.parseLong(s.next());
        } return Long.parseLong(s.next()); Long.parseLong(s.next()) Long.parseLong Long s.next() s.next s static double nextDouble() {
            return Double.parseDouble(s.next());
        } nextDouble {
            return Double.parseDouble(s.next());
        } return Double.parseDouble(s.next()); Double.parseDouble(s.next()) Double.parseDouble Double s.next() s.next s static boolean hasNext() {
            return s.hasNext();
        } hasNext {
            return s.hasNext();
        } return s.hasNext(); s.hasNext() s.hasNext s public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
} public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
} Main
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt(),k=sc.nextInt();
        double ans=0;
        for (int i = 1; i <= n; i++) {
            int t=(i-1+k)/i;
            int l=Integer.toString(t,2).length();
            int tail=Integer.numberOfTrailingZeros(t);
            int c=tail==l-1?tail:l;
            ans+=pow(0.5,c);
        }
        out.println(ans/n);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
}