function Main(input) {
  var N = parseInt(input.split(" ")[0]);
  var K = parseInt(input.split(" ")[1]);
  
  var output = 0;
  if(N >= K){
     output += (N - K + 1) / N;
     console.log(output);
     for(var i = 1; i <= K - 1; i++){
       var count = 0;
       var tmp = i;
       while(true){
          if(tmp >= K){
             break;
          }
         tmp = tmp * 2;
         count++;
       }
       output += (1 / N) * (1 / Math.pow(2, count));
     }
  }else{
    for(var i = 1; i <= N; i++){
       var count = 0;
       var tmp = i;
       while(true){
          if(tmp >= K){
             break;
          }
         tmp = tmp * 2;
         count++;
       }
       output += (1 / N) * (1 / Math.pow(2, count));
     }
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
