← 回熱門
🎮 C洽 💨 剛冒煙 💬

想用AI寫個檔案新制抽卡模擬程式

👤 arrenwu (最是清楚哇她咩) 🕐 Mon Jul 27 22:41:57 2026
▲ 8 推 ▼ 0 噓 → 19 回應
分享
🔔 追這個瓜,別錯過後續
挑下面的關鍵字追蹤——只要 爆了有後續延燒,第一時間通知你

就看了看其實也好奇 這新制到底抽到雙UP 通常期望要多少抽

目的就抽齊雙UP A角和B角 這樣花多少抽

跑個預設50萬次人數

然後紀錄做統計圖 幾個人位於10抽 20抽...400抽這樣的區間

然後檔案機率 雙UP機率

應該是各0.35%嗎?

還是說有人自己算好了 我不用自己做滿足自己好奇心= =

50萬次人數 <---- =D=

我簡單地寫了個 Python Script,

這樣花凜也有機會參與討論了

@GENE78113263

https://x.com/GENE78113263/status/207907339690…

跑新制跟舊制模擬各5000萬次差不多10秒

新舊模擬結果

每一條都是用 10抽為區間,

也就是 10抽 20抽...400抽

有錯誤也請大家提出糾正 :D

import datetime

import random

import numpy as np

from numba import njit, prange

import matplotlib.pyplot as plt

p = 0.007

@njit

def simulate_gacha_dual_pu_new_policy_single_run():

count = 0

# First pool

for i in range(1,200+1):

count += 1

if i == 100:

win = random.random() < 0.5

else:

win = random.random() < p

if win:

break

# Second pool

for j in range(1,200+1):

count += 1

if j == 100:

win = random.random() < 0.5

else:

win = random.random() < p

if win:

break

return count

@njit

def simulate_gacha_dual_pu_old_policy_single_run():

count = 0

cumulated_count = 0

# First pool

for i in range(1,200+1):

count += 1

cumulated_count +=1

win = random.random() < p

if win:

break

elif cumulated_count == 200:

# consume the ticket

cumulated_count = 0

break

# Second pool

for j in range(1,200+1):

count += 1

cumulated_count +=1

win = random.random() < p

if win or cumulated_count == 200:

break

return count

@njit(parallel=True)

def simulate_gacha_dual_pu_new_policy(runs=100000):

results = np.zeros(runs)

for i in prange(runs):

results[i] = simulate_gacha_dual_pu_new_policy_single_run()

return results

@njit(parallel=True)

def simulate_gacha_dual_pu_old_policy(runs=100000):

results = np.zeros(runs)

for i in prange(runs):

results[i] = simulate_gacha_dual_pu_old_policy_single_run()

return results

if __name__ == '__main__':

runs = 50_000_000 # 模擬次數

time_start = datetime.datetime.now()

# 新機制雙PU模擬

results_new_policy = simulate_gacha_dual_pu_new_policy(runs=runs)

# 舊機制雙PU模擬

results_old_policy = simulate_gacha_dual_pu_old_policy(runs=runs)

# 繪製 Histogram

bins = np.arange(0, 400+1, 10)

plt.figure()

plt.subplot(211)

plt.hist(results_new_policy, bins)

plt.title('New Policy')

plt.subplot(212)

plt.hist(results_old_policy, bins)

plt.title('Old Policy')

print(datetime.datetime.now() - time_start)

--

鳳雛的清楚講習

--

看 PTT 原文 ↗ 接著看下一篇 ▶ 想用AI寫個檔案新制抽卡模擬程式 🎮 C洽 · ▲6▼1看下一篇 →

📚 本系列文章

共 2 篇・依時間排序
7/27 [閒聊] 想用AI寫個檔案新制抽卡模擬程式 ▲6 7/27 Re: [閒聊] 想用AI寫個檔案新制抽卡模擬程式 ▲7

🍉 更多相關的瓜

同板/同主題,繼續吃
🎮 C洽 [Vtub] Hololive 晚間直播單 (1150727) ▲710▼1 🎮 C洽 吉田直樹:重製《FF6》等作恐得拆成4、5部曲 ▲153▼1 🎮 C洽 hololive Dreams第一次活動就是泳裝 ▲287▼1 🎮 C洽 [Vtub] Hololive 日間直播單 (1150727) ▲774▼1