# 【Puzzle】仓促的决斗

|

【对算法，数学，计算机感兴趣的同学，欢迎关注我哈，阅读更多原创文章】

# 问题

## The-Hurried-Duelers

Duels in the town of Discretion are rarely fatal
There, each contestant comes at a random moment between 5am and 6am on the appointed day, and leaves exactly 5 minutes later, honor served, unless his opponent arrives within the time interval and then they fight
What fraction of duels lead to violence?

# 思路参考

(x, y) 会随机地在图中的正方形区域中产生，如果两个人的时间间隔小于 1/12 则会发生决斗，也就是 abs(x - y) < 1/12，这对应于图中的阴影部分。

(x, y) 落在阴影的概率是阴影面积与正方形面积的比值。

Share