fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    var sum = 0.0
    if (n >= k) {
        sum += (n - k + 1) / n.toDouble()
    }
    val min = Math.min(n, k - 1)
    var sub = 0.0
    for (i in 1..min) {
        var cnt = 0
        var now = i
        while (now < k) {
            now *= 2
            cnt++
        }
        sub += 1 / Math.pow(2.0, cnt.toDouble())
    }
    sum += sub * (1 / n.toDouble())
    println(sum)
}
