import scala.io.StdIn


object Main extends App {
  val Array(n, k)  = StdIn.readLine().split(" ").map(_.toInt)

  val lnOf2 = scala.math.log(2)
  def log2(x: Double): Double = scala.math.log(x) / lnOf2
  def times(k: Int, n: Int) :Int = {
    Math.floor(log2(k / n)).toInt + 1
  }

  def solve(n: Int, k: Int): Double = {
    (1 to n).foldLeft(0.0) {(acc, v) =>

      if (n < k) {
        acc + 1.0 / n * Math.pow((1.0 / 2) , times(k, v))
      } else {
        acc + 1.0 / n
      }
    }
  }


  println(solve(n, k))

}
  

