- 最后登录
- 2017-10-10
- 在线时间
- 88 小时
- 阅读权限
- 20
- 注册时间
- 2008-3-19
- 积分
- 421
- 帖子
- 233
- 精华
- 2
- UID
- 25681
- 性别
- 保密

- 积分
- 421
- 帖子
- 233
- 精华
- 2
- UID
- 25681
- 性别
- 保密
|
<P>想到一个思路:基础是一个同级相换的方法数序列,也就是X分换1分,2分,5分的方法数,如下</P>
<P> </P>
<P><STRONG>序列一:</STRONG></P>
<P>单位:分 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...</P>
<P>换分的方法数 1 1 2 2 3 4 5 6 7 <FONT color=yellowgreen>8</FONT> <FONT color=sandybrown>10</FONT> 11 13 14 16 18 20 22 24 <FONT color=purple>26</FONT> <FONT color=royalblue>29</FONT> ...</P>
<P> </P>
<P>这个序列也适用于角,同级即可。然后,在10的倍数的位置,取差一级相换的方法数序列。</P>
<P> </P>
<P><STRONG>序列二:</STRONG></P>
<P>单位:角 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...</P>
<P>换分的方法数 1-<FONT color=seagreen>10</FONT>-29-58-97-146-205-274-353-442-541-650-769-898-1037-1186-1345-1514-1693-1882-2081 ...</P>
<P> </P>
<P>我是编程算的序列,速度还行。看了一下曲线,非常类似e指数曲线,只是不知道有什么规律没有?<IMG alt="" src="http://bbs.mf8-china.com/images/smilies/default/mad.gif" border=0 smilieid="11"> </P>
<P> </P>
<P>由于元和角分的情况不同,大于等于10元方法数会增加,元换元的方法数形成了新的序列。</P>
<P> </P>
<P><STRONG>序列三:</STRONG></P>
<P>单位:元 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...</P>
<P>换元的方法数 1 1 <FONT color=red>2</FONT> 2 3 4 5 6 7 8 11 12 15 16 19 22 25 28 31 34 41 ...</P>
<P> </P>
<P>我这里的方法数包括了自身换自身,比如1元换1元也算做一种方法,这样有利于编程和理解,如果想得到小面值的组合种数,只需要减去1即可。</P>
<P> </P>
<P><FONT color=red>M元方法数=M元换元数*0元角分方法数+(M-1)元换元数*1元角分方法数+ ... +0元换元数*M元角分方法数</FONT></P>
<P><FONT color=red></FONT> </P>
<P><FONT color=red>N元角分方法数=10*N角换角分方法数=10*N角换角方法数*0角换分方法数+(10*N-1)角换角方法数*1角换分方法数+ ... +0角换角方法数*10*N角换分方法数</FONT></P>
<P> </P>
<P> </P>
<P>比如算2元的方法数</P>
<P> </P>
<P>2元方法数=2元换元数*0元角分方法数+1元换元数*1元角分方法数+0元换元数*2元角分方法数</P>
<P> =2元换元数*0元角分方法数+1元换元数*(10角换角数+9角换角数*1角换分数+ ... +1角换角数*19角换分数+20角换分数)+0元换元数*(20角换角数+19角换角数*1角换分数+ ... +1角换角数*19角换分数+20角换分数)</P>
<P> =<FONT color=red>2</FONT>+1*(<FONT color=sandybrown>10</FONT>+<FONT color=yellowgreen>8</FONT>*<FONT color=seagreen>10</FONT>+ ... +1*442+541)+1*(<FONT color=royalblue>29</FONT>+<FONT color=purple>26</FONT>*<FONT color=seagreen>10</FONT>+ ... +1*1882+2081) (注:根据颜色对应序列1~3中的数)</P>
<P> =73682(种)</P>
<P> </P>
<P>程序如下,有时候程序更易于理解,Yuan为多少元,Tong为同级序列,Lin为临级序列,YY为元换元方法数序列:</P>
<P>Yuan=2;<BR>Method=0;<BR>for i=0:Yuan<BR> Method=Method+YY(i+1)*sum(Tong(1 :Yuan-i)*10+1).*Lin((Yuan-i)*10+1:-1:1));<BR>end</P>
<P>可以看出无论是元换角还是角换分都要一元一角地向后退,这样就不会遗漏任何情况了,<IMG alt="" src="http://bbs.mf8-china.com/images/smilies/default/loveliness.gif" border=0 smilieid="28"> </P>
[ 本帖最后由 金眼睛 于 2008-6-4 17:58 编辑 ] |
|