// C - Dice and Coin
#include <bits/stdc++.h>
using namespace std;

int main(){
	int N,K; cin>>N>>K;
	double ans = 0;
	for(int n=N; n; --n){
		double part_ans = 1./N;
		for(int k=n; k<K; k*=2) part_ans /= 2;
		ans += part_ans;
	}
	printf("%.12f\n",ans);
}