一直搞不懂要怎么把题目的叙述化成递回关系式子
像是Rosen的第七版离散 p.510的第4和p.511的第8题
4. A country uses as currency coins with values of 1 peso,
2 pesos, 5 pesos, and 10 pesos and bills with values of
5 pesos, 10 pesos, 20 pesos, 50 pesos, and 100 pesos.
Find a recurrence for the number of ways to pay a bill
of n pesos if the order in which the coins and bills are paid matters.
助教给的答案是
An = An-1 + An-2 + 2*An-5 + 2*An-10 + An-20 + An-50 + An-100
8. Find a recurrence relation for the number of bit strings
of length n that contain three consecutive 0s.
Ans:
分成4个case讨论,ending with 1, 10, 100, and 000
An = An-1 + An-2 + An-3 + 2^(n-3)
不懂为什么要分成4个case讨论
也不太懂为什么1结尾时,会有An-1种组合,
最后000结尾时,又为什么是2^(n-3) @@
有没有大大能用比较浅显的方式说明呢?
或是有哪位老师的讲义比较推荐的
谢谢~