Processing math: 100%

2020年7月30日星期四

Variation argument is everywhere

Today I am asked a high school level question: given 1p1p2pn0 and find a subset of these number such that to maximize the quantity
F(S)=|S|i=1pαi1pαi(|S|j=1(1pαj)).
If one would like to use the search naively, the complexity will be of course large as n!. I want to say a simple variational argument is although simple but useful. But supposing adding one more element, deleting one element, or replacing one element, one can see quickly the description for this optimal subset is τ that
S:={pi}1iτ,τ:=min{nN:τi=1pi1pi1}.
Thus the complexity is reduced to O(n). So let us always think about the variational argument.

没有评论:

发表评论