English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

For example: 3,45, 23,19,and 34 but if posipple i need an exaustive combination. Can a computer do that please assist.

2006-12-06 01:03:09 · 8 answers · asked by wydrinesonjo 1 in Science & Mathematics Mathematics

8 answers

No one could list these here.
There are 2,118,760 5-number COMBINATIONS.
(This is assuming you cant have the same number twice in the list, and that the order of the 5 doesnt matter. (such as a lottery ticket where you pick 5 out of 1-50) )
That is the combination of 50 things taken 5 at a time, sometimes designated C(50, 5).

The formula is:
50!/[45!*5!]
= 50*49*48*47*46 / (5*4*3*2*1)
= 2,118,760
(This wouldn't differentiate between {1,2,3,4,5} and {5,4,3,2,1}: those would both be the same arrangement.)

If the order does matter, but you cant duplicate a number, then the number of arrangements is
P(50,5) = 50!/45! = 50*49*48*47*46
= 254,251,200 5-number PERMUTATIONS.
(This would differentiate between {1,2,3,4,5} and {5,4,3,2,1} as being 2 different arrangements. But {1,1,1,1,1} wouldn't be allowed.)

If you can duplicate, then the number is 50^5
= 312,500,000 5-number SETS
(Any 5 numbers is different. For example, {1,1,1,1,5), {1,1,1,5,1}, {1,1,5,1,1}, {1,5,1,1,1}, and {5,1,1,1,1} are all counted)

A computer could list them, but it would take alot of paper.

2006-12-06 01:08:24 · answer #1 · answered by Scott R 6 · 2 1

Oops, I had originally done it for 6. Sorry.

How many ways can 5 numbers be selected (without replacement) from 50: The first number can be any 1 of 50. That's 50 ways.

Once the first number is fixed, the second number can be any of the remaining 49. That's 49 ways for each of the initial 50 ways. Total = 50*49.

Once the first two numbers are fixed, the third number can be any of the remaining 48. That's 48 ways for each of the (50*49) ways to arrange the first two.

The trend is: 50*49*48*47*46
There are 254,251,200 combinations.

That is, if the order matters, meaning
1,2,3,4,5 is different from 1,2,3,5,4
Set up five variables: A,B,C,D,E

A program with 5 loops should be sufficient:
the outer loop deals with the first number (A), the next one with B and so on. You fix all the values at some minimal values and allow the last loop to go throgh all the possibilities. When the last loop is finished, the next loop goes up one number and the last loop restarts.

One thing is that at each step, the program much check to make sure that the number is not used by a higher-order loop.

Initial condition (for example):
A,B,C,D,E = 1,2,3,4,5

Then let E increase by 1 at each step until it reaches 50. At that point, the program goes to D and increases it by 1.
If E moves from 4 to 5, then 4 is now available for E.
Therefore, each loop must begin at 1 and check:
is 1 already used? in this case, yes, it is used by A, therefore we skip it. When it gets to 4, it will not find it in the higher-order loops so that the combination 1,2,3,5,4 will be a valid one. The next one (1,2,3,5,5) will be skipped as 5 is already used by D).

If you are printing 120 combinations per page, you'll need over 2 million pages. At one page per second (much faster than I can achieve at home), that is a little over 24 days.

At that rate, using 6 numbers instead of 5 would take 3 years.

Have fun. Bring a coffee (or two).

BTW: I voted for PM's answer.

2006-12-06 01:25:26 · answer #2 · answered by Raymond 7 · 0 2

There are literally millions of combinations. Consider that for each combination, you have 50 choices for the first number in the combination, leaving 49 choices for the second number, 48 choices for the third, 47 for the fourth, and 46 for the fifth. That's 50*49*48*47*46 = 254251200. So, to be exact, there are 254,251,200 different combinations (if you consider different orderings of the same numbers to be different combinations... otherwise, you have to divide that by 5!, leaving you with only 2,118,760 combinations).

A computer program can be written to simply generate all of the combinations in sequence, but it would take a VERY long time with a lot of output to read/store. Here's some C code that will do it:

for (int a=1; a<=50; a++) {
for (int b=1; b<=50; b++) {
if (a == b) continue;
for (int c=1; c<=50; c++) {
if (a == c) continue;
if (b == c) continue;
for (int d=1; d<=50; d++) {
if (a == d) continue;
if (b == d) continue;
if (c == d) continue;
for (int e=1; e<=50; e++) {
if (a == e) continue;
if (b == e) continue;
if (c == e) continue;
if (d == e) continue;
cout << (a + ", " + b + ", " + c + ", " + d + ", " + e);
}
}
}
}
}

2006-12-06 01:19:15 · answer #3 · answered by PM 3 · 1 2

50 x 49 x 48 x 47 x 46 = go n press ur calculator..tats d answer..i find dis way better than the factorial [!] method as it uses more logic and pure understanding..:

say u wanna arrange 5 numbers _ _ _ _ _

1-50 so there are 50 numbers to use

in d first blank there's 50 possibilities so u put 50 in there

so logically, d next blank would be 49 [49 possibilities]...cuz u already hav a number in d 1st blank..

n so forth...50 49 48 47 46...multiply those numbers n u get ur answer..tat simple..

hope i helped..gud luck! =)

p/s..answer: 254,251,200

2006-12-06 01:16:17 · answer #4 · answered by rockmylife 2 · 0 2

well i dont know. but i can find the number of possible arrangements.

1-50 has 50 numbers right.

so 50P5 = 254,251,200

2006-12-06 01:08:52 · answer #5 · answered by maczh2002 2 · 0 2

A very simple BASIC program would be

FOR A=1 TO 50
FOR B=1 TO 50
FOR C=1 TO 50
FOR D=1 TO 50
FOR E=1 TO 50
PRINT A;B;C;D;E
NEXT E
NEXT D
NEXT C
NEXT B
NEXT A

There's probably neater ways of doing it but this will work. You can find a QBasic compiler here: http://www.qbasic.com/

2006-12-06 01:11:03 · answer #6 · answered by Status: Paranoia 4 · 0 3

it must use the permutative method... i've got not enough time to do becoz i think there is too much number had to be arranged...

ask ur teacher

2006-12-06 01:16:51 · answer #7 · answered by bay-from-indonesia 1 · 0 3

sorry i cant

2006-12-06 01:04:07 · answer #8 · answered by Anonymous · 0 4

fedest.com, questions and answers