First find the cumulative distriution function , then find the inverse function of this:

where the domain of is [0,1) and range is

Now generate a random number and has the required distribution, and I am absolutly certain that this is in your notes and or text book.

CB