Programming, Statistics.
code. Monte Carlo Simulation for Gacha, code by the author Let’s try the code above by running 50 simulations of gacha roll. The result is as follows (Note that the result might different in each run of simulation). > x=runif(50) > rarity=3:5 > PDF=c(0.945,0.05,0.005) > sim=mc.sim(x,rarity,PDF)