Megayahtzee Permutations

Formally displays all possible variations that a scoretype in Megayahtzee can be arranged with examples and technical descriptions.


Permutation Factors

The process of calculating the total number of permutations in a given set is done by determining its factors, and then multiplying them with each other. These factors consist of 5 different types: Positional, Arrangement, Value, Excess, and Overlap. Each type of factor has its own definition of determining its value(s) from the set.

  • Positional Factor — Determined by counting the total number of ways the target values can be positioned in a given set.
  • Arrangement Factor — Determined by counting the total number of ways the target values can be arranged from any single position in a given set.
  • Value Factor — Determined by counting the total number of ways values can be substituted into a given set's target values and additional target values.
  • Excess Factor — The range length of a given set's non-target value(s).
  • Overlap Factor — Determined by finding repeated sets while working out the previous factor types.

Permutation Values

4+ of a Kind: 58,513 Permutations

[A,A,A,A,x,x,x] 35×7×6×6×6

[A,A,A,A,A,x,x] 21×7×6×6

[A,A,A,A,A,A,x] 7×7×6

[A,A,A,A,A,A,A] 7 = 58,513


5+ of a Kind: 5,593 Permutations

[A,A,A,A,A,x,x] 21×7×6×6

[A,A,A,A,A,A,x] 7×7×6

[A,A,A,A,A,A,A] 7 = 5,593


Full+ House: 295,612 Permutations

[A,A,B,B,B,x,x] 21×10×7×6×5×5

[A,A,B,B,B,B,x] 7×15×7×6×5

[A,A,B,B,B,B,B] 21×7×6

[A,A,A,B,B,B,x] 7×20×7×6×5÷2

[A,A,A,B,B,B,B] 35×7×6 = 295,612


Small+ Straight: 255,360 Permutations

[A,B,C,D,(x-1),(x-1),(x-1)] 35×24×2×2×2×2

[A,B,C,D,(x-2),(x-2),(x-2)] 35×24×2

[A,B,C,D,X,(x-1),(x-1)] 21×10×6×4×2×2×2

[A,B,C,D,X,(x-2),(x-2)] 21×10×6×4×2

[A,B,C,D,X,X,(x-1)] 7×20×6×4×2×2

[A,B,C,D,X,X,(x-2)] 7×20×6×4×2

[A,B,C,D,X,X,X] 35×6×4×4

[A,B,C,D,X,Y,(x-1)] 7×15×6×2×4×3×2×2÷2

[A,B,C,D,X,Y,(x-2)] 7×15×6×2×4×3×2÷2

[A,B,C,D,X,X,Y] 35×6×2×4×3×4

[A,B,C,D,X,Y,Z] 21×10×3×4×3×2×4÷6

[A,B,C,D,E,(x-1),(x-1)] 21×120×2

[A,B,C,D,E,X,(x-1)] 7×15×24×5×2

[A,B,C,D,E,X,X] 35×24×5×3

[A,B,C,D,E,X,Y] 21×10×6×5×4÷2

[A,B,C,D,E,F,X] 21×120×6×2

[A,B,C,D,E,F,G] 5,040 = 255,360


Large+ Straight: 90,720 Permutations

[A,B,C,D,E,(x-1),(x-1)] 21×120×2

[A,B,C,D,E,X,(x-1)] 7×15×24×5×2

[A,B,C,D,E,X,X] 35×24×5×3

[A,B,C,D,E,X,Y] 21×10×6×5×4÷2

[A,B,C,D,E,F,X] 21×120×6×2

[A,B,C,D,E,F,G] 5,040 = 90,720


Triple Double+: 110,250 Permutations

[A,A,B,B,C,C,x] 7×15×6×7×6×5×4÷6

[A,A,B,B,C,C,X] 35×6×7×6×5÷2 = 110,250


Double Triple+: 16,170 Permutations

[A,A,A,B,B,B,x] 7×20×7×6×5÷2

[A,A,A,B,B,B,X] 35×7×6 = 16,170


Full Full House: 22,050 Permutations

[A,A,B,B,C,C,C] 35×6×7×6×5÷2 = 22,050


Straight Straight: 12,600 Permutations

[A,A,B,B,C,C,x] 7×15×6×5×4 = 12,600


Packed House: 1,470 Permutations

[A,A,A,B,B,B,B] 35×7×6 = 1,470


