generateMarkovStateVector :: Float -> Int -> IO [Float]
generateMarkovStateVector m0 kbar = do
  gen <- newStdGen
  let rand =  take kbar $ randoms gen :: [Int]
  return [r (rand !! x) | x <- [0..kbar-1]]
    where m1 = 2 - m0
          r :: Int -> Float
          r n
              | n `mod` 2 == 0 = m0
              | otherwise = m1

-- Takes MarkovStateVector, GammaVector, m0 and kbar.
-- Returns updated MakovStateVector.
generateMarkovStateVector :: Float -> Int -> IO [Float]
generateMarkovStateVector m0 kbar = do
  gen <- newStdGen
  let rand =  take kbar $ randoms gen :: [Int]
  return [r (rand !! x) | x <- [0..kbar-1]]
    where m1 = 2 - m0
          r :: Int -> Float
          r n
              | n `mod` 2 == 0 = m0
              | otherwise = m1

-- Takes MarkovStateVector, GammaVector, m0 and kbar.
-- Returns updated MakovStateVector.
generateMarkovStateVector m0 kbar = do
  gen <- newStdGen
  let rand =  take kbar $ randoms gen :: [Int]
  return [r (rand !! x) | x <- [0..kbar-1]]
    where m1 = 2 - m0
          r :: Int -> Float
          r n
              | n `mod` 2 == 0 = m0
              | otherwise = m1

-- Takes MarkovStateVector, GammaVector, m0 and kbar.
-- Returns updated MakovStateVector.