At the beginning

When I was watching YouTube as usual, I was asked by a social network game, "How much does it cost to complete a high rarity character? I found a very dangerous video, so I simulated it and thought about it roughly.

conditions

Characters and equipment with a rarity of 3 to 5 will appear from the social-net gacha that you handle. High rare here refers only to characters with rarities of 4 and 5. The emission rate of each and the number of characters with that rarity

--Rare 5: 1% (34 bodies) --Rare 4: 3% (59 bodies)

It is like that. It is assumed that characters with the same rarity will appear with equal probability.

Also, instead of turning the gacha once, we will turn 11 times as one set.

Simulate

I wrote it properly in python. It seems that you can write more efficiently, but please close your eyes ()

` Gacha.py`

``````
money_ave = 0
count_ave = 0
min_money = 1000000000
max_money = 0

for num in range(10000):
box_5 = np.zeros(34)
box_4 = np.zeros(59)
money = 0
count = 0
hoshi5_comp = False
hoshi4_comp = False

while True:
for i in range(11):
a = random.randrange(0, 100)

if(a == 0):
hoshi5 = random.randrange(0, 34)
box_5[hoshi5] += 1
elif(a <= 4):
hoshi4 = random.randrange(0, 59)
box_4[hoshi4] += 1

for i in range(34):
if(hoshi5_comp == True):
break

if(box_5[i] == 0):
break

if(i == 33):
hoshi5_comp = True

for i in range(59):
if(hoshi4_comp == True):
break

if(box_4[i] == 0):
break

if(i == 58):
hoshi4_comp = True

money += 1800
count += 11

if(hoshi5_comp and hoshi4_comp):
break

money_ave += money
count_ave += count

if(money < min_money):
min_money = money
if(money > max_money):
max_money = money

money_ave /= 10000
count_ave /= 10000
print(money_ave)
print(count_ave)
print(min_money)
print(max_money)

``````

result

After trying 10,000 times, the average number of revolutions to achieve the goal was 14046. With this social game, 11 stations can be made for about 1800 yen, so I found that it would be possible to complete a high-rare character for about 2.3 million yen.

Of all the simulations, the cheapest one was about 900,000 yen, and the most expensive one was about 7.5 million yen.

in conclusion

I couldn't think of a mathematical expected value calculation method, so I tried to simulate it, but I laughed when I found that it was quite a huge amount. I'm a favorite contributor, so I want you to do your best to the extent that you don't go bankrupt.