import Numeric

main :: IO ()
main = do
  [n,k] <- map read . words <$> getLine :: IO [Double]
  if n < k
    then putStrLn $ showFFloat (Just 10) ((/n) $ sum $ map (\x -> (0.5)^(ceiling (logBase 2 (k / x)))) [1..n]) ""
    else putStrLn $ showFFloat (Just 10) (((n-k+1)/n) + (sum $ map (\x -> (0.5)^(ceiling (logBase 2 (k / x)))) [1..(k-1)])/n) ""
