|
-
Jun 22nd, 2010, 05:07 PM
#8
Re: Random Unique Lists of 12 Numbers
 Originally Posted by baja_yu
I just refreshed my math studies from college. The number of unique 12 element sequences, without repetition, from a set of 90 elements (1-90) is equal to 90 to the 12th power.
You're actually off by a bit. 90^12 includes permutations with repeating numbers (ie two instances of 12 in teh same sequence), which the OP says is disallowed. However, the OP was vague as to whether or not he wanted permutations or combinations, as the following statement seems to me to be a contradiction:
-Sequence of the numbers in each string matter.So the program cannot create a string identical to another already generated but with a different sequence.
In any case, if he wants permutations, then the total is 90!/(90-12)! = 131,197,375,012,291,112,448,000. If he wants combinations, it is 90!/(12!(90-12)!) = 273,897,571,557,780. However, this does not negate your point that the problem is intractable:
Assuming the lesser of two evils, lets use combinations. Given that each line would take approximately 40 bytes, the output list size would be approximately 10 PETABYTES in length.
I don't know about the OP, but my hard drive doesn't quite hold that. And 6 cores or not, something tells me his classmates will have graduated by the time his program finishes running.
So to the OP, I think one of four things is taking place here:
- You either did not properly communicate to us the actual problem
- Your teacher did not properly communicate the problem with you
- Your teacher is posing a trick question to you
- You're posing a trick question to us
Regardless, your problem as stated has no solution. So if you want any actual help, you'll need to clarify the problem statement. A lot.
Good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|