import Data.List

main = do
  [n, k] <- map read . words <$> getLine
  let me = [n, (n - 1)..1]
  let as = group $ map (func 0 k) me
  let zipedAz = zip (map head as) (map length as)
  let answer = solver zipedAz
  print zipedAz
  print (answer / fromIntegral n)

func :: Int -> Int -> Int -> Int
func n k me
  | me >= k = n
  | me < k  = func (n + 1) k (me * 2)

solver :: [(Int, Int)] -> Double
solver x = foldr (\ x -> (+) ((0.5 ^ (fromIntegral $ fst x) * (fromIntegral $ snd x)))) 0 x