# Some Hybrid missions probabilities

On September 9, 2021, iA shares this source code for Hybrid missions:

``````// Decide which stages will be replaced in hybrid missions
const int hybridReplacement1 = rng.getI2(1, 4);
const int hybridReplacement2 = hybridReplacement1 + 1 + rng.getI2(1, 4);
const int hybridReplacement3 = hybridReplacement2 + 1 + rng.getI2(1, 4);

...

if (pd->perPlanetMissionType == HYBRID)
{
pd->perPlanetMissionType = INVASION; // Default setting
// Certain planets have a chance of being substituted with another type
if (p > 0 // Never replace first stage
&& p < pInfo->numPlanets - 1 // Never replace last stage
&& (p == hybridReplacement1 || p == hybridReplacement2 || p == hybridReplacement3))
{
RandomPick rp;

pd->perPlanetMissionType = rp.pick(&rng).index;
}
}
``````

EXPLANATION

• Up to 3 stages can be replaced:

• A random stage out of the 4 stages from stage 2 to stage 5.

• A second random stage out of the 4 stages from stage 2 to stage 5 after the first replaced stage.

• A third random stage out of the 4 stages from stage 2 to stage 5 after the second replaced stage.

• First stage and last stage cannot be replaced.

A replaced stage has the following possibilities: Invasion, Comet Chase, Supernova, Meteor Storm, Feather, Supply Droid (0.5 weight), Boss Rush (0.125 weight). This translates to:

Type Chance
Chicken Invasion 8/45
Comet Chase 8/45
Supernova 8/45
Meteor Storm 8/45
Feather Fields 8/45
Supply Droid 4/45
Boss Rush 1/45

However, when I play Weekly Challenge, I usually only see two replaced stages that is not Chicken Invasion, sometimes only one, but I donâ€™t often see three, so I will attempt to calculate it.

CHANCE OF BEING REPLACED BY OTHER STAGES (EXCEPT CHICKEN INVASION)

To make it easier to program and calculate, in this C++ program I assume a Hybrid mission can have up to 15 stages (for calculation in the edge case where the replaced stages are 5, 10 and 15).

``````#include <iostream>

using namespace std;

void reset_stages(int stage[], int length){
for (int i = 0; i < length; i++)
stage[i] = 0;
}
int valid_replaced_stages(int stage[], int length){
int res = 0;
for (int i = 1; i <= 8; i++){ //check from stage 2 to stage 9 (Weekly Challenge)
if (stage[i] == 1)
res++;
}
return res;
}
void print_stages(int stage[], int length, int &one, int &two, int &three){
int replaced = valid_replaced_stages(stage, length);
for (int i = 0; i < length; i++)
cout << stage[i] << " ";
cout << " - Replaced stages: " << replaced;
cout << endl;
if (replaced == 1)
one++;
else if (replaced == 2)
two++;
else
three++;
}
void print_all(int stage[], int length, int &one, int &two, int &three){
for (int replace1 = 1; replace1 <= 4; replace1++){
for (int replace2 = 2; replace2 <= 5; replace2++){
for (int replace3 = 2; replace3 <= 5; replace3++){
stage[replace1] = 1;//Replaced stages: 1, other stages: 0
stage[replace1 + replace2] = 1;
stage[replace1 + replace2 + replace3] = 1;
print_stages(stage, length, one, two, three);
reset_stages(stage, length);
}
}
}
double one_percent = 100 * (double)one / (double)(one + two + three);
double two_percent = 100 * (double)two / (double)(one + two + three);
double three_percent = 100 * (double)three / (double)(one + two + three);
cout << "One replaced stage: " << one << " cases - " << one_percent << "%" << endl;
cout << "Two replaced stages: " << two << " cases - " << two_percent << "%" << endl;
cout << "Three replaced stages: " << three << " cases - " << three_percent << "%" << endl;
}
int main()
{
int stage[15];
//Number of cases that have one, two, three replaced stages
int one = 0, two = 0, three = 0;
reset_stages(stage, 15);
print_all(stage, 15, one, two, three);
return 0;
}
``````

