一直搞不懂要怎麼把題目的敘述化成遞迴關係式子
像是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) @@
有沒有大大能用比較淺顯的方式說明呢?
或是有哪位老師的講義比較推薦的
謝謝~