fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(' ').map(String::toInt)
    val log2 = Math.log(2.0)
    val p = (1..Math.min(n, k)).map { 1 / Math.pow(2.0, Math.ceil(Math.log(k.toDouble() / it) / log2)) }.sum()
    if (k <= n) {
        println(p / n + (n - k).toDouble() / n)
    } else {
        println(p / n)
    }
}
