由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - 请教一道 hedge fund 电面算法题
相关主题
有个公司要让我做coding testa question about futures curve
Please help me on VBA请教一个stochastic integral的问题
Ex-SocGen Trader Found Guilty of Stealing Secrets关于Affine Model一问
one algorithm problemMulti Demensional Optimisation
what's local vol??A statistics question
brownian motion, got an answer but do not feel confident. H一道面试题 (非IB)
a pobability problem一个 interatedBM 问题
这个process叫什么名字(stochastic)gs superday后的悲剧+面试题目
相关话题的讨论汇总
话题: sentence话题: word话题: solution话题: words话题: each
进入Quant版参与讨论
1 (共1页)
g*****n
发帖数: 21
1
There's a book and each sentence consists of several words. How to find the
minimal set of words which can used by the reader to understand half of
total number of the sentences. Each sentence is readable if the reader know
all the words.
I can only think of brute force solution -- do word counting on every
possible collection of half number of sentences and choose the minimal. But
that's exponential C(n,n/2).
Any better solution?
Thanks
J*****n
发帖数: 4859
2
回溯法对这类题目是万能的。不过认为有更好的算法。
m*******r
发帖数: 98
3

the
know
But
Simple greedy strategies do not work here.
Sounds like a NPC problem.
If it is NPC, then the brute force method is fine.

【在 g*****n 的大作中提到】
: There's a book and each sentence consists of several words. How to find the
: minimal set of words which can used by the reader to understand half of
: total number of the sentences. Each sentence is readable if the reader know
: all the words.
: I can only think of brute force solution -- do word counting on every
: possible collection of half number of sentences and choose the minimal. But
: that's exponential C(n,n/2).
: Any better solution?
: Thanks

a****y
发帖数: 99
4
for me, it looks like a NP problme
IMHO, a greedy solution:
a mixed-integer program
minimize z= sum_{i} I_{word i} # I_{word i} is binary , 1 included,
otherwise 0 .
subject to sum_{each sentence} exp{ (total word # - sum_I_{word i} ) * c
}>= # of sentence/ 2
the constanc c can to be adjusted to depressed unreadable sentence.
an improvement : assume I_{word i} can be a real number among [0, 1] ,
reduce the MIP to a LP. solve it, take the max I_{word i} to be 1 and fix it
. then do it until find a feasible solution.


the
know
But

【在 g*****n 的大作中提到】
: There's a book and each sentence consists of several words. How to find the
: minimal set of words which can used by the reader to understand half of
: total number of the sentences. Each sentence is readable if the reader know
: all the words.
: I can only think of brute force solution -- do word counting on every
: possible collection of half number of sentences and choose the minimal. But
: that's exponential C(n,n/2).
: Any better solution?
: Thanks

l******e
发帖数: 470
5
set cover problem. an NPC problem.
greedy works fine here.

the
know
But

【在 g*****n 的大作中提到】
: There's a book and each sentence consists of several words. How to find the
: minimal set of words which can used by the reader to understand half of
: total number of the sentences. Each sentence is readable if the reader know
: all the words.
: I can only think of brute force solution -- do word counting on every
: possible collection of half number of sentences and choose the minimal. But
: that's exponential C(n,n/2).
: Any better solution?
: Thanks

u******s
发帖数: 157
6
What does NPC mean? Thx.
1 (共1页)
进入Quant版参与讨论
相关主题
gs superday后的悲剧+面试题目what's local vol??
问一个作业题目brownian motion, got an answer but do not feel confident. H
问一道面试题(zz)a pobability problem
JPM interview questions这个process叫什么名字(stochastic)
有个公司要让我做coding testa question about futures curve
Please help me on VBA请教一个stochastic integral的问题
Ex-SocGen Trader Found Guilty of Stealing Secrets关于Affine Model一问
one algorithm problemMulti Demensional Optimisation
相关话题的讨论汇总
话题: sentence话题: word话题: solution话题: words话题: each