// 각 등수별 남은 개수와 총 개수 const prizes = [ { rank: 1, remaining: 2, total: 5 }, { rank: 2, remaining: 1629, total: 4000 }, { rank: 3, remaining: 1965, total: 5000 }, { rank: 4, remaining: 4030, total: 10000 }, { rank: 5, remaining: 4033, total: 10000 } ]; // 등수별 확률 및 누적 확률 계산 const probabilities = prizes.map(prize => prize.remaining / prize.total); const cumulativeProbabilities = probabilities.reduce..