I had a discussion with my friend about writing a function (a computer program) which generates 9 values randomly using a random number generator which generates 4 values, i.e I have a PRNG rand(4) {1,2,3,4} , I want to use that to write a PRNG rand(9) {1,2,3,4,5,6,7,8,9}.
My friend suggested that take three instances of rand(4),
where the first rand1(4) is mapped to 0, 9/4/, 9/2, (3/4)x9
the second instance rand2(4) is mapped to 1/4th of the above values
the third instance rand3(4) is mapped to 1/4th of the rand2(4) generator.
Finally, rand(9) is given by round( rand1(4)+rand2(4)+rand3(4) )
How accurate is this?, does the above method truly yield a uniform distribution ?(ignoring the fact that it is a PRNG)
This doesn't precisely answer your question, but an alternative approach would be to use $(\mathrm{rand}(4)-1)+4(\mathrm{rand}(4)-1)+1$ and through out any values greater than $9$, which would give you a uniform distribution.