Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to cycle all possible permutations

I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default How to cycle all possible permutations

Ouch!
=COMBIN(64,10)

returns:
151,473,214,816

Unless I misunderstood the question, this seems like too much. Are you
trying to calculate something else?

HTH
Dana DeLouis


"Mark" wrote in message
m...
I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to cycle all possible permutations

1300? you must either be dreaming or mean something entirely different..

=COMBIN(64,10) = 151,473,214,816
=PERMUT(64,10) = 549,666,001,924,301,000

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(Mark) wrote:

I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to cycle all possible permutations

I think there are many more than 1,300...this would generate the #'s
believe but try it first with just the references to variables a and
active as shown

Sub Macro1()
'
z = 1
For a = 1 To 55
For b = a + 1 To 56
'For c = b + 1 To 57
'For d = c + 1 To 58
'For e = d + 1 To 59
'For f = e + 1 To 60
'For g = f + 1 To 61
'For h = g + 1 To 62
'For i = h + 1 To 63
'For j = i + 1 To 64
Cells(z, 1) = a
Cells(z, 2) = b
'Cells(z, 3) = c
'Cells(z, 4) = d
'Cells(z, 5) = e
'Cells(z, 6) = f
'Cells(z, 7) = g
'Cells(z, 8) = h
'Cells(z, 9) = i
'Cells(z, 10) = j
z = z + 1
'Next j
'Next i
'Next h
'Next g
'Next f
'Next e
'Next d
'Next c
Next b
Next a
End Su

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default How to cycle all possible permutations


Dear Duane,

Yep, that looks like exactly what I need, will try it (and cut down on
the numbers which are somewhat larger than I had anticipated). Thanks
very much for your input. Kind regards, Mark


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default How to cycle all possible permutations

"Mark Stephens" wrote...
Yep, that looks like exactly what I need, will try it (and cut down on
the numbers which are somewhat larger than I had anticipated). Thanks
very much for your input. Kind regards, Mark


Somewhat larger than you had anticipated!

You lack mathematical intuition, and any other form of intuition is useless
in mathematics. I'm not trying to be nasty (some would say it's effortless
for me), what I mean is that *you* can't guess about this. You're going to
need to design what you're trying to do carefully.

You'll need to do some heavy adaptation of duane's code because Excel
worksheets have only 16,777,216 cells per worksheet, and cutting down your
originally proposed 10 items from 64 to something that would fit into a
single worksheet will be a challenge since there are more than 28 million
combinations of 9 items out of 32.

So just how much can you whittle away at your original specs?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to cycle all possible permutations

Mark;

You could undoubtedly program a loop to do this, but it would take a
long time to run. When selecting 10 numbers out of 64, there are
151,473,214,816 combinations, and a whopping 549,666,001,924,301,000
permutations (if the order of selection of the 10 numbers matters).
You can derive these numbers using factorials, or do what I did and
use the built in COMBIN and PERMUT excel functions. e.g
=COMBIN(64,10).

You might want to consider if there is another way of tackling your
problem.

David Sauder








(Mark) wrote in message om...
I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default How to cycle all possible permutations

"David Sauder" wrote...
. . . When selecting 10 numbers out of 64, there are
151,473,214,816 combinations, and a whopping 549,666,001,924,301,000
permutations (if the order of selection of the 10 numbers matters).

....

Permutation count incorrect. There are 549,666,001,924,300,800 permutations
of 10 items from 64. Your figure is affected by Excel's 15 decimal digit
precision limit.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default How to cycle all possible permutations

On Sat, 17 Jul 2004 21:57:40 -0700, Harlan Grove wrote:

"David Sauder" wrote...
. . . When selecting 10 numbers out of 64, there are
151,473,214,816 combinations, and a whopping 549,666,001,924,301,000
permutations (if the order of selection of the 10 numbers matters).

...

Permutation count incorrect. There are 549,666,001,924,300,800 permutations
of 10 items from 64. Your figure is affected by Excel's 15 decimal digit
precision limit.


Whoo! 200 less! Now it seems so plausible! <g

Just for kicks, I tested the nested for-next loops - no output, mind
you, just a single variable assignment (o&=a & b & ... & j) and after 60
seconds, it had done something like 10 million. At that rate, it would
only take ~10-1/2 days to finish the whole problem. [rolls eyes]
--
auric underscore underscore at hotmail dot com
*****
There was a war... a war that set the sky on fire.
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to cycle all possible permutations

Auric__ wrote...
Harlan Grove wrote:
"David Sauder" wrote...

...
. . . and a whopping 549,666,001,924,301,000 permutations

...
Permutation count incorrect. There are
549,666,001,924,300,800 permutations. . . .

...

Whoo! 200 less! Now it seems so plausible! <g


Sarcasm aside, problems such as this are better handled with softwar
that uses arbitrary precision. Or did you suppose I calculated th
exact permutation count manually?

Now try storing your intermediate results

--
Message posted from http://www.ExcelForum.com



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default How to cycle all possible permutations

On 17 Jul 2004 15:30:33 -0700, Mark wrote:

I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark


Can you clarify a bit exactly what you want? I know it may seem pretty
clear, but before I post my (pretty ridiculous-looking) reply, I'd like
to verify that I'm not way out in left field.

I'm interested in that 1,300 figure of yours - if I'm correct in my
thinking of what you want, it's closer to a quarter-quintillion... so to
prevent me from wasting time and bandwidth with a possibly "what the
hell is that" answer, please clarify.
--
auric underscore underscore at hotmail dot com
*****
You see, I am over here, on this page where normal people live and work
and play... while you, on the other hand, are waaaay over here, not only
on a different page but quite possibly in a whole other library...
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to cycle all possible permutations

Duane already posted a macro to do it and others have established that the
number would be much larger.

--
Regards,
Tom Ogilvy

"Auric__" wrote in message
...
On 17 Jul 2004 15:30:33 -0700, Mark wrote:

I want to try every combination of 10 numbers out of 1 to 64 (I reckon
there are about 1,300 odd but that is just my intuitive guess rather
than any mathematical knowledge.

I should think there is a for...next loop over a few layers that would
do it but I cannot for the life of me figure it out not having a maths
background. Can anyone help me out?

Kind regards, mark


Can you clarify a bit exactly what you want? I know it may seem pretty
clear, but before I post my (pretty ridiculous-looking) reply, I'd like
to verify that I'm not way out in left field.

I'm interested in that 1,300 figure of yours - if I'm correct in my
thinking of what you want, it's closer to a quarter-quintillion... so to
prevent me from wasting time and bandwidth with a possibly "what the
hell is that" answer, please clarify.
--
auric underscore underscore at hotmail dot com
*****
You see, I am over here, on this page where normal people live and work
and play... while you, on the other hand, are waaaay over here, not only
on a different page but quite possibly in a whole other library...



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default How to cycle all possible permutations

On Sun, 18 Jul 2004 22:27:57 -0400, Tom Ogilvy wrote:

Duane already posted a macro to do it and others have established that the
number would be much larger.


Yes, I know. My @#$% ISP is having "issues" with their servers...
--
auric underscore underscore at hotmail dot com
*****
Before the internet, the village idiot would stay in his own village.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
Permutations Dave Excel Discussion (Misc queries) 5 July 23rd 07 03:06 PM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
Permutations RedChequer Excel Worksheet Functions 9 September 26th 05 03:14 AM
Permutations RedChequer Excel Worksheet Functions 2 September 25th 05 04:05 AM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"