object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, K = sc.nextInt()
  val head :: tail = loop(K, List(K, Int.MaxValue))

  @scala.annotation.tailrec
  def loop(div: Int, acc: List[Int]): List[Int] = {
    if (div == 1) acc else {
      val d = math.ceil(div / 2.0).toInt
      loop(d, d :: acc)
    }
  }

  @scala.annotation.tailrec
  def counts(head: Int, list: List[Int], acc: List[Int]): List[Int] = {
    list match {
      case List() => acc
      case x :: xs if head < N && x <= N => counts(x, xs, (x - head) :: acc)
      case x :: xs if head <= N && N < x => counts(x, xs, (N - head + 1) :: acc)
      case x :: xs => counts(x, xs, 0 :: acc)
    }
  }

  val powCounts = counts(head, tail, List.empty)
  val denominator = powCounts.zipWithIndex.reverse.collectFirst {
    case (count, i) if 0 < count => math.pow(2.0, i) * N
  }.getOrElse(1.0)
  val molecule = powCounts.reverse.zipWithIndex.collect {
    case (count, i) if 0 < count => math.pow(2.0, i) * count
  }.sum
  println(molecule / denominator)
}
