Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: How to generate combinations

1. ## How to generate combinations

Hi,

I want to generate a combination of numbers.

Example:Generating all cobination of arranging 5 numbers out of the given 30.

if i have 30 numbers and i pick 5 at a time i can arrange this in 142506 different ways. the numbers 5 and 30 should be dynamic .(If i change 5 or 30 it should be able to generate corresponding number of combinations.)

This is the first 20 combinations.

How can i generate this and dump it into a table in MySQL.

0 1_2_3_4_5_ 0
1 1_2_3_4_6_ 0
2 1_2_3_4_7_ 0
3 1_2_3_4_8_ 0
4 1_2_3_4_9_ 0
5 1_2_3_4_10_ 0
6 1_2_3_4_11_ 0
7 1_2_3_4_12_ 0
8 1_2_3_4_13_ 0
9 1_2_3_4_14_ 0
10 1_2_3_4_15_ 0
11 1_2_3_4_16_ 0
12 1_2_3_4_17_ 0
13 1_2_3_4_18_ 0
14 1_2_3_4_19_ 0
15 1_2_3_4_20_ 0
16 1_2_3_4_21_ 0
17 1_2_3_4_22_ 0
18 1_2_3_4_23_ 0
19 1_2_3_4_24_ 0

Thanks

• Why does this look so familiar?

Oh, I remember now: Generate number sequence.

Was there never a solution to that?

• ## i dint get the solution to this problem.

i want the sequence to be generated and insered into the database.

with this, there was mention of "out of memory", or
PHP script timeout failures.

Unless you have your own server, I don't think it can be done.

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•