All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Random Trial (Posted on 2016-10-02) Difficulty: 3 of 5
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.)
  Subject Author Date
Some ThoughtsMy approachBrian Smith2016-12-31 23:33:43
One approachPaul2016-10-03 12:46:40
QuestionClarification requestedSteve Herman2016-10-03 10:58:09
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
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:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information