找回密码
 立即注册
搜索
总共850条微博

动态微博

查看: 2705|回复: 4
打印 上一主题 下一主题
收起左侧

数字排序 from WXC

[复制链接]

53

主题

363

帖子

4139

积分

跳转到指定楼层
楼主
发表于 2005-4-15 18:05:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

Difficulty: +++
 
1,2,3,...,10任意排列,必可找出4个,它们是升序或降序的
 
General version: Given a number k > 1, find the smallest number n so that when 1,2,3,...,n put in any order, there are always k of them in increasing or decreasing order.
 www.ddhw.com
This problem appeared at WXC yesterday. It does not look very difficult and should have a simple solution. But I did not find one.  The solution I have is to solve the general version and then apply the result to 4.
www.ddhw.com

 
回复

使用道具 举报

53

主题

363

帖子

4139

积分

沙发
 楼主| 发表于 2005-4-22 20:25:07 | 只看该作者

We were beaten this time


This solution appeared at WXC. www.ddhw.com

定义:
i(k): 以第 k 数为结尾的最长升列的长度
d(k): 以第 k 数为开头的最长降列的长度

注意到当 m< n 时, 不可能有 (i(m), d(m))=(i(n), d(n)). 因为假如第m数小于 第 n 数, 则可把第 n 数加在任何以第 m 数为结尾的升列上构成更长的升列,所以 i(m)< i(n). 反之, 如果第m数小于 第 n 数, 则可推出 d(m)>d(n).

这样,考察所有的 (i(m), d(m)) 的取值, 应该有 10 中可能,则他们不可能都是 (1,1), (1,2), ... (3,3). 必然至少有一个 i(m) 或者 d(m) 不小于4。

对一般的情况类似讨论。可证明,当 n 不小于 (k-1)^2+1 时, 肯定有长度为 k 的升列或降列。

The following is my solution, which is not nearly as good. www.ddhw.com

For i, j >= 2, let M(i,j) be the smallest integer such that any sequence of length M(i,j) must contain an increasing subsequence of length i or a decreasing subsequence of length j. We prove inductively that M(i,j) <= (i-1)(j-1) + 1. www.ddhw.com

First we know M(i,2) = i. Now for j >= 3, form a subsequence this way: let a1 = smallest number in the sequence. a(k+1) = the smallest number after ak. If the length of the subsequece >= i, we are done. Otherwise we need an increasing subsequence of length i or a decreasing subsequence of length j-1 in the rest of the original sequence. Therefore we have M(i,j) <= M(i,j-1) + (i-1).

It is easy to see that M(i,j) >= (i-1)(j-1) + 1. So we will leave it as homework.

(Still remember in college days, whenever a professor met something he does not want to or forgot how to prove, or a question he does not know how to answer, he would leave it as home work. I don't know whether professors of nowadays, such as wild cauliflower, still do that. :) )

www.ddhw.com

 
回复 支持 反对

使用道具 举报

5

主题

155

帖子

1115

积分

板凳
发表于 2005-4-23 00:06:13 | 只看该作者

I think this is equally good.


So you are now considering yourself a member here and not one of WXC or QQSH? www.ddhw.com
 
I think the best players are here.  It looks like the guy who solved this problem in WXC is just a visitor.
www.ddhw.com

 
回复 支持 反对

使用道具 举报

53

主题

363

帖子

4139

积分

地板
 楼主| 发表于 2005-4-23 00:48:37 | 只看该作者

回复:I think this is equally good.


I consider myself a member of all three places. Two regular members at WXC, avanade, who posted the problem, and 梦回汉朝, apparantly knew the answer. Members here may also have known the answser.

Some regular members here, such as wild cauliflower, are too busy to solve more difficult problems. While the new members at WXC (the idiots) are very good. So it is hard to say which site is stronger now.www.ddhw.com

 
回复 支持 反对

使用道具 举报

105

主题

381

帖子

6171

积分

5#
发表于 2005-4-23 01:46:26 | 只看该作者

回复:We were beaten this time


You said:"It is easy to see that M(i,j) >= (i-1)(j-1) + 1. So we will leave it as homework. "

But this was what you proved.  Do you mean -1?

www.ddhw.com

 

回复 支持 反对

使用道具 举报

24小时热帖
    一周热门
      原创摄影
        美食美文
          您需要登录后才可以回帖 登录 | 立即注册

          本版积分规则

          Archiver|手机版|珍珠湾ART

          Powered by Discuz! X3 © 2001-2013 All Rights Reserved