main = do
  [n,k] <- map read . words <$> getLine
  let a = map (f 0) [g k x | x <- [1..n]]
  print $ average a
f :: Int -> Int -> Double
f z y
  | 2^z < y = f (z+1) y
  | otherwise = 0.5 ^^ z
g k w
  | k `mod` w == 0 = k `div` w
  | otherwise = k `div` w + 1
average :: (Real a) => [a] -> Double
average xs = realToFrac (sum xs) / fromIntegral (length xs)
