title: python: random sampling from self-defined probability function
body: <p>I have a piecewise quartic distribution with a probability density function:</p>
  
  <pre><code>p(x)= c(x/a)^2 if 0≤x&lt;a; 
        c((b+a-x)^2/b)^2 if a≤x≤b;
        0 otherwise
  </code></pre>
  
  <p>Suppose c, a, b are known, I am trying to draw 100 random samples from the distribution. How can I do it with numpy/scipy?</p>