Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
Member Login

Site Notices
1/16/2020 9:48:49 PM
Posted: 1/3/2007 11:01:03 AM EST
had a query passed on to me from one of my bosses at work.

is there any lottery number generators that i could use for a specific task?

for example, something that could generate all possible number combinations of a specific range?

i was asked to find all of the 5 number combinations that could be made from 1-39.

also i need all 6 number combos between 1-42, and all 5 number combos from 1-56.

i dont really know what its for, but i have a hunch my boss is trying to wow some people in an office pool.....
Link Posted: 1/3/2007 11:04:32 AM EST
Link Posted: 1/3/2007 11:07:34 AM EST
[Last Edit: 1/3/2007 11:11:28 AM EST by daemon734]

Originally Posted By DzlBenz:
First link from 1,180,000 results of a Google search for "lottery number generator" seems to be exactly what you're asking for.


haha...imagine that....

thats what i need, but its too limited. i can only create 20 random combinations at a time. im looking for all of them all at once. the only other ones i can find are random generators.
Link Posted: 1/3/2007 11:12:38 AM EST
[Last Edit: 1/3/2007 11:16:22 AM EST by wolfman97]

Originally Posted By daemon734:
had a query passed on to me from one of my bosses at work.

is there any lottery number generators that i could use for a specific task?

for example, something that could generate all possible number combinations of a specific range?

i was asked to find all of the 5 number combinations that could be made from 1-39.

also i need all 6 number combos between 1-42, and all 5 number combos from 1-56.

i dont really know what its for, but i have a hunch my boss is trying to wow some people in an office pool.....


Find all the combinations of 5 numbers from 1-39? That's easy enough to do with the simplest programming. You want a printout of that? At 50 lines per page, it will be just short of 1.5 million pages.

Now if you want the other two, I will have to go to the store for more paper.

Call it roughly 75 million pages for the second one and a little over 9 million for the third. Do you want that Fedex?

Tell me, did your boss also offer to take you on a snipe hunt?
Link Posted: 1/3/2007 11:24:32 AM EST
Just so you know how my page counts were generated, here is the basic formula.

If you have 39 numbers and you are picking 5, then there are 39 possibilities for the first number, times 38 possibilities for the second number, times 37 possibilities for the third number, etc.. Therefore, the total number of possible combinations is:

39*38*37*36*35

Likewise, the number of combinations for the other two is:

42*41*40*39*38*37

56*55*54*53*­52
Link Posted: 1/3/2007 11:24:42 AM EST

Originally Posted By wolfman97:

Originally Posted By daemon734:
had a query passed on to me from one of my bosses at work.

is there any lottery number generators that i could use for a specific task?

for example, something that could generate all possible number combinations of a specific range?

i was asked to find all of the 5 number combinations that could be made from 1-39.

also i need all 6 number combos between 1-42, and all 5 number combos from 1-56.

i dont really know what its for, but i have a hunch my boss is trying to wow some people in an office pool.....


Find all the combinations of 5 numbers from 1-39? That's easy enough to do with the simplest programming. You want a printout of that? At 50 lines per page, it will be just short of 1.5 million pages.

Now if you want the other two, I will have to go to the store for more paper.

Call it roughly 75 million pages for the second one and a little over 9 million for the third. Do you want that Fedex?

Tell me, did your boss also offer to take you on a snipe hunt?


i wasnt thinking of printing it, but thanks

just showing somebody he wants to show that it can be done.
Link Posted: 1/3/2007 11:24:43 AM EST
set nocount on

declare @count int

declare @table table
(
Num int
)

SET @Count = 1
while @count < 40
begin
INSERT INTO @Table
SELECT @Count

SET @COUNT = @COUNT + 1
END

SELECT *
FROM @TABLE T1
CROSS JOIN
@TABLE T2
CROSS JOIN
@TABLE T3
CROSS JOIN
@TABLE T4
CROSS JOIN
@TABLE T5


That'll give you 39 x 5 if you have access to a MSSQL server. Don't be suprised when the DBA/SysAdmin gets pissed at you for thrashing the server. The result set is 90,224,199 records. The others will just piss them off even more...
Link Posted: 1/3/2007 11:27:13 AM EST
[Last Edit: 1/3/2007 11:28:24 AM EST by mr0w1]

