--out of memory ???????????
--考え方はあってると思うがコーディングの技量不足
readInt :: String -> Int
readInt = read
x ? (a,b) = if x then a else b
------
main = do
  s <- map readInt.words<$>getLine
  print $ solve s

solve :: [Int] -> Double
solve [n,k] = (sum list)/(f n) where
  list = map (\a -> 1/(f(2^a))) as
  as = map (calc k) [1..n]
  f n = fromIntegral n

calc :: Int -> Int -> Int
calc k i = end?(0, 1 + next) where
  end = i >= k
  next = calc k 2*i
