'use strict'

function main(input) {
  input = input.split(' ').map(v => ~~v)
  const n = input[0]
  const k = input[1]
  let rate = 0

  for (let i = 1; i <= n; i++) {
    // let xx = i * 2 * 2
    let tmp = i
    let cnt = 1
    while (k > tmp) {
      tmp = tmp * 2
      cnt++
    }
    // console.log(cnt - 1)
    rate += (1 / n) * Math.pow(0.5, cnt - 1)
  }

  console.log(rate)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
