const main = (input) => {
  var inputs = input.trim().split(" ");
  var N = Number(inputs[0]), K=Number(inputs[1]);
  var ans = 0;
  var t = Math.log2(K);
  for(var i=N;i>0;i--){
    if(Math.ceil(t-Math.log2(i)) > 0)
      ans += Math.pow(0.5, Math.ceil(t-Math.log2(i)));
    else
      ans += 1;
  }
  console.log(ans/N);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));
