点击我打开题目链接

题目大意:

\((x,y)\)上,并且它在直角三角形中选择的位置和移动方向的概率都是相等的。问你这只蚂蚁在最长的边上走出去的概率是多少?



###注意:以下是题目的解析。


###如果你想要享受做数学题的乐趣就不要看下面了啦。(╯ ̄Д ̄)╯╘═╛ (其实看了也无所谓...)












简要题解:

Project Euler 613  Pythagorean Ant(概率+积分)

我们假设蚂蚁在 $ A(x,y) $ 点。

枚举一下题意,画一下图...( 随手画的...丑了点...)

我们可以得到:

\(\alpha=\arctan(\frac{x}{40-y})\)

\(\alpha+\beta=\arctan(\frac{30-x}{y})\)

\(\beta=\arctan(\frac{30-x}{y})-\arctan(\frac{x}{40-y})\)

\(\theta=\pi-\left(\arctan(\frac{30-x}{y})-\arctan(\frac{x}{40-y})\right)\)

\(f(x,y)=\frac{\theta}{2\pi}=\frac{1}{2}-\frac{1}{2\pi}*\left(\arctan(\frac{30-x}{y})-\arctan(\frac{x}{40-y})\right)\)

最后积分一下,所以概率就为:

\(ans = \frac{1}{600}*\int_0^{30}\int_0^{40-\frac{40x}{30}}\left[\frac{1}{2}-\frac{1}{2\pi}*\left(\arctan(\frac{30-x}{y})-\arctan(\frac{x}{40-y})\right)\right]\,\mathrm{d}x\mathrm{d}y\)

\(7\)th啦。

相关文章:

  • 2021-10-01
  • 2021-05-22
  • 2022-02-09
  • 2021-09-05
  • 2021-07-28
  • 2021-08-03
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-07-17
相关资源
相似解决方案