Larger+ Straight: 35,280 Permutations

[A,B,C,D,E,F,X] 21×120×6×2

[A,B,C,D,E,F,G] 5,040 = 35,280


6+ of a Kind: 301 Permutations

[A,A,A,A,A,A,x] 7×7×6

[A,A,A,A,A,A,A] 7 = 301


Party Boat: 882 Permutations

[A,A,B,B,B,B,B] 21×7×6 = 882


Meteor Shower+: 11,760 Permutations

[A,B,C,D,E,E,E] 24×35×4×3

[A,B,C,D,D,D,D] 6×35×4×2 = 11,760


Great Pyramids: 5,040 Permutations

[A,A,B,B,C,C,D | D >||< A,B,C] 21×10×3×2×3×2×4÷6 = 5,040


Meaning of Life: 1,779 Permutations

[6,6,6,6,6,6,6] 1

[7,6,6,6,6,6,5] 21×2

[7,7,6,6,6,6,4] 35×3

[7,7,6,6,6,5,5] 35×6

[7,7,7,6,6,6,3] 35×4

[7,7,7,6,6,5,4] 35×6×2

[7,7,7,6,5,5,5] 35×4

[7,7,7,7,6,6,2] 35×3

[7,7,7,7,6,5,3] 35×3×2

[7,7,7,7,6,4,4] 35×3

[7,7,7,7,5,5,4] 35×3

[7,7,7,7,7,6,1] 21×2

[7,7,7,7,7,5,2] 21×2

[7,7,7,7,7,4,3] 21×2 = 1,779


Lucky Sevens: 128 Permutations

[1,1,1,1,1,1,1] 1

[1,1,1,1,1,1,7] 7

[1,1,1,1,1,7,7] 21

[1,1,1,1,7,7,7] 35

[1,1,1,7,7,7,7] 35

[1,1,7,7,7,7,7] 21

[1,7,7,7,7,7,7] 7

[7,7,7,7,7,7,7] 1 = 128


Seventh Wheeling: 12,600 Permutations

[A,A,B,B,C,C,1 | A,B,C ≠ 1] 21×10×3×6×5×4÷6 = 12,600


Comet in the Sky: 840 Permutations

[3,4,5,6,7,7,7] 35×24 = 840


Odd One Out: 42 Permutations

[A,A,A,A,A,A,1 | A ≠ 1] 7×6 = 42


Largest Straight: 5,040 Permutations

[A,B,C,D,E,F,G] 5,040 = 5,040


MEGAYAHTZEE: 7 Permutations

[A,A,A,A,A,A,A] 7 = 7


All Possible Permutations: 823,543 (7ⅇ7) Permutations

[A,B,C,D,E,F,G] 7!×7×6×5×4×3×2×1÷5,040

[A,A,B,C,D,E,F] 21×5×4×3×2×7×6×5×4×3×2÷120

[A,A,B,B,C,D,E] 21×10×3×2×7×6×5×4×3÷12

[A,A,B,B,C,C,D] 21×10×3×7×6×5×4÷6

[A,A,A,B,C,D,E] 35×4×3×2×7×6×5×4×3÷24

[A,A,A,B,B,C,D] 35×6×2×7×6×5×4÷2

[A,A,A,B,B,C,C] 35×6×7×6×5÷2

[A,A,A,B,B,B,C] 35×4×7×6×5÷2

[A,A,A,A,B,C,D] 35×3×2×7×6×5×4÷6

[A,A,A,A,B,B,C] 35×3×7×6×5

[A,A,A,A,B,B,B] 35×7×6

[A,A,A,A,B,B,C] 21×2×7×6×5÷2

[A,A,A,A,A,B,B] 21×7×6

[A,A,A,A,A,A,B] 7×7×6

[A,A,A,A,A,A,A] 1×7 = 823,543 (7ⅇ7)


Target Value [A,B,C,D,E,F,G]

A variable that is included in a given set or combo (e.g. Full House, Megayahtzee, etc.). The value of these variables range from 1-7. These variables are dependent on each other, as no two variables can represent the same value.


[A,A,A,B,B,C,C]

In this Full Full House set, A can represent any of the seven values, B can represent any value that is not occupied by A, and C can represent any value that is not occupied by A or B.


Non-Target Value [x,(x-1),(x-2)]

