full mutator randomizer function
-- Select Mutator(s) for the set of rounds
local function SurvivalEvent_MutatorRandomizer(mutatorCount)
local totalMutators = table.getn(mutatorList)
local selectedList = {}
print "selecting mutators"
-- randomly select mutators until a unique list of length mutatorCount is created
if mutatorCount <= totalMutators then
math.randomseed(Time.Now())
while table.getn(selectedList) != mutatorCount do
local rand = random(1,totalMutators)
local found = false
if rand < totalMutators then
for id = 1, table.getn(selectedList) do
if mutatorList[rand] == selectedList[id] then
found = true
end
end
if not found then
table.insert(selectedList, mutatorList[rand])
end
end
end
-- Apply selected Mutators
local totalMutatorsSelected = table.getn(selectedList)
if totalMutatorsSelected > 1 then
LuaGlobalEvent("notifyPluralMutators")
else
LuaGlobalEvent("notifyMutators")
end
for id = 1, totalMutatorsSelected do
Game.AddMutator(selectedList[id])
end
end
end
I’ll look into the Mutator script to check how it really works, as I don’t remember now myself.
You can see in the code that it:
-
draws a random mutator
-
local rand = random(1,totalMutators)
-
-
till it has appropriate number of them for the wave
-
while table.getn(selectedList) != mutatorCount do
-
- also checks if mutators don’t repeat
-
if not found then table.insert(selectedList, mutatorList[rand])
-
You can show why 1/27+1/26+1/25+1/24+1/23 cannot be a correct answer:
-
let’s say we have 27 mutators in a wave -> what’s the probability of getting Unstoppable in a single wave?
-
with @banana_peel’s formula (was 5/27 in previous case ) it’s 27 / 27 = 100% <- ok
-
with your formula it’s:
-
1/27 + 1/26 + … + 1/2 + 1/1 ~ 3.89 > 1 = 100%
- the answer doesn’t make sense because you get a number bigger than 1 which means there’s must be something wrong here.
-
A similar mistake that was made in this post [Feedback] Concerns about drop chance of some MI legendaries
It’s hard for me to explain it simply but when you look at these mutator sequences:
A, B, C, D, E
you say it’s 1/26 for B. And it’s true that when A was already chosen, B has 26 options.
But these events of selecting A and B are not independent as you said and
B is 1/26 to be Unstoppable only if A was not Unstoppable to begin with.
You lost all these events / Mutator sequences where A was Unstoppable.
Then B has 0% chance to be Unstoppable and this has to be included:
Probability of A being Unstoppable = 1/27
Probability of B being Unstoppable =
= 1/26 * (prob A was not Unstoppable) + 0% * (prob A is Unstoppable) =
= 1/26 * 26/27 + 0% * 1/27 =
= 1/27
(using https://en.wikipedia.org/wiki/Conditional_probability)
Probability of C being Unstoppable = 1/25 * (probability A,B were not Unstoppable) 25 / 27 = 1/27
Or in another way straightforward way without conditional probability:
-
we have 27*26*25*24*23 sequences (A,B,C,D,E)
- how many of them have B=Unstoppable?
-
Those that start with A=Not Unstoppable (26 options), then Unstoppable (1 option) then whatever:
- 26*1*25*24*23
-
probability of B being Unstoppable is then:
- (26*1*25*24*23) / (27*26*25*24*23) = (26*1) / (27*26) = 1/27
It took me some time to wrap my head around this 
@grey-maybe By the way your previous answer (10/27) would be correct if mutators could not repeat between wave 1 and 2.
so I agree with Banana’s answer:
- with a separate wave prob to get Unstoppable is 5/27
- so to get Unstoppable in the whole run prob is 1-(1-5/27)^2