Leetcode-cn.com 2021-09-05
🟡 470.implement-rand10-using-rand7
🏷️ Tags
#math #rejection_sampling #probability_and_statistics #randomized
Description
已有方法
不要使用系统的
Example
🟡 470.implement-rand10-using-rand7
🏷️ Tags
#math #rejection_sampling #probability_and_statistics #randomized
Description
已有方法
rand7 可生成 1 到 7 范围内的均匀随机整数,试写一个方法 rand10 生成 1 到 10 范围内的均匀随机整数。不要使用系统的
Math.random() 方法。Example
输入: 1
输出: [7]
808.soup-servings.pdf
93.9 KB
leetcode.cn 2022-11-21
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
leetcode.com 2023-05-25
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
Telegraph
new-21-game
Alice plays the following game, loosely based on the card game "21". Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is…
leetcode.cn 2023-05-27
🟡1093.statistics-from-a-large-sample
🏷️ Tags
#array #math #probability_and_statistics
🟡1093.statistics-from-a-large-sample
🏷️ Tags
#array #math #probability_and_statistics
Telegraph
statistics-from-a-large-sample
我们对 0 到 255 之间的整数进行采样,并将结果存储在数组 count 中:count[k] 就是整数 k 在样本中出现的次数。 计算以下统计数据:
leetcode.com 2025-08-08
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
Telegraph
soup-servings
You have two soups, A and B, each starting with n mL. On every turn, one of the following four serving operations is chosen at random, each with probability 0.25 independent of all previous turns:
leetcode.cn 2025-08-17
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
Telegraph
new-21-game
爱丽丝参与一个大致基于纸牌游戏 “21点” 规则的游戏,描述如下: 爱丽丝以 0 分开始,并在她的得分少于 k 分时抽取数字。 抽取时,她从 [1, maxPts] 的范围中随机获得一个整数作为分数进行累计,其中 maxPts 是一个整数。 每次抽取都是独立的,其结果具有相同的概率。 当爱丽丝获得 k 分 或更多分 时,她就停止抽取数字。 爱丽丝的分数不超过 n 的概率是多少? 与实际答案误差不超过 10-5 的答案将被视为正确答案。
leetcode.com 2025-08-17
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
Telegraph
new-21-game
Alice plays the following game, loosely based on the card game "21". Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is…