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

You are not logged in.

#1 2012-05-01 15:59:26

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

Combination Permutation

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

#2 2012-05-01 18:58:47

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#3 2012-05-01 23:24:31

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

Re: Combination Permutation

Hi bobbym,

Wow... thanks for the info...

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


Cheers


Chris

Offline

#4 2012-05-01 23:27:04

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#5 2012-05-01 23:31:17

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

Re: Combination Permutation

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

#6 2012-05-01 23:32:45

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#7 2012-05-01 23:36:38

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

Re: Combination Permutation

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

#8 2012-05-01 23:37:06

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

No much smaller.


In mathematics, you don't understand things. You just get used to them.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#9 2012-05-01 23:38:42

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

Re: Combination Permutation

Hi b:)obbym,


Then if so how would you go about it ?


Cheers



Chris

Offline

#10 2012-05-01 23:40:53

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#11 2012-05-01 23:45:49

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

Re: Combination Permutation

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

smile

Offline

#12 2012-05-01 23:49:55

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#13 2012-05-02 20:46:03

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

Re: Combination Permutation

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
smile

Offline

#14 2012-05-02 20:49:11

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#15 2012-05-02 21:04:00

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

Re: Combination Permutation

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

smile

Offline

#16 2012-05-02 21:05:31

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#17 2012-05-02 21:08:51

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

Re: Combination Permutation

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

smile

Offline

#18 2012-05-02 21:11:08

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#19 2012-05-20 00:56:15

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 16,621
Website

Re: Combination Permutation

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'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#20 2012-05-20 00:59:09

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#21 2012-05-20 01:08:03

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 16,621
Website

Re: Combination Permutation

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'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#22 2012-05-20 01:12:32

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#23 2012-05-20 01:45:40

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

Re: Combination Permutation

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

Offline

#24 2012-05-20 01:46:14

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 86,228

Re: Combination Permutation

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.
Of course that result can be rigorously obtained, but who cares?
Combinatorics is Algebra and Algebra is Combinatorics.

Offline

#25 2012-05-23 23:03:48

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 16,621
Website

Re: Combination Permutation

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'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

Board footer

Powered by FluxBB