<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sample_outcomes(probs, n):
 """ random samples. :param list probs: A list of probabilities. :param Number n: The number of random samples to draw. :rtype: numpy.ndarray """

    dist = np.cumsum(probs)
    rs = np.random.rand(n)
    return np.array([(np.where(r < dist)[0][0]) for r in rs])