回复:请教解数学题。

回答: 请教解数学题。灰衣人2010-09-06 18:14:36

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?

所有跟帖: 

回复:回复:请教解数学题。 -guest1000- 给 guest1000 发送悄悄话 (364 bytes) () 09/07/2010 postreply 19:44:24

回复:回复:回复:请教解数学题。 -guest1000- 给 guest1000 发送悄悄话 (45 bytes) () 09/07/2010 postreply 19:51:53

第二题答案是不是:C(16+3,3)+C(15+3,3)+...+C(1+3,3)+C(0+3,3) -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 09:10:55

I think we should change 16 to 20....we get C(24,4)=... -jinjing- 给 jinjing 发送悄悄话 (0 bytes) () 09/08/2010 postreply 09:35:30

how to understand: must be invested among 4 possible opportuniti -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (81 bytes) () 09/08/2010 postreply 10:00:33

even if we should change 16 to 20....we get C(21,4)=... -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 10:03:46

sorry, C(21,4)=... wrong; C(24,4)=... right,if we should change -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 10:07:18

you are right:C(20,4)=C(16+3,3)+C(15+3,3)+...+C(1+3,3)+C(0+3,3) -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 10:09:50

第二题:What if not all money need be invested? 可这样理解: -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (271 bytes) () 09/08/2010 postreply 10:37:04

我认为,您的第一题答案是正确的。 -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (265 bytes) () 09/08/2010 postreply 09:03:17

回复:我认为,您的第一题答案是正确的。 -guest1000- 给 guest1000 发送悄悄话 (327 bytes) () 09/08/2010 postreply 12:31:24

yes,您的第二题答案是正确的,as well。 -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 13:03:14

Put 16 balls in 5 bins, no matter 5 bins can be empty or not, wh -皆兄弟也- 给 皆兄弟也 发送悄悄话 皆兄弟也 的博客首页 (0 bytes) () 09/08/2010 postreply 13:17:31

请您先登陆,再发跟帖!