# How to simulate the random variable $Y$ using another random variable $X$?

Let $$X$$ be the discrete uniform random variable on taking values in the set $$\{1,2,3,4,5\}.$$ We want to simulate the random variable $$Y$$ which is the discrete uniform random variable taking values in the set $$\{1,2,3,4,5,6,7\}.$$

Let generate_X() be a method which generates the numbers from $$1$$ to $$5$$ with uniform probability. My goal is to use this method to write a method generate_Y() which generates numbers $$1-7$$ with uniform probability.

I am not sure how I can 'stretch' the domain from $$1-5$$ to $$1-7$$. Any ideas will be much appreciated.