Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Many Alt Forms Are There?
#1
How Many Alt Forms Are There?

Or, more specifically, how many are there for each amount of stat upgrades, and how much OM would it cost to get all of them?

Let's start with the basic 10 stats. How many combinations are there? We've got 5/5/0/0, 5/4/1/0, 5/4/0/1, ... , 0/0/5/5. But, counting all of those would take forever (well... not forever, probably like 10 minutes or so, maybe).

To answer that question, I am going to answer an equivalent question. How many ways are there to put 10 balls into 4 boxes, so that no box has more than 5 balls? We can represent each combination like this: **|***|***|**, *****|**|***|, and so on. With the |s being the walls between the boxes, and the *s being the balls. These correspond directly to the statlines, so *|*|****|**** is 1/1/4/4, and *****|*****|| is 5/5/0/0, and ***|**|**|*** is 3/2/2/3, etc.. So, we just need to find the number of arrangements of 10 *s and 3 |s.

The number of ways to arrange 13 (10+3) distinct objects is 13! (13 factorial, 13 x 12 x 11 x ... x 1). But since 10 of these objects are identical, for each arrangement of *s we actually want, there would be 10! ways to do it if they were unidentical. The same goes for the |s, but with 3!. So, we have 13! / (10! x 3!) arrangements, including the illegal statlines. Which comes to 286 statlines.

To discount the illegal statlines, we just need to count how many there are:
[spoiler]With 6 in one stat, the other 3 stats would look like **|*|* (2/1/1),  ||**** (0/0/4), **||** (2/0/2), and so on. Essentially, there are 6! / (4! x 2!) lines with 6 in the first stats. But, as there are 4 stats, we need to multiply that by 4, which gives 60 (4 x 15) illegal statlines.

For 7, similarly, we have (4 x 5!) / (3! x 2!) = 40 (4 x 10) illegal statlines.

For 8, there are (4 x 4!) / (2! x 2!) = 24 (4 x 6).

For 9, there are (4 x 3!) / (1! x 2!) = 12 (4 x 3).

For 10 in one stat, there are trivially 4 (4 x 1) combinations.[/spoiler]
So, there are 286 - (60 + 40 + 24 + 12 + 4) = 146 statlines. Which would come to 290k OM (subtract 1 since you start with one, then multiply by 2000).

But that's only with 10 stats. What about with more? Let's generalise it.

If someone has X stats, where X is an integer greater than or equal to 2, then:

They have (X+3)! / (X! x 3!) possible statlines if we allow illegal ones (as there are X *s and 3 |s).

If X is even, there are X(X+2)(X+4)/12 illegal statlines. So, there are [(X+3)! / (X! x 3!)] - [X(X+2)(X+4)/12] many statlines for an even value of X. Which simplifies to (X+2)(X(X+4)+6)/12, or (X+2)(X^2+4X+6)/12.

Proof/explanation/rambling:
[spoiler]
With X in one stat, there's only one possibility for what the other stats can be (as they're all 0).
With X-1 in one stat, there are 3 combinations for the other stats (1/0/0, 0/1/0, 0/0/1).
And the sequence continues... 4 x (1 + 3 + 6 + 10 + 15 + ...) until there are X/2 terms. (As there is between X/2 + 1 and X in one stat. Subtracting X/2 from both those numbers shows there are X/2 terms.)
So, we've just gotta prove what each term is, and what it sums to.
Writing them back in the factorial forms (i.e. the initial representation for the number of ways to count the *s and |s) gives:
4 x (1 + 3!/(1! x 2!) + 4!/(2! x 2!) + 5!/(3! x 2!) + ... + (r+1)!/((r-1)! x 2!) + ... + (X/2+1)!/((X/2-1)! x 2!)). (r represents a general term in the sum)
We can simplify (r+1)!/((r-1)! x 2!) to be (r x (r+1))/2, or just (r^2 + r)/2. (Notably, with r = 1, this expression is 1.)
So, we just need to find the sum of all the square numbers from 1 to (X/2)^2, add on the sum of all the numbers between 1 and X/2 (inclusive), then divide that total by 2.
If you're following this proof so far, you'll probably know that the sum of all numbers between 1 and n (inclusive) is n(n+1)/2. And that the sum of the first n square numbers (starting from 1) is n(n+1)(2n+1)/6. I'm not going to prove those results because I'm lazy. So, to find our total, we just have to add them together, divide by 2, and substitute in n = X/2. Which gives X(X+2)(X+4)/48. Then we have to multiply by 4 (there are 4 stats, so there are 4 times as many ways for the statline to be illegal). This gives X(X+2)(X+4)/12. 
Substituting in X = 10 gives 140 = 60 + 40 + 24 + 12 + 4, as requires.
Technically, this proof isn't really rigorous. It's more of a derivation than anything. But, eh, you probably just wanna see big numbers.[/spoiler]
For an odd X, there are [(X+3)! / (X! x 3!)] - (X+1)(X+3)(X+5)/12 possible statlines. This simplifies nicely to: (X-1)(X+1)(X+3)/12

Proof/explanation/rambling:
[spoiler]
With an odd X, there are (X+1)/2 terms in the sequence, rather than X/2. Since the illegal stat can be between X/2 + 0.5 and X - the ceiling of X/2 (X/2 rounded up to the next integer) to X. Example: for X = 11, we have the possibility of the illegal stat being 6, 7, 8, 9, 10, or 11. Which would give 4 x (1 + 3 + 6 + ... + 21) illegal statlines.
So, we can just take this from before (X(X+2)(X+4)/12)and just replace each X with X + 1, and then simplify. So there are (X+1)(X+3)(X+5)/12 illegal statlines when X is odd.[/spoiler]

And here's a table of the numbers (yeah, I know no one is gonna get 40 stats with an alt form, but there's still powerups and shiz):
[spoiler]
number of stat points: number of valid statlines
0: 1
1: 0
2: 6
3: 4
4: 19
5: 16
6: 44
7: 40
8: 85
9: 80
10: 146
11: 140
12: 231
13: 224
14: 344
15: 336
16: 489
17: 480
18: 670
19: 660
20: 891
21: 880
22: 1156
23: 1144
24: 1469
25: 1456
26: 1834
27: 1820
28: 2255
29: 2240
30: 2736
31: 2720
32: 3281
33: 3264
34: 3894
35: 3876
36: 4579
37: 4560
38: 5340
39: 5320
40: 6181
41: 6160[/spoiler]

Notably, odd numbers have less combinations than the even number before them. This is because, while there are more possible stat combinations, a larger proportion of them are illegal. When getting a stat increase to boost you to an even number of stat points, you can put it in any stat. When getting one to boost you to an odd total, you cannot (e.g. with 5/5/0/0, you can't put your next stat point into ATK or DEF).

...

Pretty sure this is probably all correct. Maybe. Idk. It seemed logical when I wrote it by hand. So, here ya go. If you want to make this a table in excel, you can use:
[spoiler]
Code:
=IF(ISEVEN(B3),(B3+2)*(B3^2+4*B3+6)/12,(B3-1)*(B3+1)*(B3+3)/12)

But replace B3 with whatever cell you want.[/spoiler]
#2
*plugs into excel*

[Image: giphy.gif]
[Image: hnc9xy5]
New to the Omniverse? Don't be afraid to PM me for assistance!
Gamzee Makara Wrote:S’aight. After all, dogs have a tendency to motherfuckin’ bite.


Forum Jump:


Users browsing this thread: 1 Guest(s)