Does anyone know where I can obtain software that would enable me to print out all 4,960 3 team football combinations using the 32 NFL teams (Order does not matter), it would be used for a pool I'm running.
Another example, if say you bought a ticket with Team A, Team B and Team C, you would be the only person with that 3 team combination. (No 2 tickets would have the same combination)
Mets, this could be done with excel, but I'm not good enough at programming to figure it out.. All I have is a program that spits out permutations, whereas you're looking for combinations. You could post this question on the message boards at excelforumdotcom and someone there might be able to give you insight into how to go about it.
mets, I was able to form an excel spreadsheet with all 4960 combinations that you're looking for.. Just have Monte send me your email and I'll send it to you..
On second thought, since I'm about to leave work, I'll just tell you what I did..
Open a Blank Worksheet in Excel
Hold 'Alt' and Press 'F11'
Doubleclick on 'ThisWorkbook'
Copy and Paste the following:
Sub Combinations()
Dim n As Integer, m As Integer, numcomb
numcomb = 0
n = InputBox("Number of items?", "Combinations")
m = InputBox("Taken how many at a time?", "Combinations")
Application.ScreenUpdating = False
Comb2 n, m, 1, ""
End Sub
'Generate combinations of integers k..n taken m at a time, recursively
Private Function Comb2(ByVal n As Integer, ByVal m As Integer, _
ByVal k As Integer, ByVal s As String)
If m > n - k + 1 Then Exit Function
If m = 0 Then
ActiveCell = s
ActiveCell.Offset(1, 0).Select
Exit Function
End If
Comb2 n, m - 1, k + 1, s & k & " "
Comb2 n, m, k + 1, s
End Function
Save this and return to the original workbook.
Hold 'Alt' and press 'F8'
Run the function that you just saved.
Answer 32 to the first question and 3 to the second question.
Do a global replace and work backwards for each number, for example:
Comment