Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
BCM
User Panel

Posted: 1/3/2007 12:01:03 PM EDT
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 12:07:34 PM EDT
[#2]

Quoted:
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 12:12:38 PM EDT
[#3]

Quoted:
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 12:24:32 PM EDT
[#4]
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 12:24:42 PM EDT
[#5]

Quoted:

Quoted:
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 12:24:43 PM EDT
[#6]
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 12:27:13 PM EDT
[#7]

Quoted:
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 12:29:45 PM EDT
[#8]
Go here. Download "PermuteCombine.exe". You can generate all the numbers into a text file.
Link Posted: 1/3/2007 12:32:50 PM EDT
[#9]

Quoted:
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 12:45:45 PM EDT
[#10]
Link Posted: 1/3/2007 1:03:11 PM EDT
[#11]
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 1:30:43 PM EDT
[#12]
well thank you folks very much!
Link Posted: 1/3/2007 1:36:18 PM EDT
[#13]

Quoted:

Quoted:

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 2:22:18 PM EDT
[#14]

Quoted:
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.
Close Join Our Mail List to Stay Up To Date! Win a FREE Membership!

Sign up for the ARFCOM weekly newsletter and be entered to win a free ARFCOM membership. One new winner* is announced every week!

You will receive an email every Friday morning featuring the latest chatter from the hottest topics, breaking news surrounding legislation, as well as exclusive deals only available to ARFCOM email subscribers.


By signing up you agree to our User Agreement. *Must have a registered ARFCOM account to win.
Top Top