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

 More randomness! (Posted on 2003-06-30)
Suppose you have a function (or a magic ball) that is capable of producing a totally random integer between 1 and 5 (inclusive).

Using this, how would you generate a random number (also an integer) between 1 and 7 (inclusive)? (Note that the for the number to be random, all integers between 1 and 7 must have an equal chance of being generated)

Assume that using your 1-5 generator is pretty time-consuming, so you want to minimize the number of times you are going to use it.

 See The Solution Submitted by levik Rating: 4.3333 (6 votes)

Comments: ( You must be logged in to post comments.)
 Subject Author Date re: A binary solution S 2003-10-31 00:22:11 A binary solution Federico Kereki 2003-07-14 15:49:01 Another look at optimality friedlinguini 2003-07-01 06:55:26 re(5): solution friedlinguini 2003-07-01 05:56:59 re(4): solution Charlie 2003-07-01 05:38:24 re(3): solution friedlinguini 2003-07-01 05:17:58 re(2): solution Charlie 2003-06-30 15:14:41 re: solution Gamer 2003-06-30 13:26:10 re(2): Quick and Dirty Solution friedlinguini 2003-06-30 09:12:31 Optimal Solution friedlinguini 2003-06-30 09:04:07 solution Charlie 2003-06-30 08:52:22 re: Quick and Dirty Solution Charlie 2003-06-30 08:50:42 re: Possible Solution friedlinguini 2003-06-30 08:05:55 Possible Solution derek 2003-06-30 07:52:56 impossible? Travis Taylor 2003-06-30 06:59:30 Quick and Dirty Solution friedlinguini 2003-06-30 06:56:18
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 (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information