import java.util.*

fun log(base: Double, a: Double) = Math.log(a) / Math.log(base)

fun main(args : Array<String>) {
  val (n, k) = readLine()!!.split(' ').map(String::toInt)
  val kd = k.toDouble()
  var ans = 0.0
  for (i in 1..n) {
    if (k <= i) {
      ans += 1.0 / n
      continue
    }
    val x = Math.ceil(log(2.0, kd / i))
    ans += Math.pow(0.5, x) / n
  }
  println(ans)
}
