[理工] [離散] 導遞迴式

看板Grad-ProbAsk作者 (無法顯示)時間15年前 (2011/01/04 22:57), 編輯推噓3(309)
留言12則, 3人參與, 最新討論串1/3 (看更多)
find the number of ternary strings(containing only 0,1,2) that contain two consecutive 0 ---------------------------------------------------------- find the number of bit strings that contain the string "01" 請問這兩題要怎麼導呢? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.166.117.115

01/04 23:01, , 1F
第一個 an=2an-1 + 2an-2
01/04 23:01, 1F

01/04 23:02, , 2F
我寫錯了
01/04 23:02, 2F

01/04 23:39, , 3F
請問是contain two consecutive 0 還是 not contain
01/04 23:39, 3F

01/04 23:39, , 4F
contain 我覺得好難想
01/04 23:39, 4F

01/04 23:41, , 5F
這是完整題目嘛?
01/04 23:41, 5F

01/04 23:41, , 6F
contain的話 應該不太能寫成遞迴吧
01/04 23:41, 6F

01/05 00:02, , 7F
好像可以 an=2an-1 + (3^(n-2))*2an-2 +an-2+1
01/05 00:02, 7F

01/05 00:03, , 8F
疑不對= = 啊啊啊 寫錯了
01/05 00:03, 8F

01/05 00:12, , 9F
2an-1種末數是1or2 + 2an-2種末數是10 20 +3^n-2種末數是00
01/05 00:12, 9F

01/05 00:13, , 10F
an= 2an-1 +2an-2 +3^(n-2)
01/05 00:13, 10F

01/05 00:31, , 11F
這題很怪阿,這種題目我看都是不包含的
01/05 00:31, 11F
題目是包含的 contain 我看過的題目也都是不包含的= = ※ 編輯: mqazz1 來自: 218.166.117.115 (01/05 00:37)

09/11 14:08, , 12F
第一個 an=2an- https://daxiv.com
09/11 14:08, 12F
文章代碼(AID): #1D8pL3gN (Grad-ProbAsk)
文章代碼(AID): #1D8pL3gN (Grad-ProbAsk)