n, k = gets.chomp.split(' ').map(&:to_i)

ds = (1..n).map do |i|
  d = 0
  while (k > i * 2 ** d) do
    d = d + 1
  end
  d
end

dmax = ds.max

puts ds.map { |d| 2 ** (dmax - d) }.reduce(:+) / (2 ** dmax * n).to_f
