Can anyone help me out with a little project?
I need to be able to create a number combination generator that I can give a set of numbers to and it will return all possilble number combinations.
Is there any simple way of doing this?
Can anyone help me out with a little project?
I need to be able to create a number combination generator that I can give a set of numbers to and it will return all possilble number combinations.
Is there any simple way of doing this?
not hard to do, but one or two things need clarification. Let's assume that there are 3 numbers and they are 1, 2, 3
Then 123 would be an obvious combination, as would 213 or 321
1. are all numbers integers?
2. do you wish to include any combination or only combinations with all three numbers? For example, is 12 an acceptable combination?
3. do you wish to create combinations with or without replacement, i.e., is 111 or 222 or 333 an acceptable combination?
thankyou for your reply and questions. To clarify further, if I had five columns of digits (all integers) and needed all possible combinations. Let's say I had the the following integers in column one. (1,3,5). In column two I had (3,5,7). In column three I had (5,7,9,). In column four I had (7,9,11). In column five (9,11,13).
I need all combinations that are in consecutive order from least to greatest. For example, combinations such as:
1,3,5,7,9
1,5,9,11,13
are allowed
5,3,7,11,13
5,5,9,11,13
are not allowed
no two numbers are allowed to repeat and any number to the right is not allowed to be less in value to the one to the left.
Again, any help would be greatly appreciated.
Thankyou
Thanks, that clears up your problem quite a bit. One final question ...
In your reply, you define 5 sequences, (1,3,5), (3,5,7), (5,7,9,), (7,9,11), and (9,11,13). That yields 7 unique numbers: 1, 3, 5, 7, 9, 11, and 13. You then indicate that the combination 1,3,5,7,9 and the combination 1,5,9,11,13 are acceptable. Both of these happen to be 5 numbers long. So if I understand the logic, then any monatonically increasing sequence of length 5 drawn from the original unique numbers is acceptable; and other acceptable combinations would include:
1, 3, 5, 9, 11
1, 3, 5, 9, 13
3, 5, 7, 9, 11
3, 5, 7, 9, 13
etc.
Correct?
That's correct. Also, I didn't mention before but you probably realized, all number sequences are five digits in length.
Thank you.
I suspect you meant 5 numbers in length, not digits.Originally Posted by yungexec
Attached is a zipped spreadsheet that should do what you want.
Let me know if this works ...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks