#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){
		if(i < k)
			ans += pow(0.5, ceil(log2(k * 1.0 / i)));
		else
			ans += 1;
	}
	cout << setprecision(15) << ans / n;
}






