#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, K;
  cin >> N >> K;
  double ans = 0;
  for (int i = 1; i <= N; i++) {
    double tmp = 1.0 / N;
    int j = i;
    while (j < K) j *= 2, tmp /= 2;
    ans += tmp;
  }
  cout << fixed << setprecision(9) << ans << "\n";
}