Acceptance - rejection method

Discussion in 'CT6' started by phos2, Sep 4, 2017.

  1. phos2

    phos2 Member

    Having troubles understanding the point of this method.

    Questions usually give us random numbers to generate x from h(x), we then this x to find g(x) and compare g(x) to another random number from U(0,1). If it is greater than we "accept" this value of x.

    Why are comparing g(x) to another set of random numbers? The second generated number has no relevance to either g or h(x), so what are we exactly doing? I understand g(x) gives us the probability of us accepting x, but say we generate a x which has g(x) = 0.99, then we so happen to generate 0.991 from U(0,1) in this case the "algorithm" would say we reject this value of x, but in reality you'd probably accept it.

    Just lacking some intuition about the method, specifically why we consider another set of random numbers to compare with g(x).
     
  2. John Lee

    John Lee ActEd Tutor Staff Member

    The question is: how do we program a computer to accept 99% of a number?
    Answer: choose a random number from U(0,1) - if it's from 0-0.99 accept, if it's between 0.99-1 reject.
    Long term we will keep 99% of that number.
     

Share This Page