import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9+5;
    static int maxn = (int)1e6+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    }
    
    //<>
    
    
    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
} import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9+5;
    static int maxn = (int)1e6+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    }
    
    //<>
    
    
    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
} Main static int INF = (int)1e9+5; INF (int)1e9+5 (int)1e9 5 static int maxn = (int)1e6+5; maxn (int)1e6+5 (int)1e6 5 static int mod=(int)1e9+7 ; mod (int)1e9+7 (int)1e9 7 static int n n m m k k t t q q x; x public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    } main {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    } PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) Reader in = new Reader(); in new Reader() Main solver = new Main(); solver new Main() solver.solve(out, in) solver.solve solver out in out.flush() out.flush out out.close() out.close out String[] args args void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    } solve {   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    } n = in.nextInt() n in.nextInt() in.nextInt in k = in.nextInt() k in.nextInt() in.nextInt in double ans = 0; ans 0 for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        } {
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        } if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            } i>=k i k ans+= (1.0/(double)n) ans (1.0/(double)n) 1.0 (double)n {
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            } int tmp=i tmp i cnt=0; cnt 0 while(tmp<k){
                    tmp*=2;
                    cnt++;
                } tmp<k tmp k {
                    tmp*=2;
                    cnt++;
                } tmp*=2 tmp 2 cnt++ cnt double res=(1.0/(double)n); res (1.0/(double)n) 1.0 (double)n for(int j=0;j<cnt;j++) res*=(1.0/2.0); int j=0; int j=0; j 0 j<cnt j cnt j++ j++ j res*=(1.0/2.0); res*=(1.0/2.0) res (1.0/2.0) 1.0 2.0 ans+=res ans res out.println(ans) out.println out ans PrintWriter out out Reader in in static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    } Reader private InputStream mIs; mIs private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars public Reader() {
        this(System.in);
    } Reader {
        this(System.in);
    } this(System.in) this System.in System System.in public Reader(InputStream is) {
        mIs = is;
    } Reader {
        mIs = is;
    } mIs = is mIs is InputStream is is public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    } read {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    } if (numChars == -1) {
            throw new InputMismatchException();

    } numChars == -1 numChars -1 1 {
            throw new InputMismatchException();

    } throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        } curChar >= numChars curChar numChars {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        } curChar = 0 curChar 0 try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            } catch (IOException e) {
                throw new InputMismatchException();
            } IOException e {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() {
                numChars = mIs.read(buf);
            } numChars = mIs.read(buf) numChars mIs.read(buf) mIs.read mIs buf if (numChars <= 0) {
                return -1;
            } numChars <= 0 numChars 0 {
                return -1;
            } return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    } nextLine {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    } next {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res double nextDouble()
    {
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } nextLong {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
            sgn = -1;
            c = read();
        } c == '-' c '-' {
            sgn = -1;
            c = read();
        } sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } if (c < '0' || c > '9') {
                throw new InputMismatchException();
            } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } nextInt {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    } int c = read(); c read() read while (isSpaceChar(c)) {
            c = read();
        } isSpaceChar(c) isSpaceChar c {
            c = read();
        } c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
            sgn = -1;
            c = read();
        } c == '-' c '-' {
            sgn = -1;
            c = read();
        } sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } if (c < '0' || c > '9') {
                throw new InputMismatchException();
            } c < '0' || c > '9' c < '0' c '0' c > '9' c '9' {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } isSpaceChar {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    } isEndOfLine {
        return c == '\n' || c == '\r' || c == -1;
    } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9+5;
    static int maxn = (int)1e6+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    }
    
    //<>
    
    
    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
} public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9+5;
    static int maxn = (int)1e6+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    }
    
    //<>
    
    
    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
} Main
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9+5;
    static int maxn = (int)1e6+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        k = in.nextInt();
        
        double ans = 0;
        
        for(int i=1;i<=n;i++){
            if(i>=k) ans+= (1.0/(double)n);
            else{
                int tmp=i,cnt=0;
                while(tmp<k){
                    tmp*=2;
                    cnt++;
                }
                
                double res=(1.0/(double)n);
                for(int j=0;j<cnt;j++) res*=(1.0/2.0);
                ans+=res;
            }
        }
        out.println(ans);
    }
    
    //<>
    
    
    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
}