The program gives a total of 64 (= 4^3) cases of replaced stages, the output is below:

``````0 1 0 1 0 1 0 0 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 1 0 0 1 0 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 1 0 0 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 1 0 0 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 1 0 1 0 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 1 0 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 1 0 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 1 0 0 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 1 0 0 0 1 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 0 1 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 0 1 0 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 1 0 0 0 1 0 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 1 0 0 0 0 1 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 1 0 0 0 0 1 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 1 0 0 0 0 1 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 1 0 0 0 0 1 0 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 1 0 1 0 1 0 0 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 1 0 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 1 0 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 1 0 0 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 1 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 0 1 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 0 1 0 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 1 0 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 1 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 1 0 0 0 1 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 1 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 1 0 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 0 1 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 0 1 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 0 1 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 1 0 0 0 0 1 0 0 0 0 1 0 0  - Replaced stages: 2
0 0 0 1 0 1 0 1 0 0 0 0 0 0 0  - Replaced stages: 3
0 0 0 1 0 1 0 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 0 1 0 1 0 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 1 0 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 1 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 0 1 0 0 1 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 1 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 1 0 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 1 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 1 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 1 0 0 0 0 1 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 0 1 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 0 1 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 0 1 0 0 0 1 0 0  - Replaced stages: 2
0 0 0 1 0 0 0 0 1 0 0 0 0 1 0  - Replaced stages: 2
0 0 0 0 1 0 1 0 1 0 0 0 0 0 0  - Replaced stages: 3
0 0 0 0 1 0 1 0 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 1 0 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 1 0 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 1 0 1 0 0 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 1 0 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 1 0 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 1 0 0 0 0 1 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 0 1 0 1 0 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 0 1 0 0 1 0 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 0 1 0 0 0 1 0 0  - Replaced stages: 2
0 0 0 0 1 0 0 0 1 0 0 0 0 1 0  - Replaced stages: 2
0 0 0 0 1 0 0 0 0 1 0 1 0 0 0  - Replaced stages: 1
0 0 0 0 1 0 0 0 0 1 0 0 1 0 0  - Replaced stages: 1
0 0 0 0 1 0 0 0 0 1 0 0 0 1 0  - Replaced stages: 1
0 0 0 0 1 0 0 0 0 1 0 0 0 0 1  - Replaced stages: 1
One replaced stage: 4 cases - 6.25%
Two replaced stages: 40 cases - 62.5%
Three replaced stages: 20 cases - 31.25%
``````

Keep in mind that some of the cases look exactly the same because only stage 2 to 9 can be replaced in the Weekly Challenge, but every case above is different and possible to appear in iAâ€™s code.

Case Weekly Challenge Cup Knockout Match
One replaced stage 1/16 3/8
Two replaced stages 5/8 9/16
Three replaced stages 5/16 1/16

A chance for a stage to be â€śreplacedâ€ť with Chicken Invasion, basically the same, is 8/45. Now letâ€™s see how many stages can truly be replaced (not Chicken Invasion) in Weekly Challenge.

• One replaced stage (1/16 chance):

• One â€śtrueâ€ť replaced stage: 37/45 (NOT Chicken Invasion)

• No â€śtrueâ€ť replaced stages: 8/45 (IS Chicken Invasion)

• Two replaced stages (5/8 chance):

• Two â€śtrueâ€ť replaced stages: (37/45)^2 = 1369/2025

• One â€śtrueâ€ť replaced stage: 37/45 * 8/45 * 2 = 592/2025

• No â€śtrueâ€ť replaced stages: (8/45)^2 = 64/2025

• Three replaced stages (5/16 chance):

• Three â€śtrueâ€ť replaced stages: (37/45)^3 = 50653/91125

