Home > Algorithms
Random Trial (Posted on 2016-10-02) |
|
Consider a function capable of generating a random integer between 1 and 7 inclusively with equal probability.
Using this, devise an algorithm to generate a random number between 1 and 10 inclusively with equal probability.
Assume that using the 1-7 generator function is pretty time-consuming, so you want to minimize the number of times you are going to use it.
|
Submitted by K Sengupta
|
Rating: 4.0000 (1 votes)
|
|
Solution:
|
(Hide)
|
Refer to the respective solutions submitted by Paul and Brian Smith here and here. |
Comments: (
You must be logged in to post comments.)
|
|
Please log in:
Forums (0)
Newest Problems
Random Problem
FAQ |
About This Site
Site Statistics
New Comments (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On
Chatterbox:
|