#include<cstdio>
using namespace std;
double ans=0;
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		int x=i;
		double t=1.0/n;
		while (x<k) x<<=1,t*=0.5;
		ans+=t;
	}
	printf("%.15lf",ans);
	return 0;
}