Tap here to switch tabs
Problem
Submissions

Problem: New 21 Game

med
30 min
Try to solve the New 21 Game problem.

Statement

Alice starts with a score of 00. While her score is strictly less than k, she repeatedly draws a number uniformly at random from the integers in the range [1,maxPts][1, \text{maxPts}] and adds it to her score. As soon as her score becomes greater than or equal to k, she stops drawing.

Return the probability that Alice’s final score is less than or equal to n.

Constraints:

  • 0≤k≤n≤1040 \leq \text{k} \leq \text{n} \leq 10^4

  • 1≤maxPts≤1041 \leq \text{maxPts} \leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: New 21 Game

med
30 min
Try to solve the New 21 Game problem.

Statement

Alice starts with a score of 00. While her score is strictly less than k, she repeatedly draws a number uniformly at random from the integers in the range [1,maxPts][1, \text{maxPts}] and adds it to her score. As soon as her score becomes greater than or equal to k, she stops drawing.

Return the probability that Alice’s final score is less than or equal to n.

Constraints:

  • 0≤k≤n≤1040 \leq \text{k} \leq \text{n} \leq 10^4

  • 1≤maxPts≤1041 \leq \text{maxPts} \leq 10^4