- Home
- Premium Memberships
- Lottery Results
- Forums
- Predictions
- Lottery Post Videos
- News
- Search Drawings
- Search Lottery Post
- Lottery Systems
- Lottery Charts
- Lottery Wheels
- Worldwide Jackpots
- Quick Picks
- On This Day in History
- Blogs
- Online Games
- Premium Features
- Contact Us
- Whitelist Lottery Post
- Rules
- Lottery Book Store
- Lottery Post Gift Shop
The time is now 4:07 am
You last visited
April 24, 2024, 11:31 pm
All times shown are
Eastern Time (GMT-5:00)
FormulaPrev TopicNext Topic
-
Hello lottery mathematician. Could you help me on a formula where I can remove the number of combination for straight combination in Lotto
For example in a 6/42 Lotto game which has a Total Combinations of 5,245,786
If you eliminate 1,2,3,4,5,6 combination the total combinations would be 5,245,785
My purpose is to reduce the number of combination
Thank you very much
-
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineWhat you might need is a way to convert a combination to an index number and back.
We have a Macro Excel sheet with a function for converting any combination to an index number and one for the reverse operation.
For Excel 2003 and above
http://www.jadexcode.com/Excel/CombinatorialIndex.xls
ftp://www.jadexcode.com/Excel/CombinatorialIndex.xls
For Excel 2007 and above
http://www.jadexcode.com/Excel/CombinatorialIndex.xlsm
ftp://www.jadexcode.com/Excel/CombinatorialIndex.xlsmIndex Value ⇒ Index to Combination ⇒ Combination Separated ⇒ Combination to Index 1 01 02 03 04 05 06 1 2 3 4 5 6 1 2 01 02 03 04 05 07 1 2 3 4 5 7 2 3 01 02 03 04 05 08 1 2 3 4 5 8 3 400 01 02 03 04 17 39 1 2 3 4 17 39 400 500 01 02 03 04 22 29 1 2 3 4 22 29 500 600 01 02 03 04 28 30 1 2 3 4 28 30 600 5245786 37 38 39 40 41 42 37 38 39 40 41 42 5245786 4970739 16 18 26 27 33 40 16 18 26 27 33 40 4970739 2845703 05 16 19 26 28 29 5 16 19 26 28 29 2845703 565432 01 11 17 21 30 33 1 11 17 21 30 33 565432 285273 01 05 12 24 38 41 1 5 12 24 38 41 285273 5160055 20 24 25 31 39 40 20 24 25 31 39 40 5160055 3535127 07 15 21 25 28 29 7 15 21 25 28 29 3535127 3612379 07 24 27 29 34 42 7 24 27 29 34 42 3612379 2302424 04 11 17 32 41 42 4 11 17 32 41 42 2302424 4487671 11 21 27 32 41 42 11 21 27 32 41 42 4487671 3759255 08 13 14 17 28 36 8 13 14 17 28 36 3759255 3073279 06 10 14 16 19 31 6 10 14 16 19 31 3073279 733528 01 22 31 35 40 42 1 22 31 35 40 42 733528 229241 01 04 15 26 27 42 1 4 15 26 27 42 229241 397337 01 07 12 36 39 41 1 7 12 36 39 41 397337 4520820 12 13 18 19 33 39 12 13 18 19 33 39 4520820 3610716 07 23 32 34 36 41 7 23 32 34 36 41 3610716 416893 01 07 20 27 28 30 1 7 20 27 28 30 416893 If you don't want to download the files, here is the VB Code for each of the functions.
____________________________________________________________________________________________________
Function Fact(ByVal N As Integer) As Double
If (N <= 1) Then
Fact = 1
Else
Fact = N * Fact(N - 1)
End If
End Function
Function Perm(ByVal N As Integer, ByVal R As Integer) As Double
Dim a As Integer
Dim b As Double
b = 1
If (N < R) Then
Perm = 0
Else
For a = (N - (R - 1)) To N
b = b * a
Next a
Perm = b
End If
End Function
Function Comb(ByVal N As Integer, ByVal R As Integer) As Double
If (N < R) Then
Comb = 0
Else
Comb = Perm(N, R) / Fact(R)
End If
End Function
Function Cdist(ByVal N As Integer, ByVal R As Integer, ByVal C As Integer, ByVal Z As Integer) As Double
If ((Z < C) Or (Z > (N - (R - C))) Or (Z > N) Or (C > R) Or (N < 1) Or (R < 1) Or (C < 1) Or (Z < 1)) Then
Cdist = 0
Else
Cdist = Comb((Z - 1), (C - 1)) * Comb((N - Z), (R - C))
End If
End Function
Function fColumnSum(ByVal N As Integer, ByVal R As Integer, ByVal Z As Integer) As Double
Dim a As Integer
Dim ColumnSum As Double
If (Z < 1) Then
fColumnSum = 0
ElseIf ((Z >= 1) And (Z < (N - (R - 1)))) Then
ColumnSum = 0
For a = 1 To Z
ColumnSum = ColumnSum + Cdist(N, R, 1, a)
Next a
fColumnSum = ColumnSum
ElseIf (Z >= (N - (R - 1))) Then
fColumnSum = Comb(N, R)
End If
End Function
Function Index2Combin(ByVal N As Integer, ByVal R As Integer, ByVal I As Long) As String
Dim a, b, Combination(), Z As Integer
Dim C, J As Long
ReDim Combination(R)
Dim tmpString, CombinFormat As String
Dim NumberFound As Boolean
tmpString = ""
CombinFormat = ""
C = Comb(N, R)
J = I
J = J - 1
Z = 0
b = Len(Format(N, "0"))
For a = 1 To b
CombinFormat = CombinFormat & "0"
Next a
For a = 1 To R
If ((I >= 1) And (I <= C)) Then
If (a = 1) Then
Combination(a) = 1
Else
Combination(a) = Combination(a - 1) + 1
End If
NumberFound = False
Do
Select Case (J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1))))
Case Is < 0
Combination(a) = Combination(a) - 1
NumberFound = True
Case Is = 0
NumberFound = True
Case Is > 0
Combination(a) = Combination(a) + 1
End Select
Loop Until NumberFound
J = J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1)))
Z = Combination(a)
Else
Combination(a) = 0
End If
tmpString = tmpString & Format(Combination(a), CombinFormat)
If (a < R) Then tmpString = tmpString & " "
Next a
Index2Combin = tmpString
End Function
Function Combin2Index(ByVal N As Integer, ByVal R As Integer, ByVal theRange As Range) As Double
Dim a As Integer
Dim fSum As Double
Dim NotInAscendingOrder, NotInPool As Boolean
NotInAscendingOrder = False
NotInPool = False
If ((theRange.Rows.Count <> 1) Or (theRange.Columns.Count <> R)) Then
Combin2Index = -1
Exit Function
End If
For a = 1 To R
If (a < R) Then
If (theRange.Cells(1, a) >= theRange.Cells(1, (a + 1))) Then
NotInAscendingOrder = True
End If
End If
If ((theRange.Cells(1, a) < 1) Or (theRange.Cells(1, a) > N)) Then
NotInPool = True
End If
Next a
If (NotInAscendingOrder Or NotInPool) Then
Combin2Index = -1
Exit Function
End If
fSum = 1
For a = 1 To R
If (a = 1) Then
fSum = fSum + fColumnSum(N, R, (theRange.Cells(1, 1) - 1))
Else
fSum = fSum + fColumnSum((N - theRange.Cells(1, (a - 1))), (R - (a - 1)), (theRange.Cells(1, a) - (theRange.Cells(1, (a - 1)) + 1)))
End If
Next a
Combin2Index = fSum
End Function____________________________________________________________________________________________________
The One Over None
I Know... -
Quote: Originally posted by godlike00 on Jun 5, 2015
Hello lottery mathematician. Could you help me on a formula where I can remove the number of combination for straight combination in Lotto
For example in a 6/42 Lotto game which has a Total Combinations of 5,245,786
If you eliminate 1,2,3,4,5,6 combination the total combinations would be 5,245,785
My purpose is to reduce the number of combination
Thank you very much
You have 37 combinations that meet your straight combination criteria.
1, 2, 3, 4, 5, 6
2, 3, 4, 5, 6, 7
3, 4, 5, 6, 7, 8
4, 5, 6, 7, 8, 9
5, 6, 7, 8, 9, 10
6, 7, 8, 9, 10, 11
7, 8, 9, 10, 11, 12
8, 9, 10, 11, 12, 13
9, 10, 11, 12, 13, 14
10, 11, 12, 13, 14, 15
11, 12, 13, 14, 15, 16
12, 13, 14, 15, 16, 17
13, 14, 15, 16, 17, 18
14, 15, 16, 17, 18, 19
15, 16, 17, 18, 19, 20
16, 17, 18, 19, 20, 21
17, 18, 19, 20, 21, 22
18, 19, 20, 21, 22, 23
19, 20, 21, 22, 23, 24
20, 21, 22, 23, 24, 25
21, 22, 23, 24, 25, 26
22, 23, 24, 25, 26, 27
23, 24, 25, 26, 27, 28
24, 25, 26, 27, 28, 29
25, 26, 27, 28, 29, 30
26, 27, 28, 29, 30, 31
27, 28, 29, 30, 31, 32
28, 29, 30, 31, 32, 33
29, 30, 31, 32, 33, 34
30, 31, 32, 33, 34, 35
31, 32, 33, 34, 35, 36
32, 33, 34, 35, 36, 37
33, 34, 35, 36, 37, 38
34, 35, 36, 37, 38, 39
35, 36, 37, 38, 39, 40
36, 37, 38, 39, 40, 41
37, 38, 39, 40, 41, 42
I'm probably here unless I'm not.
Dreaming would be a perfectly useless function if it's only purpose was to entertain. -
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineQuote: Originally posted by JADELottery on Jun 5, 2015
What you might need is a way to convert a combination to an index number and back.
We have a Macro Excel sheet with a function for converting any combination to an index number and one for the reverse operation.
For Excel 2003 and above
http://www.jadexcode.com/Excel/CombinatorialIndex.xls
ftp://www.jadexcode.com/Excel/CombinatorialIndex.xls
For Excel 2007 and above
http://www.jadexcode.com/Excel/CombinatorialIndex.xlsm
ftp://www.jadexcode.com/Excel/CombinatorialIndex.xlsmIndex Value ⇒ Index to Combination ⇒ Combination Separated ⇒ Combination to Index 1 01 02 03 04 05 06 1 2 3 4 5 6 1 2 01 02 03 04 05 07 1 2 3 4 5 7 2 3 01 02 03 04 05 08 1 2 3 4 5 8 3 400 01 02 03 04 17 39 1 2 3 4 17 39 400 500 01 02 03 04 22 29 1 2 3 4 22 29 500 600 01 02 03 04 28 30 1 2 3 4 28 30 600 5245786 37 38 39 40 41 42 37 38 39 40 41 42 5245786 4970739 16 18 26 27 33 40 16 18 26 27 33 40 4970739 2845703 05 16 19 26 28 29 5 16 19 26 28 29 2845703 565432 01 11 17 21 30 33 1 11 17 21 30 33 565432 285273 01 05 12 24 38 41 1 5 12 24 38 41 285273 5160055 20 24 25 31 39 40 20 24 25 31 39 40 5160055 3535127 07 15 21 25 28 29 7 15 21 25 28 29 3535127 3612379 07 24 27 29 34 42 7 24 27 29 34 42 3612379 2302424 04 11 17 32 41 42 4 11 17 32 41 42 2302424 4487671 11 21 27 32 41 42 11 21 27 32 41 42 4487671 3759255 08 13 14 17 28 36 8 13 14 17 28 36 3759255 3073279 06 10 14 16 19 31 6 10 14 16 19 31 3073279 733528 01 22 31 35 40 42 1 22 31 35 40 42 733528 229241 01 04 15 26 27 42 1 4 15 26 27 42 229241 397337 01 07 12 36 39 41 1 7 12 36 39 41 397337 4520820 12 13 18 19 33 39 12 13 18 19 33 39 4520820 3610716 07 23 32 34 36 41 7 23 32 34 36 41 3610716 416893 01 07 20 27 28 30 1 7 20 27 28 30 416893 If you don't want to download the files, here is the VB Code for each of the functions.
____________________________________________________________________________________________________
Function Fact(ByVal N As Integer) As Double
If (N <= 1) Then
Fact = 1
Else
Fact = N * Fact(N - 1)
End If
End Function
Function Perm(ByVal N As Integer, ByVal R As Integer) As Double
Dim a As Integer
Dim b As Double
b = 1
If (N < R) Then
Perm = 0
Else
For a = (N - (R - 1)) To N
b = b * a
Next a
Perm = b
End If
End Function
Function Comb(ByVal N As Integer, ByVal R As Integer) As Double
If (N < R) Then
Comb = 0
Else
Comb = Perm(N, R) / Fact(R)
End If
End Function
Function Cdist(ByVal N As Integer, ByVal R As Integer, ByVal C As Integer, ByVal Z As Integer) As Double
If ((Z < C) Or (Z > (N - (R - C))) Or (Z > N) Or (C > R) Or (N < 1) Or (R < 1) Or (C < 1) Or (Z < 1)) Then
Cdist = 0
Else
Cdist = Comb((Z - 1), (C - 1)) * Comb((N - Z), (R - C))
End If
End Function
Function fColumnSum(ByVal N As Integer, ByVal R As Integer, ByVal Z As Integer) As Double
Dim a As Integer
Dim ColumnSum As Double
If (Z < 1) Then
fColumnSum = 0
ElseIf ((Z >= 1) And (Z < (N - (R - 1)))) Then
ColumnSum = 0
For a = 1 To Z
ColumnSum = ColumnSum + Cdist(N, R, 1, a)
Next a
fColumnSum = ColumnSum
ElseIf (Z >= (N - (R - 1))) Then
fColumnSum = Comb(N, R)
End If
End Function
Function Index2Combin(ByVal N As Integer, ByVal R As Integer, ByVal I As Long) As String
Dim a, b, Combination(), Z As Integer
Dim C, J As Long
ReDim Combination(R)
Dim tmpString, CombinFormat As String
Dim NumberFound As Boolean
tmpString = ""
CombinFormat = ""
C = Comb(N, R)
J = I
J = J - 1
Z = 0
b = Len(Format(N, "0"))
For a = 1 To b
CombinFormat = CombinFormat & "0"
Next a
For a = 1 To R
If ((I >= 1) And (I <= C)) Then
If (a = 1) Then
Combination(a) = 1
Else
Combination(a) = Combination(a - 1) + 1
End If
NumberFound = False
Do
Select Case (J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1))))
Case Is < 0
Combination(a) = Combination(a) - 1
NumberFound = True
Case Is = 0
NumberFound = True
Case Is > 0
Combination(a) = Combination(a) + 1
End Select
Loop Until NumberFound
J = J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1)))
Z = Combination(a)
Else
Combination(a) = 0
End If
tmpString = tmpString & Format(Combination(a), CombinFormat)
If (a < R) Then tmpString = tmpString & " "
Next a
Index2Combin = tmpString
End Function
Function Combin2Index(ByVal N As Integer, ByVal R As Integer, ByVal theRange As Range) As Double
Dim a As Integer
Dim fSum As Double
Dim NotInAscendingOrder, NotInPool As Boolean
NotInAscendingOrder = False
NotInPool = False
If ((theRange.Rows.Count <> 1) Or (theRange.Columns.Count <> R)) Then
Combin2Index = -1
Exit Function
End If
For a = 1 To R
If (a < R) Then
If (theRange.Cells(1, a) >= theRange.Cells(1, (a + 1))) Then
NotInAscendingOrder = True
End If
End If
If ((theRange.Cells(1, a) < 1) Or (theRange.Cells(1, a) > N)) Then
NotInPool = True
End If
Next a
If (NotInAscendingOrder Or NotInPool) Then
Combin2Index = -1
Exit Function
End If
fSum = 1
For a = 1 To R
If (a = 1) Then
fSum = fSum + fColumnSum(N, R, (theRange.Cells(1, 1) - 1))
Else
fSum = fSum + fColumnSum((N - theRange.Cells(1, (a - 1))), (R - (a - 1)), (theRange.Cells(1, a) - (theRange.Cells(1, (a - 1)) + 1)))
End If
Next a
Combin2Index = fSum
End Function____________________________________________________________________________________________________
Oops, correct http links.
http://www.jadexcode.com/files/Excel/CombinatorialIndex.xls
http://www.jadexcode.com/files/Excel/CombinatorialIndex.xlsm
The One Over None
I Know... -
Write all combinations on paper. Strike through every second combination. Simulate a winning situation. Calculate the payout.