import Control.Applicative
import Text.Printf

main :: IO ()
main = solve <$> f >>= printf "%.10f\n"
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> Double
solve [n, k] = f 0 n 1
  where
    f :: Double -> Int -> Int -> Double
    f x m d = let m' = (k + d - 1) `div` d
              in if m == 0
                 then x / (fromIntegral n)
                 else if m < m'
                      then f x m (d * 2)
                      else f (x + (fromIntegral (max 0 (m - m' + 1))) / (fromIntegral d)) (m' - 1) (d * 2)
