[離散] 解遞迴

看板Math作者 (Carmelo)時間14年前 (2012/02/19 23:00), 編輯推噓0(004)
留言4則, 1人參與, 最新討論串2/2 (看更多)
Let A={1,2,...,9}.Then there are ____ subsets of A which do not contain consecutive numbers.(i.e.,if x belongs to A is in the subset then x-1 and x+1 must not be selected.) 這題我知道大概是要用遞迴去算,但 recurrence relation 寫不太出來 麻煩大家幫我解答了 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.150.59

02/19 23:30, , 1F
如果{1,2,..,n}有A_n種 那就是A_n+1=A_n+A_n-1
02/19 23:30, 1F

02/19 23:31, , 2F
因為{1,2,..,n+1}的所有可能子集分為有n+1與沒有n+1
02/19 23:31, 2F

02/19 23:32, , 3F
有n+1的話 必定沒有n 所以剩下的就是A_n-1種
02/19 23:32, 3F

02/19 23:32, , 4F
沒有n+1的話 就是A_n了
02/19 23:32, 4F
文章代碼(AID): #1FGGwBwc (Math)
討論串 (同標題文章)
文章代碼(AID): #1FGGwBwc (Math)