What is this, and how does this work?
This is a calculator for probabilities of successfully acquiring a target number of featured/limited five-star characters, and/or featured/limited five-star weapons from wishing in the game, Genshin Impact.
In a nutshell, this calculator can be compared to a simulator in terms of getting results, but without the random number generation, as it just iterates through the combinations/permutations of percentages (chances), multiplying and adding accordingly.
Per this distinction, this should qualify as a calculator rather than a simulator. While "wishing for 5-stars" has a limit that is not too large, it is thus faster, and more accurate.
Would you like a more verbose answer?
A more verbose, though not complete, description:
An essential idea used for this calculator is "x*y=z" where x is the probability to acquire something specifically on "pull count A", y is the probability to acquire something specifically on "pull count B", and z is the probability to acquire something on the total pull count ("pull count A" + "pull count B") through that permutation of the pull counts. Since there are multiple pairings of pull counts that add up to the pull count of z, it would have to process a summation of all the possible permutations to get the total probability for that pull count.
To explain further, we shall focus on calculating for featured five-star characters. To calculate, it will first get a distribution for which pull count the first copy would occur. To compute this distribution, imagine a list of pulls going from the first and to the last. From the start, there will be a starting population of 100%, the amount that has yet to encounter success. For each pull count, there is a percentage (the chance of getting the five-star on that pull count) of that population that will succeed, and be removed from the remaining population.
When the pity gets cleaned by acquiring the first five-star, and there is more to go for, the calculator will combine what it has calculated with pre-calculated data, which describes the cumulative chance for each pull count to have successfully obtained the target number of copies after a clean pity, which was calculated with the code uploaded to this github repository. Finally, it returns a result.
The process for featured five-star weapon probabilities, though a bit more complex, has just about the same (non-exhaustive) description.
If there are both more than zero copies to get on featured five-star characters, and specific featured five-star weapons, there'll be two distributions for the first copy of each, which will be combined, before going through the predefined set of data.