Announcement

Collapse
No announcement yet.

Math Question for football pool

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Math Question for football pool

    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.

    Thanks

  • #2
    I want to make sure I understand

    Team A, Team B, Team C
    Team A, Team B, Team D
    Team A, Team B, Team E
    .
    .
    .
    Team B, Team C, Team D
    Team B, Team C, Team E

    etc.......

    Comment


    • #3
      Correct Frank

      In other words

      Team A, B, C and C, B, A would be no good.

      There are 4,960 combo's of the example YOU gave.

      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)
      Last edited by Mets212; 07-22-2005, 05:01 PM.

      Comment


      • #4
        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.

        Comment


        • #5
          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..

          Comment


          • #6
            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:

            Find: 32
            Replace with: Ravens

            Click Replace All and do this for all 32 teams.

            Comment


            • #7
              Thanks CTT, I owe you big time.
              I am going to send Monte my e-mail so that you could send me the excel file since I'm not real familiar with Excel.

              Thanks again

              Comment


              • #8
                I could wait till Monday when your back at work

                Comment

                Working...
                X