n, k = gets.chomp.split.map(&:to_i)
kn = (Math.log(k) / Math.log(2)).ceil
count = Rational(0, 1)
pos = n + 1
(kn + 1).times do |i|
  nextpos = k.fdiv(2 ** i).ceil
  if pos >= nextpos then
    count += Rational(pos - nextpos, n * (2 ** i))
    pos = nextpos
  end
end
puts count.to_f
