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


void main()
{
  int n, k;
  readf("%d %d\n", &n, &k);
  
  auto result = 0.0;
  foreach (i; 1..n+1) {
    auto div = 1;
    while (k > div * i) {
      div *= 2;
    }
    result += 1 / div.to!double;
  }
  writefln("%.18f", result / n);
}
