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

help me find a way to generate all possible combinations in a 6/49 lottory please.

2007-08-11 05:44:48 · 9 answers · asked by ? 1 in Science & Mathematics Mathematics

9 answers

Do you know about "for" loops?

For a=1 to 44
For b=a+1 to 45
For c=b+1 to 46
For d=c+1 to 47
For e=d+1 to 48
For f=e+1 to 49
Print a, b, c, d, e, f
Next f
Next e
Next d
Next c
Next b
Next a

-----
Edit: The poster above me did a better job with the layout. On the other hand, that loop structure will produce results such as "1,1,1,1,1,1", as well as duplicate entries that are permutations of each other. This will produce a list that is roughly 1000 times as long as it needs to be.

The spreadsheet suggestion is interesting. In your top six cells (a1 through f1) enter the numbers 1 through 6.
In cell a2, enter the formula:
"if(b1=45, a1+1, a1)"
In cell b2, enter the formula:
"if(b1=45, a2+1, if(c1=46, b1+1,b1))"
In cell c2, enter the formula:
"if(c1=46, b2+1, if(d1=47, c1+1,c1))"
In cell d2, enter the formula:
"if(d1=47, c2+1, if(e1=48, d1+1,d1))"
In cell e2, enter the formula:
"if(e1=48, d2+1, if(f1=49, e1+1,e1))"
In cell f2, enter the formula:
"if(f1=49, e2+1,f1+1)"

Copy cells a2:f2 down, as far as you can. I would adjust column widths so that every column in the sheet is 3 digits wide.

Copy cells a2:f2 into h1:m2. You'll get errors until you change the references in h1:m1 so they point at the bottom row of columns a:f.

Copy h2:m2 down as far as you can.

Copy columns h:n, and paste them to fill the rest of your document.

I did not put error-catching code into the formulas above, so you will have to look for where the pattern breaks down.

2007-08-11 05:58:13 · answer #1 · answered by Doc B 6 · 2 1

6 FROM 40 9 = 40 9*40 8*40 seven*40 six*40 5*40 4/ (6*5*4*3*2*a million)=13983816 it particularly is exceptionally much 14 million to a million. There of 40 9 procedures of choosing the 1st extensive form, 40 8 procedures of choosing the 2d extensive form(with the aid of fact there are basically 40 8 balls left) and 40 seven procedures of choosing the 0.33 extensive form etc. the subsequent bit is puzzling to hold close. The six numbered balls could have been chosen in anybody of ( 6*5*5*4*3*2*a million) procedures without making one iota of distinction to the effect. The numbers: 7,13,40-one,32,17, 11; could be rearranged 720 diverse way.....yet they're nevertheless the triumphing combination, so the 40 9*40 8*40 seven*40 six*40 5*40 4 could desire to be divided by ability of 720(6!). authentic, that's puzzling to hold close this!

2016-10-10 00:19:36 · answer #2 · answered by ? 4 · 0 0

Think about how many possibilities there are for each number and multiply them together. There are 49 possibilities for the first number. Since a number cannot be chosen more than once, then there is one less chance for each number.

49 x 48 x 47 x 46 x 45 x 44 = 10,068,347,520

2007-08-11 06:01:25 · answer #3 · answered by Larry C 3 · 0 1

Lotto 6/49
Take 6 numbers among 49 numbers

Generaly we have the mathematical formula :

(n)numbers
(k) numbers

= n!
--------------
k!(n-k)!

= 49!
-----------
6! 43!

= 13,983,816 combinations


So, the probability to take 1 ticket of 6 numbers and win
the jackpot is :

P(to win the jackpot) = 1/13,983,816

2007-08-11 07:17:26 · answer #4 · answered by frank 7 · 0 0

You would need a computer program with a loop structure.

For a = 1 to 49
. . For b = 1 to 49
. . . . For c = 1 to 49
. . . . . . For d = 1 to 49
. . . . . . . . For e = 1 to 49
. . . . . . . . . . For f = 1 to 49
. . . . . . . . . . . . Print a & b & c & d & e & f
. . . . . . . . . . Next f
. . . . . . . . Next e
. . . . . . Next d
. . . . Next c
. . Next b
Next a

I don't know where you'd put that. An Excel spreadsheet only has 65,536 lines.

2007-08-11 05:57:18 · answer #5 · answered by TychaBrahe 7 · 0 1

Why do you want ALL combinations?

2007-08-11 05:57:14 · answer #6 · answered by semyaza2007 3 · 0 0

I think that might take you a while!

2007-08-11 06:02:06 · answer #7 · answered by steiner1745 7 · 0 0

You gotta be kidding.

2007-08-11 05:53:09 · answer #8 · answered by Anonymous · 0 0

Oh, sure! Have your pad and pencil ready.....?

2007-08-11 05:53:18 · answer #9 · answered by Anonymous · 0 0

fedest.com, questions and answers