Using 2 dice to generate number in range I've been thinking about this but can't seem to figure it out. I need to pick a random integer between 1 to 50 (inclusive) in such a way that each of the integer in it would be equally likely. I will have to do this using a 8 sided dice and a 15 sided dice. 
I've read somewhat similar questions related to random number generators with dices but I am still confused. I think it is somewhere along the line of partitioning the numbers into sets. Then, I would roll a die, and then, depending on the outcome, decide which die to roll again. 
Can someone help me with this?
 A: A way that comes to mind is rolling the $d8$ as a $d2$, it means only checking if it is odd or even. Odd means $1-25$, even means $26-50$. Now roll the $d15$ as a $d5$ and decide if it is between $1-5$, $6-10$, $11-15$, $16-20$ or $21-25$ (etc in the other case).
Now reroll it as a $d5$ and here's your result.
There is probably a better way in terms of number of rolls, probably not in terms of "how easy is it to remember" (my approach only comes from the fact that $50=5^2 \cdot 2$)
A: http://cseweb.ucsd.edu/classes/fa15/cse21-abc/HW8_F15.pdf
Maybe it is better to ask the TA in tomorrow discussions?
A: Let A be the roll of the 8-die, and B the roll of the 15-die.
If A=1,2, the number is B.
If A=3,4, the number is B+15.
If A=5,6, the number is B+30.
If A=7,8, let C= B+45.
If C$\leq$50, you have your number.
If C>50, let D be another roll of the 15-die.
If D=1,2,3, the number is (C-10).
If D=4,5,6, the number is (C-20).
If D=7,8,9, the number is (C-30).
If D=10,11,12, the number is (C-40).
If D=13,14,15, the number is (C-50).
