module Main where

import Data.List
import Control.Monad
import Debug.Trace
import Data.Char (isNumber)

solve :: Int -> Int -> Float
solve n k = (/nf) . foldr (+) 0.0 $ map inner  [1..n] where
    nf = fromIntegral n
    kf = fromIntegral k
    inner :: Int -> Float
    inner diceNum = if diceNum >= k then 1 else 
                        (0.5**) . fromIntegral . ceiling $ 
                            logBase 2.0 (kf / (fromIntegral diceNum))

main = do
    s <- getLine
    let [n, k] = read <$> words s :: [Int]
    print $ solve n k
