n,k=gets.chomp.split.map { |e| e.to_i }
pos=0.to_f
require'bigdecimal'
require'bigdecimal/util'
if n >= k
  (1..(k - 1)).each do |i|
    c=0
    until i >= k
      i *= 2
      c += 1
    end
    pos += 1r/n *  (1r/2 ** c)
  end
  pos += (n - k + 1) * 1r/n
else
  (1..n).each do |i|
    c=0
    until i >= k
      i *= 2
      c += 1
    end
    pos += 1r/n *  (1r/2 ** c)
  end
end


pos_f=pos.to_f
print pos_f
