n, k = gets.split.map &:to_i

sum = 0
(1..n).each do |i|
  num = Math.log2((k*1.0/i)).ceil
  # puts "if #{i} need #{num}"

  if num > 0
    sum += (0.5)**num/n
  else
    sum += 1.0/n
  end
end
puts sum
