import java.util.*


fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)

    var N: Long
    N = sc.nextLong()
    var K: Long
    K = sc.nextLong()
    solveAbc126C(N, K)
}

fun solveAbc126C(N: Long, K: Long) {
    var res = 0.0

    for (i in 1 .. N) {
        var k = 0L
        var s = i

        while (s < K) {
            s *= 2
            k++
        }

        res += Math.pow(0.5, k.toDouble()) / N
    }

    System.out.printf("%.15f\n", res)
}

