문제

Suppose, there are N ordered boxes (Box1, Box2, Box3, ... , BoxN). My question is, what is the probability of the event that strictly only M boxes are in their rightful position? (M boxes need not be contiguous).

For example, there are three boxes, ie N=3. Permutations are:

([Box1,Box2,Box3] [Box1,Box3,Box2] [Box2,Box1,Box3] [Box2,Box3,Box1] [Box3,Box1,Box2] [Box3,Box2,Box1])

If M=1, the favourable outcomes are ([Box1,Box3,Box2] [Box3,Box2,Box1] [Box2,Box1,Box3]). Hence, probability that strictly only one box is in its rightful position = 3/6.

I'll appreciate any help. I just can't find the solution.

도움이 되었습니까?

해결책

You can determine the probability inductively, based on the first slot holding the correct item or not: p(n,m) = (1/n)*p(n-1,m-1) + ((n-1)/n)*p(n-1,m).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top