import java.util.*
fun main(args:Array<String>) {
   val (N, K)  = readLine()!!.split(" ").map(String::toInt)
  var prob = if(N>=K) {(N-(K-1)).toDouble()} else {0.0}
  for(n in 1..arrayOf(N,K-1).min()!!) {
      val num = Math.ceil(Math.log(K.toDouble()/ n.toDouble()) / Math.log(2.0)) 
      prob+= Math.pow(0.5,num)
  }
  prob /= N.toDouble()
  println(prob)
}