code: def sample_number_of_occurrences(self, n=1):
          
          # compute cdf from pmf
          cdf = numpy.cumsum(self.probs_occur)
          n_occ = numpy.digitize(numpy.random.random(n), cdf)
          return n_occ
docs: See :meth:`superclass method
          <.rupture.BaseRupture.sample_number_of_occurrences>`
          for spec of input and result values.
  
          Uses 'Inverse Transform Sampling' method.