fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map(String::toInt)
    var ans = 0.0
    if (N >= K) ans += N - K + 1
    var n = 1.0
    var k = K
    while (k > 1) {
        val l = (k + 1) / 2
        if (N >= l) {
            ans += (Math.min(N + 1, k) - l) / Math.pow(2.0, n)
        }
        n += 1.0
        k = l
    }
    println(ans / N)
}