maplelab 发表于 2010-1-10 11:06:26

也看"一道初级数学题"

本帖最后由 maplelab 于 2010-1-10 11:07 编辑

详见:
http://forum.simwe.com/thread-913182-1-1.html

解:
a)
和=1:
代码:restart; f := unapply(x1/(10*x2+x3)+x4/(10*x5+x6)+x7/(10*x8+x9), ):
compute:= proc (f,a) local i, A; A := combinat(, 9); for i to nops(A) do if f(op(A)) =a then print() end if end do end proc:
compute(f,1);
结果:


b)
和=1/4:
代码:compute(f, 1/4)结果:

lin2009 发表于 2010-1-10 11:34:11

本帖最后由 lin2009 于 2010-1-10 12:08 编辑

1# maplelab
看到了用maple来算组合问题的实例(穷举法,楼主代码有误),有启示,学习啦。
楼主算算另一道例子:
http://forum.simwe.com/thread-913619-1-1.html

maplelab 发表于 2010-1-10 15:16:58

本帖最后由 maplelab 于 2010-1-10 15:27 编辑

代码要自己稍微调整一下,复制有点问题.

yntulin 发表于 2010-1-11 10:02:39

页: [1]
查看完整版本: 也看"一道初级数学题"