My technical memo
Category
Computer and Internet
(49)
Programming
(19)
Mathematics
(10)
R
(8)
Bash
(6)
C++
(3)
LaTeX
(3)
Syntax
(2)
武术
(2)
Brain Teaser
(1)
CLRS
(1)
Complexity Analysis
(1)
Iteration
(1)
Mac
(1)
Markov Chain
(1)
Probability
(1)
Recursion
(1)
Spirituality
(1)
Tuesday, May 4, 2010
翻到4张A的次数
问题:52张牌随机放在桌上排成一排,你从第一张牌开始依次翻开。问平均多少次翻开所有4张A?
解法1
:
假设第$X$步翻开第4张A,则
\[P(X=k) = C(k-1,3)/C(52,4), \qquad k=4, \cdots 52\]
从而
\[E(X) = \sum_{k=4}^{52} k C(k-1,3)/C(52,4)\]
用R写个简单小程序,可以算出$E(X)=42.4$
解法2
:
4张A隔开5个位置,其他48张牌可以任选一个位置放。从而平均有48*1/5 = 9.6张牌放在4张A之后。从而第4张A平均出现在52-9.6=42.4张牌的位置。
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Sitemeter
Visitors
No comments:
Post a Comment