N, K = gets.split(' ').map(&:to_i)
p = 0

(1..N).each do |i|
  if K - 1 < i
    p += Rational(1, N)
  else
    rate = (Math.log(10.0) / Math.log(i + 1)).ceil
    p += Rational(1, N) * Rational(1, 2 ** rate)
  end
end

puts p.to_f