boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - 请教一道排列组合题。
相关主题
问一道排列题
【Brainteaser】Interview Questions
请教道排列组合题 有包子
问一个排列组合题目
问个排列组合题?
一道看起来很简单的排列组合问题
一道组合题 推广了catalan数
问一个面试的问题
一道题
问个有关排列的题
相关话题的讨论汇总
话题: balls话题: 2n话题: black话题: cases话题: number
进入Quant版参与讨论
1 (共1页)
a*******1
发帖数: 1554
1
红球黑球各n个,排成一列,要求对任意的m<=2n,前m个球中红球的数目不少于黑球的
数目。问有多少种排列的方法?谢谢。
p*****k
发帖数: 318
a*******1
发帖数: 1554
3
谢谢!但它只给了公式,请问怎么推导呢?现在大脑真的退化了实在想不到...

【在 p*****k 的大作中提到】
: Catalan number, see e.g.,
: http://en.wikipedia.org/wiki/Catalan_number#Applications_in_combinatorics

u****4
发帖数: 5
4
symmetric random walk. X(red)=1, X(black)=-1. X_1 must be 1, X_{2n} must be
-1. then use reflection...

【在 a*******1 的大作中提到】
: 红球黑球各n个,排成一列,要求对任意的m<=2n,前m个球中红球的数目不少于黑球的
: 数目。问有多少种排列的方法?谢谢。

d*********n
发帖数: 27
5
I have a naive solution, but I am not sure if this is what's asked for.
If there are "i" black balls in the first "m", then there are
{m, i} * {2n-m, n-i}
ways to arrange all the balls. ( note: {m,i}=m!/(i!(m-i)!) )
Since there are at most [m/2] black balls in the first m, the total number
is
sum_{i=0}^[m/2] {m, i} * {2n-m, n-i}
u****4
发帖数: 5
6
i think the lz means for all m, not a given m...so you probabily answered to
a different question..

【在 d*********n 的大作中提到】
: I have a naive solution, but I am not sure if this is what's asked for.
: If there are "i" black balls in the first "m", then there are
: {m, i} * {2n-m, n-i}
: ways to arrange all the balls. ( note: {m,i}=m!/(i!(m-i)!) )
: Since there are at most [m/2] black balls in the first m, the total number
: is
: sum_{i=0}^[m/2] {m, i} * {2n-m, n-i}

d*********n
发帖数: 27
7

to
You are right. My answer only works for any given "m" .
If all values of "m" are wanted, one can simply add all the cases up. There
is a simpler result for this case:
({2N,N} - K ) / 2 + K
where K is the total number of cases where "m" is even and half of the "m"
balls are red. This result is true because if all "m" are considered, one
only needs to notice that red and black balls have equal chance to dominate
the first "m" balls. The only complexity is that cases involving "K" should
be cou

【在 u****4 的大作中提到】
: i think the lz means for all m, not a given m...so you probabily answered to
: a different question..

u****4
发帖数: 5
8
are you sure there are no overlapping cases? hehe..

There
dominate
should

【在 d*********n 的大作中提到】
:
: to
: You are right. My answer only works for any given "m" .
: If all values of "m" are wanted, one can simply add all the cases up. There
: is a simpler result for this case:
: ({2N,N} - K ) / 2 + K
: where K is the total number of cases where "m" is even and half of the "m"
: balls are red. This result is true because if all "m" are considered, one
: only needs to notice that red and black balls have equal chance to dominate
: the first "m" balls. The only complexity is that cases involving "K" should

P********l
发帖数: 452
9
把红球看成左括号,黑球看成右括号。这个问题就变成了括号配对的问题。
f(n)=sum( f(i) * f(n-i-1) ) i=0 .. n-1
http://en.wikipedia.org/wiki/Binary_tree
wiki说这玩意就是 catlan number!

【在 a*******1 的大作中提到】
: 红球黑球各n个,排成一列,要求对任意的m<=2n,前m个球中红球的数目不少于黑球的
: 数目。问有多少种排列的方法?谢谢。

1 (共1页)
进入Quant版参与讨论
相关主题
问个有关排列的题
问一个model validation的技术问题
GS Interview question
继续问面试题(数学)
【Brain Teaser】出个题目
【Probability】问个概率的面试题
[合集] 贡献一个小题目
一道很简单的概率题
有人收到过今年MS intern的第一面么?
取球概率
相关话题的讨论汇总
话题: balls话题: 2n话题: black话题: cases话题: number