Actieve werkgever
Given a random generator function that return 0 or 1 with equal probability, create another random function that will return any value between [0,6] with equal probability
Anoniem
int rand6() //random number from 0- 6 { do { r = 4*rand2() + 2*rand2() + rand2(); //uniformly at random from 0 to 7 } while (r >= 7); // in this event, we have to roll again return r ; }