#include <stdio.h>
int main(void){
  int n,k,i,o;
  double t,ans=0;
  scanf("%d%d",&n,&k);
  for (i=1;i<=n;i++){
    o=i;
    t=1;
    while (o<k) {
      o*=2;
      t/=2;
    }
    ans+=t;
  }
  ans/=n;
  printf("%.12lf\n",ans);
  return 0;
}