Question for geniuses????

If I had 28 numbers and wanted to put them in every possible triplet how would I do it?

In another way,

How many triplets are possible from 28 numbers?

Is there a wheel possible from this arrangement? How many tickets would in be in say in a fantasy five game? :)
 

PAB

Member
Hi knowwhen2play,

There are 6,552 Combinations of 3 Numbers from 28.
To work it out you use the following Formula ...

Code:
28x27x26
-------- = 6,552
  3x2x1
I Hope this Helps.
All the Best.
PAB
:wavey:
 

PAB

Member
Hi again knowwhen2play,

Put the Following Code into a Module in Excel and Run it.
The Program will Generate ALL 6,552 Combinations of 3 Numbers from 28 and List them in the Active Worksheet Starting in Cell "A1" and Continuing Down.

Code:
Option Explicit

' List ALL Triplets from 28 Numbers
' Formula is 28 x 27 x 26 / 3 x 2 x 1 = 6,552 Combinations

Sub Generate_ALL_Triplets()
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim Max As Integer
Dim CombNum As Double

Max = 28
Range("A1").Select
CombNum = 1
For A = 1 To Max - 2
    For B = A + 1 To Max - 1
        For C = B + 1 To Max
            ActiveCell.Offset(CombNum, 0).Value = CombNum
            ActiveCell.Offset(CombNum, 1).Value = A
            ActiveCell.Offset(CombNum, 2).Value = B
            ActiveCell.Offset(CombNum, 3).Value = C
            CombNum = CombNum + 1
        Next C
    Next B
Next A
End Sub
I Hope this Helps.
All the Best.
PAB
:wavey:
 

GillesD

Member
Number of combinations

It is odd but my calulation of 28*27*26/3/2/1 gives me 3,276 which happens to be the same numbers of triplets generated by PAB macro. The formula you given is good but the calculator used may be a little deficient.

If you use Excel, the function COMBIN(Y;X) can be used to to determine how many combinations of X numbers can be made with Y numbers.

So =COMBIN(28,3) will give you 3,276 and =COMBIN(49;6) 13,983,816.
 

PAB

Member
Hi GillesD,

You are Quite Right, COMBIN(28,3) Equals 3,276 Combinations NOT as I Stated.
Time to get a New Calculator :agree: .

Thanks for the Correction.
All the Best.
PAB
:wavey:
 

Sidebar

Top