object Main extends App {
	import math._
	val Array(n, k) = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	var ans = 0.0
	val tp = test(k)

	if(n >= k){
		ans = (n - k + 1)/n.toDouble
		for(i<-1 to k-1){
			ans += pow(0.5,  tp - test(i))/n.toDouble
		}
	}else{
		for(i<-1 to n){
			ans += pow(0.5, tp - test(i))/n.toDouble
		}
	}

	println(ans)

	def test(x: Int): Double = ceil(log(x)/log(2))

}