Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编程与数学(2): Geometric Series #12

Open
shidenggui opened this issue Sep 16, 2018 · 4 comments
Open

编程与数学(2): Geometric Series #12

shidenggui opened this issue Sep 16, 2018 · 4 comments
Labels

Comments

@shidenggui
Copy link
Owner

编程与数学(2): Geometric Series

缘起

  前几天偶然看到一道题:A、B 打赌互相扔硬币,先抛出正面的人胜利,假设 A 先抛的话他赢的概率是多少? 当时跟同事讨论了下,结果是 2/3。感觉这题挺有意思的,就想详细研究下,所以有了这篇文章。

正文

解法

  从概率的角度看,第一个人可能赢在第 1、3、5、7 ..... 次,而每次赢必然是前几次抛硬币结果都为负,最后一次为正,因为抛硬币为独立事件,则可以知道赢的概率之和为:

还有呢?

如果有 3 个人或者说 k 个人打赌,那第一个人赢的概率是多少呢?

  如果是 3 个人打赌,则第一个人可能赢在第 1、4、7、11 ..... 次,则在级数中对应的项次由两个人时的 2n+1变为 3n+1(注:n 从零开始),同理可得如果是 k 个人,则为 kn+1,则可以知道 k 个人时赢的概率之和为:

k=3,则 P(A) = 4 / 7

如果 A、B 决定加点难度,改为掷骰子,先掷出 6 点的人胜,那第一个人赢的概率是多少呢?

  同理可知,第一个人可能赢在第 1、3、5、7 ..... 2n+1 次,稍微不同是赢之前的那几次,他们只需要不掷出 6 即可:

如果是掷 t 面骰子,先掷出 t 点的人赢,那第一个人赢的概率是多少?

如果是 k 个人掷 t 面骰子,先掷出 t 点的人赢呢,那第一个人赢的概率是多少?

结尾

  从上可以知道其实所有变化都只是 Geometric Series 的变种。这就是数学的魅力所在,从各种各样的形式中发现统一的模式,又将这统一的模式应用于无穷无尽的变化中。

枢始得其环中,以应无穷。 --《庄子·齐物论》
@po88sdf
Copy link

po88sdf commented Oct 31, 2018

那博主你怎么说你不熟悉等比数列求和(没有恶意 单纯好奇...)

@shidenggui
Copy link
Owner Author

@po88sdf 太久没用都没印象了。想想以前还是学奥数的人,真的是用进废退。现在是从头开始补。

@niu476806865
Copy link

那我问一下第一题A输掉的概率是多少

@shidenggui
Copy link
Owner Author

@niu476806865 1/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants