"use strict";
function Main(input) {
  const args = input.split(' ').map(m => parseInt(m));
  const N = args.shift();
  const K = args.shift()
  let aN = N;
  let rK = K;
  let counter = 1;
  let rate = 0;
  while (true) {
    if (aN >= rK) {
      const win = aN - rK + 1;
      rate += (win / (counter * N));
      aN = rK - 1;
    }
    if (rK === 1) {
      break;
    }
    rK = Math.ceil(rK / 2);
    counter = counter * 2;
  }

  console.log(rate);
}
Main('3 10');
