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

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

double calc(int n, int k) {
    double ans = 0;
    foreach (i; 1..n+1) {
        if (i >= k) {
            ans += 1.0 / n;
            continue;
        }

        // 得点が K 以上になるまで表を出す
        int score = i;
        double t = 1.0 / n;
        while (score < k) {
            score *= 2;
            t *= 0.5;
        }
        ans += t;
    }
    return ans;
}

void main() {
    int n, k; scan(n, k);
    writefln("%.9f", calc(n, k));
}
