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

You are not logged in.

|
Options

bobbym
2012-10-29 23:23:44

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

aegiziano1
2012-10-29 21:09:30

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;
}

gAr
2012-02-27 23:06:25

Hi aegiziano1,

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

bobbym
2012-02-27 13:59:42

Hi;

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

aegiziano1
2012-02-27 13:58:21

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?

bobbym
2012-02-27 06:54:52

Break up the solutions? I am not following you.

aegiziano1
2012-02-27 06:49:46

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.

bobbym
2012-02-16 06:38:55

Hi;

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

Labodmin
2012-02-16 06:04:09

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

bobbym
2012-02-15 21:56:09

Hi Labodmin;

There are 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?

Labodmin
2012-02-15 20:04:10

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

bobbym
2012-02-15 09:45:54

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.

Labodmin
2012-02-15 09:40:31

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

bobbym
2012-02-15 09:38:30

Hi;

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

Labodmin
2012-02-15 09:18:43

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