include Math
# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

nn = inputs[0][0].to_f
kk = inputs[0][1]
kkf = kk.to_f

# body
if $debugFlag
  p nn
  p kk
end

lg2 = log(2)

ans = 0
for i in 1..nn
  if i > kk
    break
  end
  ans += 1.0/(2**((log(kkf/i)/lg2).ceil))
  #p 1.0/(2**((log(kkf/i)/log(2)).ceil))
end

ans = ans / nn
if nn > kk
  ans += (nn - kk)/nn
end

puts ans