A variable that is not included in a given set or combo. In other words, they cannot represent a value that is already occupied by at least one target value. The value of these variables are determined by subtracting the amount of unique target values used in a given set or combo from 7, which is the number of dice we use. These variables are independent from each other, meaning the result of one variable will not impact the result of another (they can all represent the same value, or they can all represent different values, and so on).


[A,A,A,B,B,B,x]

In this Double Triple set, there are two unique target values being used, A and B. Therefore, the range length of x (the amount of values x can represent) is 7-2=5.


[A,B,C,D,E,(x-1),(x-1)]

Sometimes, there are values we do not want to let x represent, even if that value is excluded from the set. The target values in this particular set define a Large Straight. Typically, we would determine the amount of values x can be by doing 7-5=2. However, one of these two values, while it is not included in our set, may be included in a different set, that being a Larger Straight which is written as [A,B,C,D,E,F].

For instance, a Large Straight consisting of these values [1,2,3,4,5], may have two non-target values for the remainder of the whole set, which can either be 6 or 7 for both of them. When calculating permutations, we want to avoid overlapping with other types of sets (will be defined later). So, in order to calculate our set containing a Large Straight, we must exclude that 6 from representing our non-target values, as it forms a Larger Straight instead [1,2,3,4,5,6], which is an overlapping set where we would want its permutations calculated separately. So, we must subtract 1 from the total amount of values our non-target value can be, resulting with the term (x-1). Since the range length of x is 2, the range length of (x-1) is 1, for the set [A,B,C,D,E,(x-1),(x-1)].


[A,B,C,D,(x-2),(x-2),(x-2)]

The set we went through in the previous example is specifically for the case when a Large Straight is "on the edge" of the range of possible values. We must also consider the cases where straights are located "in the center" of the range.

For instance, a Small Straight of [2,3,4,5] will have three remaining values that may be non-target values to form a whole set with seven values. The range length of x would be 3, and similarly to what we did in the previous example, we must exclude both 1 and 6 from the amount of possible values of x in order to avoid overlap between other sets, such as Large Straight and Larger Straight. Since we excluded two values from being a non-target value for the set in this example, the term (x-2) is being used. In the context of a Large Straight, there is only one possible "center" Large Straight [2,3,4,5,6], and we must exclude values 1 and 7 for when we want to determine the possible outcomes of x that do not result in overlap. However, upon doing so we are left with no remaining values that could represent x, which makes the set [A,B,C,D,E,(x-2),(x-2)] impossible!


Additional Target Value [X,Y,Z]

A variable that can be any of the existing target values in a given set or combo. These variables are dependent on each other, as no two variables can represent the same value.


[A,A,B,B,C,C,X]

In this set, A can represent any of the seven values, B can represent any value that is not occupied by A, C can represent any value that is not occupied by A or B, and X can represent any value that is already occupied by existing target values A, B, or C.


[A,B,C,D,X,Y,Z]

In this set, A, B, C, and D can represent any 4 different values that form a Small Straight, X can represent any value that is occupied by any existing target value, Y can represent any value that is occupied by any existing target value that is not occupied by X, and Z can represent any value that is occupied by any existing target value that is not occupied by X or Y.


Positional Factor

The value of this factor is determined by counting the total number of ways the target values can be positioned in a given set. For this particular type of factor, all target values (including additional target values) in a set are treated as objects, and all non-target values are treated as empty spaces.


[A,A,A,B,B,x,x]

