文学城论坛
+A-

回复:请教解数学题。

guest1000 2010-09-07 11:30:28 ( reads)

Maybe smart guys can see the close form solution right away. Here is one way tackling this problem step by step. Let's forget about the ,000 and assume there are $20 in total. Since the minumal investment is $1, we assign $1 to each project. Now we have $16 left. We need to assign $16 to 4 projects, with the possibility of assign $0 to some projects.

Denote this number by f($16,4), where 16 represents money and 4 represents the number of projects. We now can use dynamic programming.

It is easy to see that f($n,1)=0, f($n, 2)=n+1, and f($n, 3)=f($n,2)+f($n-1,2)+...+f($1,2)+f($0,2)=(n+1)+n+...+2+1=(n*n+3n+2)/2.

Thus, f($n,4)=f($n,3)+f($n-1,3)+...+f($0,3)=[(n*n+3n+2)+...+(1*1+3*1+2)+(0*0+3*0+2)]/2.

The answer to your first question is f($16,4)= HALF OF (16*16+...+1*1)+3*(16+...+1)+17*2.

The answer to your second question is f($16, 5), in which there is a dummy project absorbing the rest money. Of course, you need one more step of recursion.

Does anyone have a better solution procedure?

跟帖(13)

guest1000

2010-09-07 19:44:24

回复:回复:请教解数学题。

guest1000

2010-09-07 19:51:53

回复:回复:回复:请教解数学题。

皆兄弟也

2010-09-08 09:10:55

第二题答案是不是:C(16+3,3)+C(15+3,3)+...+C(1+3,3)+C(0+3,3)

jinjing

2010-09-08 09:35:30

I think we should change 16 to 20....we get C(24,4)=...

皆兄弟也

2010-09-08 10:00:33

how to understand: must be invested among 4 possible opportuniti

皆兄弟也

2010-09-08 10:03:46

even if we should change 16 to 20....we get C(21,4)=...

皆兄弟也

2010-09-08 10:07:18

sorry, C(21,4)=... wrong; C(24,4)=... right,if we should change

皆兄弟也

2010-09-08 10:09:50

you are right:C(20,4)=C(16+3,3)+C(15+3,3)+...+C(1+3,3)+C(0+3,3)

皆兄弟也

2010-09-08 10:37:04

第二题:What if not all money need be invested? 可这样理解:

皆兄弟也

2010-09-08 09:03:17

我认为,您的第一题答案是正确的。

guest1000

2010-09-08 12:31:24

回复:我认为,您的第一题答案是正确的。

皆兄弟也

2010-09-08 13:03:14

yes,您的第二题答案是正确的,as well。

皆兄弟也

2010-09-08 13:17:31

Put 16 balls in 5 bins, no matter 5 bins can be empty or not, wh