Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi all,

I know there are limitations and this may be a far out request (I am aware of the millions of permutations), but I would like to know if someone knows how to produce all possible permutations of 5 numbers using numbers from 1 to 45 as well as applying this to 6 and 7 numbers and dumping in an external database with some sort of query tools to filter certain permutations for further analysis.

Once again I know this is a "big ask" and the files maybe many and very LARGE but

would love to hear back from someone..:)

I look forward in hearing back from you soon.

Regards

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Hi;

For 5 number permutations from 1 to 45 there are 146 611 080 permutations. To print each number would take at least 9 or 10 bytes in a text file. So you are looking at a file that is around 1.3 gigabytes.

For six numbers the file is over 52 gigabytes and for 7 it is slightly more than 2 terabytes.

There are other ways to do an analysis on data like that without generating or storing the entire table. Perhaps if you describe your problem...

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

Wow... thanks for the info...

I will get back to you today or:) tomorrow wiht more specifics

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Hi;

Please describe the problem thoroughly and maybe a shortcut can be found.

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi Bobby,

Just out of curiosity I did a permutation calulation and found that there are

45,379,620 permutations of 7 numbers from 1 to 45 and

8,145,060 permutations of 6 numbers from 1 to 45 and

1,221,759 permutations of 5 numbers from 1 to 45

assuming 1. Order of numbers is not important

2. Cannot repeat a number

Cheers

Chris:)

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Hi;

That is not correct. If order does not count then it is not a permutation.

What you have calculated is a combination.

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

Sorry you are right ... true...

I meant to refer to the different combinations that can be obtained

With those combination results does that still make the task and output

just as daunting ?:)

Regards

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

No much smaller.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi b:)obbym,

Then if so how would you go about it ?

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

The sizes are still too large,

For 5 = 12 MB

For 6 = 97 MB

For 7 = 635 MB

**In mathematics, you don't understand things. You just get used to them.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

Ok ... What I will do is give you more details and

the parameters around what I need to achieve.

I will not be able to do this until sometime

tomorrow, but really look forward in hoping

something can be done

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Okay, see you then. Post it right here when you are ready. Looking forward to it.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

I am back again and still working out the refinement of what I need.

Whilst I am doing so you I would still be interested in creating these

files just the same.

What format would they be in ?

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Hi;

Text files with an extension of .txt. I can not create those files because I can not upload anything that large.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

I understand the technical difficulties

but what about file transfer hositng sites ?

I am a subscriber of

transferbigfiles.com The only

problem is that files must be no more

than 100mb in size and maybe for the 7 numbers

combination file we can break the file up into 7

separate files ?

For 5 = 12 MB

For 6 = 97 MB

For 7 = 635 MB

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

It would take me many hours to upload them. My provider does not give me a lot of upload speed.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**cotech_10****Member**- Registered: 2012-05-01
- Posts: 9

Hi bobbym,

Ok... how long would it take to upload a 12mb file ?

Are you not on ADSL ? Could you write the code

and I could execute the program on my machine ?

Cheers

Chris

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

The 12 MB file might take 400 seconds that is about 7 minutes.

What do you program in?

**In mathematics, you don't understand things. You just get used to them.**

Offline

At first bobbym said :

So you are looking at a file that is around 1.3 gigabytes.

For six numbers the file is over 52 gigabytes and for 7 it is slightly more than 2 terabytes.

How can a file containing only 146 611 800 numbers be so large??

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Each character of the 146 611 800 numbers is one byte of a text file. There are 6 characters per number:

9 x 146 611 800 ≈ 1.3 GB

Of course we did not get into compression because the OP never came back to discuss it further.

**In mathematics, you don't understand things. You just get used to them.**

Offline

What is the meaning of OP?

Would you please give the structure of the code?

*Last edited by Agnishom (2012-05-20 01:09:11)*

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

Hi;

OP = Original poster.

There is no code. This is not a program.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,797

You didn't type it all up yourself,did you? Maybe you just used M and don't cinsider that a code.

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 91,654

There is no code, it is just a small estimate of the size of the files he is trying to make. The calculations are trivial.

**In mathematics, you don't understand things. You just get used to them.**

Offline

I was talking about the code for the program which generated those databases.

Would you show us that?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline