#include<bits/stdc++.h>
using namespace std;
int cnt=0;
double ans;
int main()
{
	int i,j,n,k;
	ans=cnt;
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;i++){
		double tmp=1.0/n;
		int x=i;
		while(x<k){
			x*=2;
			tmp/=2;
		}
		ans+=tmp;
	}
	printf("%.12f\n",ans);
	return 0;
 } 