由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - Coi pickup optimization problem?
相关主题
大家来扔硬币-an interview question[合集] 苦闷, portfolio optimization 问题求助
掷硬币问题[合集] 苦闷, portfolio optimization 问题求助
[合集] A problem in linear regressionA coin throwing question.
【Probability】Coin Problem一道概率题,大家看看
问一道题Recommendation needed: optimize trading strategy
[合集] one interview question about coins问题:why is it never optimal to early exercise the call when it is equivalent to a put?
Brain teaser questionPortfolio Optimization Specialist
苦闷, portfolio optimization 问题求助小题目(2006/07/30)
相关话题的讨论汇总
话题: sum话题: max话题: coi话题: 硬币
进入Quant版参与讨论
1 (共1页)
y****n
发帖数: 60
1
有50个硬币在一条线上。两个人轮流拿,只能拿两端的(比如说第一个人开始只能拿第
一或者第50个硬币)。什么算法可以让第一个人拿到的钱最多?
C***m
发帖数: 120
2
First pick: add up coin 1,3,5,...,49, sum is A. Sum of coin 2,4,6,...,50 is
B. If A>B choose 1; if A Every time, follow the similar strategy. Easy to see, player 1 could earn at
least Max(A,B). Feel it is the best, not a rigorous proof though.
C***m
发帖数: 120
3
这个方法不对,比如4个coin(5,1,5,6)。
可能还是得用DP来做,求大牛指点。

is
at

【在 C***m 的大作中提到】
: First pick: add up coin 1,3,5,...,49, sum is A. Sum of coin 2,4,6,...,50 is
: B. If A>B choose 1; if A: Every time, follow the similar strategy. Easy to see, player 1 could earn at
: least Max(A,B). Feel it is the best, not a rigorous proof though.

A**u
发帖数: 2458
4
V(i,j) 是 考虑i,i+1,...,j-1,j个硬币是, max-gain
有. V(i,i) = C[i], 只剩下1个硬币.
当 j>i时,
V[i,j], 可以从左拿, 值是 C[i] - V(i+1,j)
从右拿,值是C[j] - V(i,j-1)
V(i,j) = max(C[i] - V(i+1,j), C[j] - V(i,j-1))
像Caxim说的,DP,或者递归
C***m
发帖数: 120
5
挺好的,这里可能是要 V(i,j) = max(Sum_i^j C[k] - V(i+1,j), Sum_i^j C[k] - V(
i,j-1))

【在 A**u 的大作中提到】
: V(i,j) 是 考虑i,i+1,...,j-1,j个硬币是, max-gain
: 有. V(i,i) = C[i], 只剩下1个硬币.
: 当 j>i时,
: V[i,j], 可以从左拿, 值是 C[i] - V(i+1,j)
: 从右拿,值是C[j] - V(i,j-1)
: V(i,j) = max(C[i] - V(i+1,j), C[j] - V(i,j-1))
: 像Caxim说的,DP,或者递归

1 (共1页)
进入Quant版参与讨论
相关主题
小题目(2006/07/30)问一道题
推荐data mining 的书[合集] one interview question about coins
概率题 - looks apparent, but can you prove rigorously?Brain teaser question
Brownian motion的 dB_t 啥意思?苦闷, portfolio optimization 问题求助
大家来扔硬币-an interview question[合集] 苦闷, portfolio optimization 问题求助
掷硬币问题[合集] 苦闷, portfolio optimization 问题求助
[合集] A problem in linear regressionA coin throwing question.
【Probability】Coin Problem一道概率题,大家看看
相关话题的讨论汇总
话题: sum话题: max话题: coi话题: 硬币