Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
It's quite simple and calculated using Bernoulli's formula. However, you need to consider that the probability we need is a sum. That is, how the algorithm works when calculating the skill's activation.
There are n cows. This means we generate a random number n times, for example, from 1 to 100. Let's say we get the number from 1 to 10 k times. Then, the algorithm checks how many dozens of cows we have in the stack, i.e., it divides n by 10 and rounds up, obtaining the number d. If the resulting k is greater than the number d, then the number of creatures dying from the gaze is d. If k is less than or equal to d, then the number of creatures dying is k.
To calculate the probabilities in percentages, you need to use Bernoulli's formula.
where
Using this formula, we calculate the probability that k cows out of n will use their ability with a chance of p = 10% (or 0.1) for each. But there's a catch: in the algorithm, we also perform, let's say, a truncation based on the number d. That is, in reality, when a stack of n cows attacks, and we are interested in the chance of how many will die from the gaze, we must sum all the probabilities when k is equal to or greater than d.
For example, we have 11 cows, and we are interested in the chance of killing two units with a deadly gaze.
We get: according to Bernoulli's formula, the probability that 2 out of 11 will get a number from 1 to 10 is P(2) = 0.21308126895; 3 out of 11 is P(3) = 0.07102708965; P(4) = 0.0157837977, and so on, up to P(11) = 0.00000000001.
Then, we add up all these probabilities, since they are all favorable to us. The result is:
P = 0.30264312 (or the 30% that is in the table)
I hope I explained it not too clumsily)
Thank you very much! This is exactly what I needed. :smile20: