toFloat :: Int -> Float
toFloat = fromRational . toRational

solve :: Float -> Float -> Float -> Float
solve i n k
  | i > n = 0
  | i >= k = n - i + 1
  | otherwise = (0.5 ^ (fromIntegral (ceiling (logBase 2 (k/i))))) + solve (i + 1) n k
 

main = do
    [n,k] <- map (toFloat.read) . words <$> getLine
    print $ (solve 1.0 n k) / n
