← 返回 waymo 的题目列表Ping Pong Game Simulation
类型:online_judge
Two people are playing ping-pong, and one person has a probability p of winning. The match is in a best of 5 games format. Let X be the number of games played until one of them wins. Write a simulation to calculate θ = P(X=5). Follow-up: How to build a confidence interval for θ.
Example
Input
0.5
10000