#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	double t,ans=0;
	int n,k,i,now;
	cin>>n>>k;
	for(i=1;i<=n;i++){
		t=1.0/n;now=i;
		while(now<k){
			now*=2;t/=2;
		}
		ans+=t;
	}
	printf("%.12lf",ans);
	return 0;
 } 