

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var K = parseInt(input[0].split(" ")[1]);
  var d = new Array([0,K]);
  for(var i=1;K>=1;i++){
    K=K/2;
    d.push([i,Math.ceil(K)]);
  }
  var ans=0;
  var N2=N;
  for(var i=0;i<d.length;i++){
    if(N>=d[i][1]){
      p=(N-d[i][1]+1)*(1/N2)*Math.pow(1/2,d[i][0]);
      ans+=p;
      N=N-(N-d[i][1]+1);
    }
  }
  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));