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

You are not logged in.

#26 2012-02-14 08:18:44

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi;

The numbers am looking to perm will be like

Unless you are through with the question I want to know exactly what numbers you want to permute.

As I understand it you do not want 2 in the same row.


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

#27 2012-02-14 10:18:43

Labodmin
Member
Registered: 2012-02-13
Posts: 6

Re: Permutation Generator

Hi they are 1,2,3,4,5,6 on the vertical row and W D A on the horizontal row
what you did looks similar
Its like football pool games where 1,2,3,4,5,6 will be the teams

Eg will be


     W   D   A
1    x
2    x
3         x
4                x 
5         x
6                x
Many thanks

Offline

#28 2012-02-14 10:38:30

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi;

Okay, I will work on it and post if I have a solution.


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

#29 2012-02-14 10:40:31

Labodmin
Member
Registered: 2012-02-13
Posts: 6

Re: Permutation Generator

Hi Bobbym
What you have send looks good.
l will change it round to suit what l need it for.
What formula did you use so that l can follow the same trend to organise larger number like 1,2,3,4,5,6,7,8,9,10?
Best regards

Offline

#30 2012-02-14 10:45:54

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi;

No formula. And for bigger numbers there may be a lot more permutations, thousands or millions. A formula would only tell how many there are, it would not show what they are.

Using a method, I come up with

That means there are 524880 ways to permute those 6 numbers in those 18 boxes.


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

#31 2012-02-14 21:04:10

Labodmin
Member
Registered: 2012-02-13
Posts: 6

Re: Permutation Generator

hello, l am looking at the first numbers you sent:
0  0  1
0  0  2
0  0  3
which were all 162 ways.

if l was to do the same for 1,2,3,4,5,6 how many ways will it be all together and can you also help me organise them please?
Many thanks

Offline

#32 2012-02-14 22:56:09

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi Labodmin;

There are icon_arrow.gif 524880 ways to arrange them! That is a very large number.

That is for your problem in post #27. It is quite easy to get the number but to arrange them will require a computer. Do you program?


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

#33 2012-02-15 07:04:09

Labodmin
Member
Registered: 2012-02-13
Posts: 6

Re: Permutation Generator

Hi many thanks for the reply.
I don't program .

Offline

#34 2012-02-15 07:38:55

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi;

Okay, let me know if I can do something else.


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

#35 2012-02-26 07:49:46

aegiziano1
Member
Registered: 2012-02-07
Posts: 10

Re: Permutation Generator

Hi gAr and bobbym,

Sorry for such a late response.. After our last postings (post 22) I have been crammed with Finals, Papers, Projects and what not.... The project that you guys helped me on was a success , thanks again!...
.. I was wondering (just out of curiosity) since the file would be tremendously large to show all possible solutions, if there is an actual way to break up the solutions to accommodate the file size.

Last edited by aegiziano1 (2012-02-26 07:50:49)

Offline

#36 2012-02-26 07:54:52

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Break up the solutions? I am not following you.


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

#37 2012-02-26 14:58:21

aegiziano1
Member
Registered: 2012-02-07
Posts: 10

Re: Permutation Generator

I mean instead of the list of 1,748,533 solutions on one single file, is it possible to put the soultions on multiple files?

Offline

#38 2012-02-26 14:59:42

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

Hi;

I would say so. You could also zip it up to make it smaller.


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

#39 2012-02-27 00:06:25

gAr
Member
Registered: 2011-01-09
Posts: 3,479

Re: Permutation Generator

Hi aegiziano1,

As a 7z compressed tarball, it's around 514KiB.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#40 2012-10-28 22:09:30

aegiziano1
Member
Registered: 2012-02-07
Posts: 10

Re: Permutation Generator

hey guys ,

I was trying to figure out how to write the code to generate a list for the following code.... let me know if you guys can help?

the question was pick 5 number 1-56 ( No repeats) and an extra number 1-52

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    int cnt = 0;
    int x1,x2,x3,x4,x5,y;
    for (x1=1;x1<57;x1++)
    {
        for (x2=x1+1;x2<57;x2++)
        {
            for (x3=x2+1;x3<57;x3++)
            {
                for (x4=x3+1;x4<57;x4++)
                {
                    for (x5=x4+1;x5<57;x5++)
                    {
                        for (y=1;y<53;y++)
                        {
                            if (x1+x2+x3+x4+x5+y == 147)
                            {
                                cnt++;
                            }
                        }
                    }
                }
            }
        }
    }
    printf("%d",cnt);
    system("PAUSE");
    return 0;
}

Offline

#41 2012-10-29 00:23:44

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 90,972

Re: Permutation Generator

What answer did you get when you put a counter in the middle of that?


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

Board footer

Powered by FluxBB