#include<stdio.h>

int main()
{
	int n,k;
	scanf("%d %d",&n,&k);
	double ans=0;
	for (int i=1; i <= n; ++i){
        int t = i, p = 1;
        while (t < k){
            t <<= 1;
            p <<= 1;
        }
        ans += 1.0 / n / p;
	}
	printf("%.12f\n",ans);
	return 0;
}
