import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

long pow(long x, long k) {
    if (k == 0) return 1;
    if (k % 2 == 0) return pow(x * x, k / 2);
    return x * pow(x, k - 1);
}

double calc(int n, int k) {
    double ans = 0;
    for (int i = 1; i <= n; i++) {
        if (i >= k) {
            ans += 1.0 / n;
        }
        else {

            long lo = 0;
            long hi = 20;
            long best = hi;
            while (lo <= hi) {
                long m = (lo + hi) / 2;
                if (i * pow(2, m) >= k) {
                    hi = m - 1;
                    best = min(best, m);
                }
                else {
                    lo = m + 1;
                }
            }
            assert(best != hi);

            ans += (1.0 / n) * (1.0 / pow(2, best));
        }
    }
    return ans;
}

void main() {
    auto nk = readints;
    int n = nk[0], k = nk[1];
    writefln("%.9f", calc(n, k));
}