In this set, five of the positions are occupied by target values, and the other two positions are occupied by non-target values. Suppose we treated all target values as objects, and all non-target values as empty spaces. Let all target values = O and all non-target values = e. By substituting in these new terms we get [O,O,O,O,O,e,e]. We must determine all possible combinations of this set by moving around the objects (O's) into several different positions, which may be counted by hand, or done arithmetically. In this case, the set is small enough to be brute forced. Here are all of the positional variations of this set:

[O,O,O,O,O,e,e] [O,O,e,O,O,e,O] [O,e,e,O,O,O,O]
[O,O,O,O,e,O,e] [O,O,e,O,e,O,O] [e,O,O,O,O,O,e]
[O,O,O,O,e,e,O] [O,O,e,e,O,O,O] [e,O,O,O,O,e,O]
[O,O,O,e,O,O,e] [O,e,O,O,O,O,e] [e,O,O,O,e,O,O]
[O,O,O,e,O,e,O] [O,e,O,O,O,e,O] [e,O,O,e,O,O,O]
[O,O,O,e,e,O,O] [O,e,O,O,e,O,O] [e,O,e,O,O,O,O]
[O,O,e,O,O,O,e] [O,e,O,e,O,O,O] [e,e,O,O,O,O,O]

There are 21 different positional variations that can be made from this set. Thus, the positional factor of the set [A,A,A,B,B,x,x] is 21.

It is also worth mentioning that the positional factor can be calculated using the combination formula. C(n,r); where n is 7, since there are 7 dice and r is the number of target values. The combination formula is as follows: n!/(n-r)!r! For instance, C(7,5) results in 21 as well.


[A,A,B,B,C,C,X]

The positional factor for this set is 1, as there is only one possible position.


Arrangement Factor

The value of this factor is determined by counting the total number of ways the target values can be arranged from any single position in a given set. The methods for determining this factor's value are sometimes done in a similar manner as the positional factor.


[A,A,A,B,B,x,x]

Using the same set from the previous example, we must determine all possible combinations of this set by arranging the target values into several different arrangements, while occupying the same five positions. Here are all of the arrangement variations for this set:

[A,A,A,B,B,x,x] [A,B,B,A,A,x,x] [A,A,B,A,B,x,x] [B,A,A,A,B,x,x] [A,A,B,B,A,x,x]
[B,A,A,B,A,x,x] [A,B,A,A,B,x,x] [B,A,B,A,A,x,x] [A,B,A,B,A,x,x] [B,B,A,A,A,x,x]

There are 10 different ways to arrange the target values in this set. Thus, the arrangement factor of the set [A,A,A,B,B,x,x] is 10.

The combination formula C(n,r) can also be used if we let n be the number of target values and r be the number of A's. In this case, we get C(5,3). This also results in 10.


[A,B,C,D,(x-2),(x-2),(x-2)]

When determining the total number of arrangements that can be made from a set containing a straight (or any number of unique values in general), factorials are used. The factorial (n!) of any positive integer n is equal to the product of all positive non-zero integers less than or equal to n. For instance, 8! is equal to 8×7×6×5×4×3×2×1=40,320. The number of possible arrangements that can be made from this set is done by counting the number of unique target values being used, and then taking the factorial of that number. Since there are 4 unique target values in this set, the number of arrangements that can be made is 4!=4×3×2×1=24. To confirm, we can list all of the possible arrangements here:

[A,B,C,D,(x-2),(x-2),(x-2)] [B,C,A,D,(x-2),(x-2),(x-2)] [C,D,A,B,(x-2),(x-2),(x-2)]
[A,B,D,C,(x-2),(x-2),(x-2)] [B,C,D,A,(x-2),(x-2),(x-2)] [C,D,B,A,(x-2),(x-2),(x-2)]
[A,C,B,D,(x-2),(x-2),(x-2)] [B,D,A,C,(x-2),(x-2),(x-2)] [D,A,B,C,(x-2),(x-2),(x-2)]
[A,C,D,B,(x-2),(x-2),(x-2)] [B,D,C,A,(x-2),(x-2),(x-2)] [D,A,C,B,(x-2),(x-2),(x-2)]
[A,D,B,C,(x-2),(x-2),(x-2)] [C,A,B,D,(x-2),(x-2),(x-2)] [D,B,A,C,(x-2),(x-2),(x-2)]
[A,D,C,B,(x-2),(x-2),(x-2)] [C,A,D,B,(x-2),(x-2),(x-2)] [D,B,C,A,(x-2),(x-2),(x-2)]
[B,A,C,D,(x-2),(x-2),(x-2)] [C,B,A,D,(x-2),(x-2),(x-2)] [D,C,A,B,(x-2),(x-2),(x-2)]
[B,A,D,C,(x-2),(x-2),(x-2)] [C,B,D,A,(x-2),(x-2),(x-2)] [D,C,B,A,(x-2),(x-2),(x-2)]

Thus, the arrangement factor of the set [A,B,C,D,(x-2),(x-2),(x-2)] is 24.


[A,B,C,D,E,E,E]

Sometimes, multiple arrangement factors are needed to determine all possible arrangement combinations of a set. In this example, we have a Small Straight and a 3 of a Kind representing our seven target values. We must determine the total number of arrangements that can be made within the Small Straight and we must also determine the total number of arrangements the three 'E' target values can be made throughout the entire set for each Small Straight arrangement (this can also be treated as calculating a positional factor, if we let E be our objects and A, B, C, and D be our empty spaces). For the Small Straight, we simply compute the factorial of the number of unique target values involved in the straight, which is 4!=4×3×2×1=24. For the 3 of a Kind, we use n=7 and r=3 in substitution to the combination formula C(n,r), which results in C(7,3)=35.

Thus, the arrangement factors for the set [A,B,C,D,E,E,E] are 24 and 35. Multiplying these two factors gives us the total number of arrangements that can be made out of this set, which is 840.


[A,B,C,D,X,X,Y]

Lastly, there are also cases where additional target values are being used in a set. To determine the arrangement factor of a set containing additional target values, we must make a single target value substitution for each additional target value, and then find the arrangement factor of the resulting set. So let X be A, and Y be B. Our new set will then be [A,A,A,B,B,C,D]. We proceed to calculate this with our usual methods. In this set, there are three arrangement factors that need to be determined. The first is the total number of "positional variations" that can be made when treating the A's as our objects and B, C, and D as our empty spaces. Out of these empty spaces though, we also need to determine another total "positional variation" count by treating the B's as our objects and C and D as our empty spaces, resulting in our second arrangement factor. The third and final arrangement factor has to do with our last two unique target values, C and D. From this set, we get C(7,3)=35 as our first arrangement factor, C(4,2)=6 as our second, and 2!=2×1=2 as our third.

Thus, the arrangement factors for the set [A,B,C,D,X,X,Y] are 35, 6, and 2. Multiplying these three factors gives us the total number of arrangements that can be made out of this set, which is 420.


Value Factor

The value of this factor is determined by counting the total number of ways values can be substituted into a given set's target values and additional target values. As defined earlier, no two target values can hold the same value, and no two additional target values can hold the same value. The range of values that can be substituted into target/additional target values go from 1-7.


[A,A,A,B,B,x,x]

Using our beloved set we've used in the previous two factor types, there are two unique target values being used, A and B, so two value substitutions are being made. We must determine all possible pairs of values that can be substituted into A and B. By doing so, we get that A can be any of the seven values, and B can be any of the six remaining values, since one of them is already occupied by A.

Thus, the value factors for the set [A,A,A,B,B,x,x] are 7 and 6. Multiplying these two factors gives us the total number of different ways you can insert values into the set's target values, which is 42.


[A,B,C,D,(x-1),(x-1),(x-1)]

To determine the value factors of a set containing a straight, we must consider the entire straight as a whole, rather than looking at its individual target values. Meaning, a group of four different values substituted into this set's target values will be considered as one permutation instead of four. In this set, there are a total of 4 different ways you can insert groups of four values to form a Small Straight:

[1,2,3,4,(x-1),(x-1),(x-1)] [3,4,5,6,(x-1),(x-1),(x-1)]
[2,3,4,5,(x-1),(x-1),(x-1)] [4,5,6,7,(x-1),(x-1),(x-1)]

Thus, the value factor for the set [A,B,C,D,(x-1),(x-1),(x-1)] is 4... or is it?

We have to remember that there are non-target values being used in this set, specifically, (x-1)'s. This type of non-target value indicates that one of its values must be excluded from representing the non-target value to prevent overlap, as explained earlier. This further implies that the Small Straight in this set must be "on the edge" of the full range of possible values. This means we cannot take the sets [2,3,4,5,(x-1),(x-1),(x-1)] and [3,4,5,6,(x-1),(x-1),(x-1)] into consideration when determining the value factor for the set in our example, so we are left with just two sets, [1,2,3,4,(x-1),(x-1),(x-1)] and [4,5,6,7,(x-1),(x-1),(x-1)] as part of the value factor.

Thus, the value factor for the set [A,B,C,D,(x-1),(x-1),(x-1)] is 2.


[A,B,C,D,X,X,Y]

To determine the value factors of a set containing additional target values, we must compute the total number of ways we can substitute the set's existing target values into them. The set in this example is composed of a Small Straight, a pair of additional target values and another unique additional target value. To determine the value factor of the three additional target values, we must find all possible ways we can substitute A, B, C, and/or D into X and Y. Here, X can represent any of the 4 target values, and Y can represent any of the 3 remaining target values that are not already occupied by X. So, the value factors for the additional target value components of the set are 4 and 3. Of course, we also need to find the value factor of the Small Straight itself. We have already gone through this in the previous example, but this time there are no non-target values involved. So we can go ahead and take all four of those combinations that we've brought up previously into account, making the value factor of the Small Straight component 4.

Thus, the value factors for the set [A,B,C,D,X,X,Y] are 4, 3, and 4. Multiplying these three factors gives us the total number of different ways you can insert values into the set's target values and additional target values, which is 48.


Excess Factor

The value of this factor is simply the range length of a given set's non-target value(s). In other words, it is equal to the total number of possible values that can represent each non-target value.


[A,A,A,B,B,x,x]

Again, this set is used as our example. Here, we have five target values forming a pair and a 3 of a Kind, and two non-target values. These two variables that are outside of the target value group can be referred to as excess, as they can be whatever value that isn't already a target value. The excess factor of one non-target value is just its range length, which is 5. Basically, this is just value factor, but for the non-target values. Since this set contains two non-target values, there will be two excess factors, both of which are 5.

Thus, the excess factors for the set [A,A,A,B,B,x,x] are 5 and 5. Multiplying these two factors gives us the total number of different ways you can insert values into the set's non-target values, which is 25.


Overlap Factor

The value of this factor is determined by finding repeated sets while working out the previous factor types. Unlike the other four factor types, this factor divides into our overall permutation count of a given set. It primarily comes from repeated sets between the arrangement and value factors.


[A,A,A,B,B,B,x]

When working out this Double Triple set, we need to be aware of any overlap. To do so, let's begin by solving its arrangement and value factors, along with full lists of their possible combinations. The arrangement factor is determined by evaluating C(6,3), since there are 3 A's and 6 target values in total. This resulted in 20 arrangements for the set. The value factor is determined by having A represent any of the seven values and B represent any of the six remaining values not occupied by A, resulting in 42 different value combinations. Now let's list out all of their sets, starting with the arrangement factors:

[A,A,A,B,B,B,x] [A,B,A,A,B,B,x] [A,B,B,A,B,A,x] [B,A,A,B,B,A,x] [B,B,A,A,A,B,x]
[A,A,B,A,B,B,x] [A,B,A,B,A,B,x] [A,B,B,B,A,A,x] [B,A,B,A,A,B,x] [B,B,A,A,B,A,x]
[A,A,B,B,A,B,x] [A,B,A,B,B,A,x] [B,A,A,A,B,B,x] [B,A,B,A,B,A,x] [B,B,A,B,A,A,x]
[A,A,B,B,B,A,x] [A,B,B,A,A,B,x] [B,A,A,B,A,B,x] [B,A,B,B,A,A,x] [B,B,B,A,A,A,x]

And here are all of the value factor sets:

[1,1,1,2,2,2,x] [1,1,1,3,3,3,x] [1,1,1,4,4,4,x] [1,1,1,5,5,5,x] [1,1,1,6,6,6,x] [1,1,1,7,7,7,x]
[2,2,2,1,1,1,x] [2,2,2,3,3,3,x] [2,2,2,4,4,4,x] [2,2,2,5,5,5,x] [2,2,2,6,6,6,x] [2,2,2,7,7,7,x]
[3,3,3,1,1,1,x] [3,3,3,2,2,2,x] [3,3,3,4,4,4,x] [3,3,3,5,5,5,x] [3,3,3,6,6,6,x] [3,3,3,7,7,7,x]
[4,4,4,1,1,1,x] [4,4,4,2,2,2,x] [4,4,4,3,3,3,x] [4,4,4,5,5,5,x] [4,4,4,6,6,6,x] [4,4,4,7,7,7,x]
[5,5,5,1,1,1,x] [5,5,5,2,2,2,x] [5,5,5,3,3,3,x] [5,5,5,4,4,4,x] [5,5,5,6,6,6,x] [5,5,5,7,7,7,x]
[6,6,6,1,1,1,x] [6,6,6,2,2,2,x] [6,6,6,3,3,3,x] [6,6,6,4,4,4,x] [6,6,6,5,5,5,x] [6,6,6,7,7,7,x]
[7,7,7,1,1,1,x] [7,7,7,2,2,2,x] [7,7,7,3,3,3,x] [7,7,7,4,4,4,x] [7,7,7,5,5,5,x] [7,7,7,6,6,6,x]

We may notice that there are some strange similarities between these lists. For instance, we see that the arrangement factor list contains [A,A,A,B,B,B,x] and [B,B,B,A,A,A,x], and the value factor list contains [1,1,1,2,2,2,x] and [2,2,2,1,1,1,x]. This may be a sign of overlap. To be certain about this, let's check by plugging in the pair of values from one of the value factor sets into both of the arrangement factor sets, do the same with the second value factor set, and then compare their results. So for the case of [1,1,1,2,2,2,x], let A = 1 and B = 2. Our arrangement factor sets [A,A,A,B,B,B,x] and [B,B,B,A,A,A,x] would become [1,1,1,2,2,2,x] and [2,2,2,1,1,1,x] respectively, post-substitution. Now let's try this with our other value factor set, [2,2,2,1,1,1,x], where we let A = 2 and B = 1.

Our arrangement factor sets [A,A,A,B,B,B,x] and [B,B,B,A,A,A,x] would become [2,2,2,1,1,1,x] and [1,1,1,2,2,2,x] respectively, post-substitution. They are the exact same sets we have got in our first case! This clearly overlaps, and we must take that information into account when we are calculating the total number of possible permutations of a set. When we applied these substitutions into our arrangement factor sets, we ended up with 4 new sets, and 2 of them were repeated/overlapping. So we have to eliminate 2/4 of all permutations, in other words, half of all of them.

Thus, the overlap factor for the set [A,A,A,B,B,B,x] is 2, and this factor must be divided into our overall count.


[A,A,B,B,C,C,x]

For this set, we apply the same idea. We let A = 1, B = 2, and C = 3, and then we substitute these values into the similar-looking arranged sets [A,A,C,C,B,B,x], [B,B,A,A,C,C,x], [B,B,C,C,A,A,x], [C,C,A,A,B,B,x], and [C,C,B,B,A,A,x], as well as [A,A,B,B,C,C,x] itself. We do the same for substitution trios (A = 1, B = 3, C = 2), (A = 2, B = 1, C = 3), (A = 2, B = 3, C = 1), (A = 3, B = 1, C = 2), and (A = 3, B = 2, C = 1). After a lot of substitution work we should end up with a grand total of 36 resulting sets, with 30 of them being repeats, or overlapped sets. Therefore, we must not take 30/36, or 5/6 of all permutations into account, and they must be divided out of our total permutation count for the set in this example. In which case, we multiply the total permutation count by 1/6, or divide by 6.

Thus, the overlap factor for the set [A,A,B,B,C,C,x] is 6, and this factor must be divided into our overall count.


Turns out, there is a pattern going on when we calculate the overlap factor of certain sets. In our first example, the set [A,A,A,B,B,B,x] has 2 unique target values each consisting of the same number of variables (both A and B have three each). The outcome was dividing the set's total permutation count by an overlap factor of 2. In our second example, the set [A,A,B,B,C,C,x] has 3 unique target values each consisting of the same number of variables (A, B, and C all have two each). The outcome was dividing the set's total permutation count by an overlap factor of 6.

We notice that these factors are related to the factorials of the number of unique target values that have the same number of variables each (the first set had 2 unique target values, making the overlap factor 2!=2, and the second set had 3 unique target values, making the overlap factor 3!=6 for their respective sets). This makes sense when we consider the following: If we take a look at the set [A,B,C,D,E,F,G] (same as [A,B,C,D,E,F,G]), we know that there are 5,040 (or 7!) permutations that can be made, since it is just finding all possible ways you can sort seven items. But, if we try to figure out the permutation count using our usual factor methods instead, we end up getting an arrangement factor of 7! or 5,040 (derived from the Largest Straight), and value factors of 7×6×5×4×3×2×1=5,040 (derived from letting A be any of the seven values, B be any of the six remaining values that isn't already occupied by A, and so on). This results in a total permutation count of 5,040×5,040=25,401,600, which is clearly wrong. But we notice that this set's target values all have one variable each! There are 7 unique target values in the set that all have the same number of variables each, so we should have an overlap factor of 7!=5,040, and indeed, when we divide this factor into our current count of 25,401,600, we get 25,401,600/5,040=5,040, which is the final permutation count for the set [A,B,C,D,E,F,G].