• Two â€śtrueâ€ť replaced stages: (37/45)^2 * 8/45 * 3 = 32856/91125

• One â€śtrueâ€ť replaced stage: 37/45 * (8/45)^2 * 3 = 7104/91125

• No â€śtrueâ€ť replaced stages: (8/45)^3 = 512/91125

• Total chances for:

• Three truly replaced stages: 50653/91125 * 5/16 = 50653/291600 = 17.37%

• Two truly replaced stages: 1369/2025 * 5/8 + 32856/91125 * 5/16 = 26011/48600 = 53.52%

• One truly replaced stage: 37/45 * 1/16 + 592/2025 * 5/8 + 7104/91125 * 5/16 = 25123/97200 = 25.85%

• Zero truly replaced stages: 8/45 * 1/16 + 64/2025 * 5/8 + 512/91125 * 5/16 = 1189/36450 = 3.26%

Calculate similarly for the Cup Knockout Match (37.5% chance for one replaced stage, 56.25% for 2 replaced stages, 6.25% for 3 replaced stages), we get the following table:

Case Weekly Challenge Cup Knockout Match
Zero true replaced stages 1189/36450 = 3.26% 7727/91125 = 8.48%
One true replaced stage 25123/97200 = 25.85% 116069/243000 = 47.77%
Two true replaced stages 26011/48600 = 53.52% 195767/486000 = 40.28%
Three true replaced stages 50653/291600 = 17.37% 50653/1458000 = 3.47%

CHANCE OF BEING REPLACED BY BOSS RUSH

With only a 2.22% (1/45) chance of appearing, this is the rarest type of mission that can appear in a Hybrid mission. You actually deserve a â€śluckyâ€ť medal if you manage to play the Hybrid mission when it shows up. For Weekly Challenge:

• One replaced stage (1/16 chance):

• One Boss Rush stage: 1/45

• No Boss Rush stages: 44/45

• Two replaced stages (5/8 chance):

• Two Boss Rush stages: (1/45)^2 = 1/2025

• One Boss Rush stage: 1/45 * 44/45 * 2 = 88/2025

• No Boss Rush stages: (44/45)^2 = 1936/2025

• Three replaced stages (5/16 chance):

• Three Boss Rush stages: (1/45)^3 = 1/91125

• Two Boss Rush stages: (1/45)^2 * 44/45 * 3 = 132/91125

• One Boss Rush stage: 1/45 * (44/45)^2 * 3 = 5808/91125

• No Boss Rush stages: (44/45)^3 = 85184/91125

• Total chances for:

• Three Boss Rush stages: 1/91125 * 5/16 = 1/291600 = 0.0003%, or about 1 week in 5589 years.

• Two Boss Rush stages: 1/2025 * 5/8 + 132/91125 * 5/16 = 37/48600 = 0.08%, or about 1 week in 25 years.

• One Boss Rush stage: 1/45 * 1/16 + 88/2025 * 5/8 + 5808/91125 * 5/16 = 4711/97200 = 4.85%, or about 1 week in 20.63 weeks or once in 144 days.

• No Boss Rush stages: 44/45 * 1/16 + 1936/2025 * 5/8 + 85184/91125 * 5/16 = 69311/72900 = 95.08%

Calculate similarly for the Cup Knockout Match (37.5% chance for one replaced stage, 56.25% for 2 replaced stages, 6.25% for 3 replaced stages), we get the following table:

Case Weekly Challenge Cup Knockout Match
Zero Boss Rush stages 69311/72900 = 95.08% 350966/364500 = 96.29%
One Boss Rush stage 4711/97200 = 4.85% 8933/243000 = 3.68%
Two Boss Rush stages 37/48600 = 0.08% 179/486000 = 0.04%
Three Boss Rush stages 1/291600 = 0.0003% 1/1458000 = 0.00007%
22 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.