# General

Mathematical Starforce

Many of us looked at the KMS charts for starforce's superior item enhancement statistics and numbers.
Now that it's all been changed to an extent I yearn for a person to figure out the same things.
We have success rate, cost per attempt, boom rate and degrade rate.

How would one go about calculating the average cost to achieve a certain star, as well as average boomed items at certain star check points?
EDIT: Some partial aid for lazy pink beany baby butts.
[url=http://imgur.com/lTEoypy]Cropped Percentages and cost, side by side.[/url]
[url=http://oi62.tinypic.com/2ywbalj.jpg]@hyperfire7 's chart, shows cost to reach a star.[/url]
Assume 0 cost tyrant

December 3, 2014

Average total cost from zero to xx stars for tyrants plus cost from one to next star on the right:
1 Stars ~ 111,781,089 mesos
2 Stars ~ 334,747,583 mesos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[1&gt;2 ~ 223125571 mesos]
3 Stars ~ 699,998,999 mesos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[2&gt;3 ~ 362128766 mesos]
4 Stars ~ 1,272,053,487 mesos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [3&gt;4 ~ 568414228 mesos]
5 Stars ~ 2,049,710,610 mesos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [4&gt;5 ~ 787924106 mesos]
6 Stars ~ 3,090,710,354 mesos | destroyed: ~ 0.043 - - - - - - - - [5&gt;6 ~ 1053000317 mesos | destroyed: ~0.045]
7 Stars ~ 4,537,479,544 mesos | destroyed: ~ 0.19 - - - - - - - - - - [6&gt;7 ~ 1452862717 mesos | destroyed: ~0.14]
8 Stars ~ 6,608,690,017 mesos | destroyed: ~ 0.47 - - - - - - - - - - [7&gt;8 ~ 2078473126 mesos | destroyed: ~0.29]
9 Stars ~ 9,797,153,062 mesos | destroyed: ~ 0.99 - - - - - - - - - - [8&gt;9 ~3170482843 mesos | destroyed: ~0.52]
10 Stars ~ 15,887,073,168 mesos | destroyed: ~ 2.08 - - - - - - - -[9&gt;10 ~6049610374 mesos | destroyed: ~1.07]
11 Stars ~ 29,233,101,758 mesos | destroyed: ~ 4.52 - - - - - - [10&gt;11 ~13287226117 mesos | destroyed: ~2.45]
12 Stars ~ 58,021,875,793 mesos | destroyed: ~ 9.88 - - - - - -[11&gt;12 ~28747478307 mesos | destroyed: ~5.33 ]

13 Stars ~ 1,383,110,566,683 mesos | destoyed: ~ 257.28
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [12&gt;13 ~1,330,006,796,966 mesos | destoyed: ~248.32]

14 Stars ~ 71,100,015,402,344 mesos | destroyed: ~ 13,263.99
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[13&gt;14 ~70,442,661,707,581 mesos | destoyed: ~13142.26]

15 Stars ~ 6,888,872,904,106,804 mesos | destroyed: ~ 1,285,023.37 | ~123,385,303 upgrade attempts
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [14&gt;15 ~6,811,821,275,900,769 mesos | destroyed: ~1,270,649.37]

using this c++ code:
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;random&gt;

int main()
{ const int equipNum=100000; //number of equips simulated
int numTries[equipNum], numDestroy[equipNum];
int successRate[]={50,50,45,40,40,40,40,40,40,37,35,35,3,2,1}, destroyRate[]={0,0,0,0,0,3,5,7,10,15,20,25,50,50,50};
int consecutiveFails=0,currentStars=-1,previousStars=0,desiredStars=0,a=-1;
double averageNumTries=0,averageNumDestroy=0,averagecost=0;

std:efault_random_engine engine;
std::uniform_real_distribution&lt;double&gt; gen(0.0, 1.0);
while(desiredStars&gt;15 || desiredStars&lt;1){
std::cout &lt;&lt; &quot;Please enter the desired number of stars (up to 15): &quot;;
std::cin &gt;&gt; desiredStars;
}
while(a&lt;0||a&gt;desiredStars){
std::cout &lt;&lt; &quot;Please enter the current number of stars (up to 14): &quot;;
std::cin &gt;&gt; a;
}

currentStars=a;
for(int i=0;i&lt;equipNum;i++){numTries[i]=0;numDestroy[i]=0;}
for(int i=0;i&lt;equipNum;i++){

while(currentStars&lt;desiredStars){
if(consecutiveFails==2&amp;&amp;previousStars!=0){ //Chance Time!
consecutiveFails=0;
currentStars++;
}
else if(gen(engine)*100&lt;successRate[currentStars]){ //Pass
previousStars=currentStars;
consecutiveFails=0;
currentStars++;
}
else if(gen(engine)*100&lt;destroyRate[currentStars]){ // Fail(Destroy)
currentStars=0;
consecutiveFails=0;
numDestroy[i]++;
}
else{ // Fail(Drop)
if(currentStars&gt;0){consecutiveFails++;currentStars--;}
}
numTries[i]++;
}
currentStars=a;
}

for(int i=0;i&lt;equipNum;i++){averageNumTries+=numTries[i];averageNumDestroy+=numDestroy[i];}
averageNumTries/=equipNum;
averageNumDestroy/=equipNum;
averagecost = averageNumTries * 55832200;

std::cout &lt;&lt; &quot;Average Total Cost to go from &quot; &lt;&lt; a &lt;&lt; &quot; stars to &quot; &lt;&lt; desiredStars &lt;&lt; &quot;: &quot; &lt;&lt; std::setprecision(18) &lt;&lt; std::setw(24) &lt;&lt; averagecost &lt;&lt; &quot; mesos&quot; &lt;&lt; endl;
std::cout &lt;&lt; &quot;Average Number of tries to go from &quot; &lt;&lt; a &lt;&lt; &quot; stars to &quot; &lt;&lt; desiredStars &lt;&lt; &quot;: &quot; &lt;&lt; std::setprecision(10) &lt;&lt; std::setw(24) &lt;&lt; averageNumTries &lt;&lt; endl;
std::cout &lt;&lt; &quot;Average Number of times destroyed: &quot; &lt;&lt; std::setprecision(10) &lt;&lt; std::setw(24) &lt;&lt; averageNumDestroy;
std::cin &gt;&gt; a;
return 0;
}

February 8, 2015 - edited

My own script written in python
trials: 10000

star # : total cost average (marginal cost average (simulated separately))
star 1 : 112.87m
star 2 : 335.24m (+226.42)
star 3 : 696.94m (+363.07)
star 4 : 1266.22m (+581.25)
star 5 : 2072.98m (+802.04)
star 6 : 3167.73m (+1084.92)
star 7 : 4822.18m (+1644.70)
star 8 : 7364.27m (+2616.51)
star 9 : 11753.92m (+4589.88)
star 10 : 21155.26m (+9509.62)
star 11 : 43768.76m (+22501.96)

marginal cost average is the cost to go from the previous star to the next star ex: Going from 1 star to 2 star is 226m~
total cost average is the cost to go from no stars to that star.

My numbers are pretty much the same to what @lazypando is getting for the first 5. Not quite getting what @hyperfire7 has though.

December 4, 2014 - edited

I've whipped up a quick simulation that takes the cost of the item into account as well for Superior Items. The code's available [url=http://ideone.com/66Fo0A]here[/url], if anyone's interested. Hopefully I didn't screw anything up, since it's almost 5am here. I've made the assumption that the probability of failure and the probability of an item being destroyed are independent.

Ideone might not let you run absurdly large amounts of test cases, as they have a 5 second execution limit on programs. You can try registering an account, which brings your execution time up. If that still doesn't work, just download the code and run in Netbeans or something.

Standard input takes in 4 values:
1. the amount of test cases to run
2. the initial amount of stars on your equipment
3. the final amount of stars on your equipment
4. cost of the equipment (assuming you're always buying at the same cost)

Sample Input:
1000 0 13 2000000000
1. Run 1000 test cases
2. Start at 0 stars
3. Go up to 13 stars
4. The cost of the item is 2000000000 (2b)

It gives you the average cost (including repurchasing equipment) and the average amount of times the item was destroyed.

To get to 13 stars, it costs ~1,861,168,868,874 (assuming the item costs 2b) and the item gets destroyed ~255 times.

December 3, 2014 - edited

Well, I figured out a method to theoretically compute the probability distribution function for the number of successes given k enhancements, but its a real pain to actually plug the numbers in. If I put a huge ass function here would anyone be willing to do the gruntwork and plug in the numbers?

December 3, 2014 - edited

Ok here is the revised one. http://oi62.tinypic.com/2ywbalj.jpg
It STILL doesn't apply the cost of replacing the superior item when it booms (since price of tyrant equips differ by which tyrant item it is, by server, and by time).

December 3, 2014 - edited

ran simulations (1000 runs per star)
code here: http://pastebin.com/SRFUyLBy

for tyrants:
1st star - 111,664,400 mesos
2nd star - 223,328,800 mesos
3rd star - 368,827,513 mesos
4th star - 591,486,326 mesos
5th star - 774,336,781 mesos

numbers are averages over 1000 runs, not exact
i'd say give or take 10%

too lazy to do past 5 star because how would you value a destroyed item?

disclaimer: all of this could be wrong though. literally spent 5minutes on the code

December 3, 2014 - edited

[quote=cb000]I wrote a script to simulate Star Force and am running the simulations right now. The simulation for Tyrants will take a while, though.[/quote]

December 3, 2014 - edited

I wrote a script to simulate Star Force and am running the simulations right now. The simulation for Tyrants will take a while, though.

December 3, 2014 - edited

I see you got your suit.

December 3, 2014 - edited

Dammit you got my hopes up. I'm expecting the 12 bil to go up exponentially

December 3, 2014 - edited

[quote=hyperfire7]Oh the star decreases if you fail?
Damn nvm.[/quote]

yes, for superior. 100% chance

December 3, 2014 - edited

[quote=Snowman]1st star cost: 111m
1=&gt;2 star attempt: oh gg you failed, 0 stars again. 55m
1st star redo: 111m
2nd star attempt: hooray! 2 stars! 55m
That's 333m ish unless I'm terribly mistaken..
I'm rather young and look up to others' math knowledge, so please correct me if I did make a mistake
toomanyedits: @above, Yes but for consistency's sake let's use Starforce values as AEE values vary per world.[/quote]
Oh the star decreases if you fail?
Damn nvm.

December 3, 2014 - edited

[quote=hyperfire7]Yes.
However, the chart doesn't factor the # of times you'll have to repurchase a clean version of the equipment to apply the equipment trace should it get destroyed. So expect the average total cost to rise significantly after the 9th star.[/quote]

1st star cost: 111m
1=&gt;2 star attempt: oh gg you failed, 0 stars again. 55m
1st star redo: 111m
2nd star attempt: hooray! 2 stars! 55m
That's 333m ish unless I'm terribly mistaken..
I'm rather young and look up to others' math knowledge, so please correct me if I did make a mistake
toomanyedits: @above, Yes but for consistency's sake let's use Starforce values as AEE values vary per world.

December 3, 2014 - edited

cant you just aee the first star? since the first one is 100%?

December 3, 2014 - edited

[quote=Snowman]Does this chart take into account the average amount of times you have to repeat a certain enhancement after you downgrade?
12 billion seems like a dream. [/quote]
Yes.
However, the chart doesn't factor the # of times you'll have to repurchase a clean version of the equipment to apply the equipment trace should it get destroyed. So expect the average total cost to rise significantly after the 9th star.

December 3, 2014 - edited

[quote=hyperfire7]http://oi60.tinypic.com/a0e39s.jpg
There you go.[/quote]

Does this chart take into account the average amount of times you have to repeat a certain enhancement after you downgrade?
12 billion seems like a dream.
EDIT: I feel these numbers will help greatly the more I stare into the grid-ed screen. Thanks!

December 3, 2014 - edited

Nvm the chart was bogus.

December 3, 2014 - edited

I'll calculate it as soon as I get out of Hene...

December 3, 2014 - edited

I'd say, don't even bother enhancing Tyrants with Star Force, unless you're trying to get to the 4th star, 5th if you're willing to risk that 3% boom chance. It's more cost efficient to enhance with the old method (Superior Protection Scrolls from 5-7, then No Booms from 8-15), than using the Star Force method, since you can't protect your Tyrant, and although you're provided an Equipment Trace, you still need a brand new Tyrant, and that depends on the cost of each Tyrant in your server.

December 3, 2014 - edited

If anyone can calculate this for my lazy pink bean butt, I'll gladly give you... a hi-five.

December 3, 2014 - edited