Originally Posted By wolfman97:
Just so you know how my page counts were generated, here is the basic formula.

If you have 39 numbers and you are picking 5, then there are 39 possibilities for the first number, times 38 possibilities for the second number, times 37 possibilities for the third number, etc.. Therefore, the total number of possible combinations is:

39*38*37*36*35

Likewise, the number of combinations for the other two is:

42*41*40*39*38*37

56*55*54*53*­52


NM. I'm a moron.
Link Posted: 1/3/2007 11:29:45 AM EST
Go here. Download "PermuteCombine.exe". You can generate all the numbers into a text file.
Link Posted: 1/3/2007 11:32:50 AM EST

Originally Posted By Boomer8450:
set nocount on

declare @count int

declare @table table
(
Num int
)

SET @Count = 1
while @count < 40
begin
INSERT INTO @Table
SELECT @Count

SET @COUNT = @COUNT + 1
END

SELECT *
FROM @TABLE T1
CROSS JOIN
@TABLE T2
CROSS JOIN
@TABLE T3
CROSS JOIN
@TABLE T4
CROSS JOIN
@TABLE T5


That'll give you 39 x 5 if you have access to a MSSQL server. Don't be suprised when the DBA/SysAdmin gets pissed at you for thrashing the server. The result set is 90,224,199 records. The others will just piss them off even more...


I think you need one more thing -- since it is a lottery, the numbers can only be used once per result set. You can't have a result of five 39s, for example.
Link Posted: 1/3/2007 11:45:45 AM EST
Link Posted: 1/3/2007 12:03:11 PM EST
Just use Excel or another spreadsheet program to select random #s. Setting up a series isn't that hard, just use the Help file for guidance.

If you don't want to go to that much trouble, download one of the many macros that work that allow you to specify the size of the series and the range of the pool.
Link Posted: 1/3/2007 12:30:43 PM EST
well thank you folks very much!
Link Posted: 1/3/2007 12:36:18 PM EST

Originally Posted By wolfman97:

Originally Posted By Boomer8450:

set nocount on

declare @count int

CREATE TABLE #table
(
Num int
)

CREATE CLUSTERED INDEX CI ON #TABLE(NUM)

SET @Count = 1
while @count < 40
begin
INSERT INTO #Table
SELECT @Count

SET @COUNT = @COUNT + 1
END

SELECT *
FROM #TABLE T1
JOIN
#TABLE T2
on T1.NUM <> T2.NUM
JOIN
#TABLE T3
on T1.NUM <> T3.NUM
AND T2.NUM <> T3.NUM
JOIN
#TABLE T4
on T1.NUM <> T4.NUM
AND T2.NUM <> T4.NUM
AND T3.NUM <> T4.NUM
JOIN
#TABLE T5
on T1.NUM <> T5.NUM
AND T2.NUM <> T5.NUM
AND T3.NUM <> T5.NUM
AND T4.NUM <> T5.NUM

order by 1, 2, 3, 4, 5

That'll give you 39 x 5 if you have access to a MSSQL server. Don't be suprised when the DBA/SysAdmin gets pissed at you for thrashing the server. The result set is 90,224,199 records. The others will just piss them off even more...


I think you need one more thing -- since it is a lottery, the numbers can only be used once per result set. You can't have a result of five 39s, for example.


Good point. The code is fixed. The result set'll be down to 69,090,840. Still way to big for anything resembling useful.
Link Posted: 1/3/2007 1:22:18 PM EST

Originally Posted By scrum:
Just use Excel or another spreadsheet program to select random #s. Setting up a series isn't that hard, just use the Help file for guidance.

If you don't want to go to that much trouble, download one of the many macros that work that allow you to specify the size of the series and the range of the pool.


Random number generators won't work, because they aren't really random. Even if they were, it would take much more processing before you developed a complete set of all the unique combinations.

Better to just step through the combinations one at a time in order. Like for instance:

39, 38, 37, 36, 35
39, 38, 37, 36, 34
39, 38, 37, 36, 33
39, 38, 37, 36, 32
39, 38, 37, 36, 31

and so forth.
Top Top